1.看板数据修正

2.增加环境变量配置
master
董哲奇 5 months ago
parent 5d83ff9435
commit 63bad504bf

@ -234,6 +234,8 @@ public class DmYdjh implements Serializable {
private String ylbs;//余料标识
private String plxh;//批量序号,用于语音批次派工
@TableId(value = "id", type = IdType.ASSIGN_UUID)
private String id;

@ -9,6 +9,8 @@ import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@ -45,7 +47,7 @@ import lombok.AllArgsConstructor;
*/
@RestController
@RequestMapping("kban")
@AllArgsConstructor
@RequiredArgsConstructor
public class KbanController {
private final ZyjhService zyjhService;
@ -54,6 +56,9 @@ public class KbanController {
private final SyMsgService msgService;
private final DmSygdMxService service;
@Value("${pdfUri}")
private String pdfUri;
/**
*
*/
@ -75,15 +80,15 @@ public class KbanController {
*/
@GetMapping("/pdfList")
public ResultBean<?> pdfList(String dcCh,String dcPl) {
String absolutePath = FileUtil.getWebRoot().getAbsolutePath();
List<File> ls;
try {
ls = FileUtil.loopFiles(StrUtil.format("{}/../static/upload/{}/{}/PDF",absolutePath, dcCh, dcPl));
ls = FileUtil.loopFiles(StrUtil.format("{}/{}/{}/PDF", pdfUri,dcCh, dcPl));
return new ResultBean<>(ls.stream().map(FileUtil::getPrefix));
}catch (Exception e){
ls = FileUtil.loopFiles(StrUtil.format("{}/static/upload/{}/{}/PDF",absolutePath, dcCh, dcPl));
e.printStackTrace();
}
return new ResultBean<>(ls.stream().map(FileUtil::getPrefix));
return new ResultBean<>();
}
/**

@ -165,7 +165,7 @@ public class KbanService {
if (zt>=11){
sl.incrementAndGet();
}
if (zt>=42){
if (zt>=21){
slc.incrementAndGet();
}
if (kw==1){

@ -246,6 +246,14 @@ public class DmYdjhServiceImpl extends ServiceImpl<DmYdjhMapper, DmYdjh> impleme
String bzrq= DateUtil.format(DateUtil.date(), "yyyy/MM/dd");
String gxsj=DateUtil.date().toString("yyyy/MM/dd HH:mm:ss");
Map<String, List<DmYdjh>> collect = ydjhList.stream().collect(Collectors.groupingBy(item -> item.getDcCh() + "_" + item.getDcPl()));
collect.forEach((key,val)->{
String plXh = this.getPlGdh();
val.forEach(item->{
item.setPlxh(plXh);
});
});
//工单号
List<DmYdjh> updateList = ydjhList.stream()
.filter(item->StrUtil.isNotEmpty(item.getSljhrq()))
@ -314,6 +322,7 @@ public class DmYdjhServiceImpl extends ServiceImpl<DmYdjhMapper, DmYdjh> impleme
perfix=perfix.substring(2);
dmYdjh.setDjh(StrUtil.format("{}{}",perfix, String.format("%03d",djh)));
dmYdjh.setGxsj(gxsj);
dmYdjh.setPlxh(item.getPlxh());
return dmYdjh;
}
@ -326,4 +335,15 @@ public class DmYdjhServiceImpl extends ServiceImpl<DmYdjhMapper, DmYdjh> impleme
return redisTemplate.opsForHash().increment(key, item.getSljhrq(), 1);
}
private String getPlGdh(){
String date=DateUtil.date().toString("yyyyMMdd");
String key="ZYJH_PLGDH::";
Object o = redisTemplate.opsForHash().get(key, date);
if (ObjUtil.isEmpty(o)) {
redisTemplate.opsForHash().put(key, date,100);
}
Long xh=redisTemplate.opsForHash().increment(key, date, 1);
return StrUtil.format("{}{}",date, String.format("%03d",xh));
}
}

@ -45,5 +45,7 @@ zxtbm=PS
spring.resources.static-locations=file:./static
pdfUri=D:/javaweb/static/upload

@ -904,7 +904,7 @@ where dc_ch=#{dcch} and dc_pl =#{dcpl}
<select id="getYdjhByZt" resultType="map">
select
dc_ch dcCh,dc_pl dcPl,count(1) total,
dc_ch dcCh,dc_pl dcPl,count(1) total,plxh,
<if test="wgzt=='62'">
sum(case when isnull(qgfkry,'')='' then 1 else 0 end) wwg,
sum(case when isnull(qgfkry,'')!='' then 1 else 0 end) comp,
@ -932,7 +932,7 @@ where dc_ch=#{dcch} and dc_pl =#{dcpl}
from
dm_ydjh
where zt>=2 and zt&lt;=62
group by dc_ch, dc_pl
group by dc_ch, dc_pl,plxh
order by dc_ch,dc_pl
</select>

@ -111,7 +111,7 @@
</select>
<select id="qfxq" resultType="java.lang.String">
SELECT sum(dzjz) from dm_qfxq where xzglxq BETWEEN #{from} and #{to}
SELECT sum(dzjz) from dm_sygdxq where xzglxq BETWEEN #{from} and #{to}
</select>
<select id="qfxqDetail" resultType="java.util.Map">
@ -120,22 +120,23 @@
sum(case when isnull(dc_pl,'')!='' then 1 else 0 end) OVER(PARTITION by dc_ch) pcsl ,
sum(dzjz) OVER(PARTITION by dc_ch) zl
from
dm_qfxq
dm_sygdxq
where
xzglxq BETWEEN #{from} and #{to}
</select>
<select id="qfxqWcqk" resultType="java.util.Map">
SELECT * from (
SELECT
DISTINCT xq.dc_ch ,
sum(isnull(xq.dzjz,0)/1000) over(PARTITION by xq.dc_ch) xqzl ,
SUM(CONVERT( decimal, isnull(ydjh.bclqzl,'0')/1000)) over(PARTITION by xq.dc_ch) jhzl ,
SUM(CONVERT( decimal, case when ydjh.zt>=62 then ydjh.bclqzl else '0' end)) over(PARTITION
by xq.dc_ch) wczl
SUM(CONVERT( decimal, case when ydjh.zt>=62 then ydjh.bclqzl else '0' end)) over(PARTITION by xq.dc_ch) wczl
from
dm_qfxq xq left join dm_ydjh ydjh on xq.dc_ch =ydjh.dc_ch and xq.dc_pl =ydjh.dc_pl
dm_sygdxq xq left join dm_ydjh ydjh on xq.dc_ch =ydjh.dc_ch and xq.dc_pl =ydjh.dc_pl and xq.DC_FD =ydjh.DC_FD
where
xq.xzglxq BETWEEN #{from} and #{to}
) a where a.jhzl!=0
</select>
<select id="zyjh" resultType="java.util.Map">
@ -213,7 +214,7 @@
from (
SELECT DC_CH , DC_PL ,1 t
from dm_zrcjh
where jssj_xz BETWEEN #{from} and #{to} group by DC_CH,DC_PL ) a group by dc_ch
where gjks BETWEEN #{from} and #{to} group by DC_CH,DC_PL ) a group by dc_ch
</select>
<!-- 图纸数量 -->

Loading…
Cancel
Save