1.修正同步小池的时间格式不符的问题

2.修正派工时间格式不符的问题
3.质量跟踪数据写入
master
董哲奇 4 months ago
parent aa87d5d522
commit 97672294ba

@ -1,5 +1,8 @@
package com.dsic.gj_erp.bean.czzj; package com.dsic.gj_erp.bean.czzj;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.dsic.gj_erp.bean.jhgk.DmYdjhLj;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@ -7,6 +10,7 @@ import lombok.Setter;
@Setter @Setter
public class MpDhsj { public class MpDhsj {
@TableId(type = IdType.INPUT)
private String dhh; private String dhh;
private String wph; private String wph;
@ -17,7 +21,7 @@ public class MpDhsj {
private String gzbm; private String gzbm;
private String dhsl; private Double dhsl;
private String cpxql; private String cpxql;
@ -50,4 +54,21 @@ public class MpDhsj {
private String hxfl; private String hxfl;
private String dhsl1; private String dhsl1;
private String sjksrqg;
public static MpDhsj of(DmYdjhLj lj,String qgrq,String lph){
MpDhsj mp = new MpDhsj();
mp.setDcCh(lj.getCzbh());
mp.setDcPl(lj.getPl());
mp.setDcFd(lj.getCzbh()+"="+lj.getFd());
mp.setDcTh(lj.getTlth());
mp.setWph(lj.getLjbh());
mp.setDcTpbh(lj.getLjcz());
mp.setDcTpmc(lj.getLjgg());
mp.setSjksrqg(qgrq);
mp.setDhsl(lj.getSl());
mp.setDcLph(lph);
return mp;
}
} }

@ -9,7 +9,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.dsic.gj_erp.annotation.AuthFunction; import com.dsic.gj_erp.annotation.AuthFunction;
import com.dsic.gj_erp.bean.ResultBean; import com.dsic.gj_erp.bean.ResultBean;
import com.dsic.gj_erp.bean.czzj.MpDhsj;
import com.dsic.gj_erp.bean.jhgk.DmYdjh; import com.dsic.gj_erp.bean.jhgk.DmYdjh;
import com.dsic.gj_erp.bean.jhgk.DmYdjhLj;
import com.dsic.gj_erp.bean.kc.ImCkwpkwp; import com.dsic.gj_erp.bean.kc.ImCkwpkwp;
import com.dsic.gj_erp.bean.zyjh.PwExcel; import com.dsic.gj_erp.bean.zyjh.PwExcel;
import com.dsic.gj_erp.bean.zyjh.Ycldw; import com.dsic.gj_erp.bean.zyjh.Ycldw;
@ -35,6 +37,8 @@ import java.io.IOException;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@RestController @RestController
@ -262,22 +266,26 @@ public class ZyjhController {
ycldwInfoService.updatePw(dto.getYcldwInfo()); ycldwInfoService.updatePw(dto.getYcldwInfo());
} }
//生成零件信息
list.forEach(item-> zyjhService.createLj(item.getDcCh(),item.getDcPl(),item.getTzbh()));
//生成质量信息
// List<MpDhsj> collect=new ArrayList<>();
// list.forEach(item -> {
// MpDhsj mpDhsj = new MpDhsj();
//
// collect.add(mpDhsj);
// });
// mpDhsjServcie.saveBatch(collect);
wsHandler.sendHXComplete((JSONObject) JSONObject.toJSON(dto.getYcldwInfo())); wsHandler.sendHXComplete((JSONObject) JSONObject.toJSON(dto.getYcldwInfo()));
wsHandler.sendQGComplete((JSONObject) JSONObject.toJSON(dto.getYcldwInfo())); wsHandler.sendQGComplete((JSONObject) JSONObject.toJSON(dto.getYcldwInfo()));
} }
//生成零件信息
for (DmYdjh item : list) {
List<DmYdjhLj> ljList = zyjhService.createLj(item.getDcCh(), item.getDcPl(), item.getTzbh());
//质量跟踪数据
List<MpDhsj> collect = new ArrayList<>();
String date = DateUtil.date().toString("yyyy/MM/dd");
String mpDhsjDhh = zyjhService.getMpDhsjDhh();
for (int j = 0; j < ljList.size(); j++) {
DmYdjhLj item2 = ljList.get(j);
MpDhsj mpDhsj = MpDhsj.of(item2, date, item.getSllph());
String xh = StrUtil.padPre(j + 1 + "", 3, "0");
mpDhsj.setDhh(mpDhsjDhh+"-"+xh);
collect.add(mpDhsj);
}
mpDhsjServcie.saveBatch(collect);
}
} }
zyjhService.updateBatchById(list); zyjhService.updateBatchById(list);

@ -4,6 +4,7 @@ package com.dsic.gj_erp.mapper.jhgk;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dsic.gj_erp.bean.jhgk.DmSygdMx; import com.dsic.gj_erp.bean.jhgk.DmSygdMx;
import com.dsic.gj_erp.bean.jhgk.DmYdjh; import com.dsic.gj_erp.bean.jhgk.DmYdjh;
import com.dsic.gj_erp.bean.jhgk.DmYdjhLj;
import com.dsic.gj_erp.bean.pgd.*; import com.dsic.gj_erp.bean.pgd.*;
import org.apache.ibatis.annotations.MapKey; import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -38,6 +39,7 @@ public interface DmYdjhMapper extends BaseMapper<DmYdjh> {
int tqlj(List<String> ids); int tqlj(List<String> ids);
int tqljByInfo(String dcCh,String dcPl,String tzbh); int tqljByInfo(String dcCh,String dcPl,String tzbh);
List<DmYdjhLj> getLjInfo(String dcCh,String dcPl,String tzbh);
List<PgdTzjh> getTzjh1(@Param("begin") String begin, @Param("end") String end); List<PgdTzjh> getTzjh1(@Param("begin") String begin, @Param("end") String end);

@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dsic.gj_erp.bean.jcsj.DmBzry; import com.dsic.gj_erp.bean.jcsj.DmBzry;
import com.dsic.gj_erp.bean.jcsj.DmCbxxp; import com.dsic.gj_erp.bean.jcsj.DmCbxxp;
import com.dsic.gj_erp.bean.jhgk.DmYdjh; import com.dsic.gj_erp.bean.jhgk.DmYdjh;
import com.dsic.gj_erp.bean.jhgk.DmYdjhLj;
import com.dsic.gj_erp.controller.zyjh.dto.PgWithPcDto; import com.dsic.gj_erp.controller.zyjh.dto.PgWithPcDto;
import com.dsic.gj_erp.controller.zyjh.dto.ShangLiao; import com.dsic.gj_erp.controller.zyjh.dto.ShangLiao;
import com.dsic.gj_erp.mapper.jhgk.DmYdjhMapper; import com.dsic.gj_erp.mapper.jhgk.DmYdjhMapper;
@ -19,6 +20,7 @@ import com.dsic.gj_erp.service.jcsj.DmCbxxpService;
import com.dsic.gj_erp.service.jhgk.DmYdjhLjService; import com.dsic.gj_erp.service.jhgk.DmYdjhLjService;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -28,7 +30,7 @@ import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Service @Service
@AllArgsConstructor @RequiredArgsConstructor
public class ZyjhService extends ServiceImpl<DmYdjhMapper,DmYdjh> { public class ZyjhService extends ServiceImpl<DmYdjhMapper,DmYdjh> {
private final DmBzryService bzryService; private final DmBzryService bzryService;
@ -36,11 +38,32 @@ public class ZyjhService extends ServiceImpl<DmYdjhMapper,DmYdjh> {
private final RedisTemplate<String,Object> redisTemplate; private final RedisTemplate<String,Object> redisTemplate;
private final DmYdjhLjService ljService; private final DmYdjhLjService ljService;
private static final String MPDHSJ_KEY="MPDHSJ";
public String getMpDhsjDhh(){
String date=DateUtil.date().toString("yyyyMMdd");
Long xh = (Long) redisTemplate.opsForHash().get(MPDHSJ_KEY, date);
if(ObjUtil.isEmpty(xh)){
redisTemplate.opsForHash().put(MPDHSJ_KEY, date,0);
}
Long increment = redisTemplate.opsForHash().increment(MPDHSJ_KEY, date, 1);
return date+StrUtil.padPre(increment+"",3,"0");
}
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void createLj(String dcCh, String dcPl, String tzbh){ public List<DmYdjhLj> createLj(String dcCh, String dcPl, String tzbh){
baseMapper.tqljByInfo(dcCh,dcPl,tzbh); ljService.remove(Wrappers.<DmYdjhLj>lambdaQuery()
.eq(DmYdjhLj::getCzbh,dcCh)
.eq(DmYdjhLj::getPl,dcPl)
.eq(DmYdjhLj::getTlth,tzbh)
);
List<DmYdjhLj> ljInfo = baseMapper.getLjInfo(dcCh, dcPl, tzbh);
ljService.saveBatch(ljInfo);
return ljInfo;
} }
public List<DmYdjh> getYdjhByZtOrForeman(Integer zt,String foreman,String zyq){ public List<DmYdjh> getYdjhByZtOrForeman(Integer zt,String foreman,String zyq){
QueryWrapper<DmYdjh> wrapper = new QueryWrapper<DmYdjh>() QueryWrapper<DmYdjh> wrapper = new QueryWrapper<DmYdjh>()
.ge("zt",11) .ge("zt",11)

@ -897,6 +897,50 @@
and dm_ydjh.dc_ch=#{dcCh} and dm_ydjh.dc_pl=#{dcPl} and dm_ydjh.tzbh=#{tzbh} and dm_ydjh.dc_ch=#{dcCh} and dm_ydjh.dc_pl=#{dcPl} and dm_ydjh.tzbh=#{tzbh}
</insert> </insert>
<select id="getLjInfo" resultType="dmYdjhLj">
SELECT
REPLACE(CAST(CAST(NEWID()AS BINARY(10)) + CAST(GETDATE() AS BINARY(6)) AS UNIQUEIDENTIFIER),'-','') as id,
dm_ydjh.dc_ch as czbh,
dm_ydjh.dc_pl as pl,
dm_bom.fd as fd,
dm_ydjh.kw as kw,
dm_bom.zl as zl,
dm_bom.tzbh as tlth,
'' as ptblx,
dm_bom.ljbh as ljbh,
'' as ljmc,
dm_bom.wpgg as ljgg,
dm_bom.wpcz as ljcz,
'' as wpfl,
'' as jldw,
dm_bom.ljsl as sl,
dm_qfxq.xzglxq as qfxqrqxz,
dm_qfxq.dzglxq as qfxqrqdz,
'' as gylx,
dm_bom.pklx as pklx,
dm_bom.pkcd as pkcd,
case when isnull(dm_ydjh.pkrq,'')&lt;&gt;''
then 'Y'
else '' end ,
case when isnull(dm_ydjh.dmrq,'')&lt;&gt;''
then 'Y'
else '' end ,
dm_bom.dmcd as dmcd,
case when isnull(dm_ydjh.qjgrq,'')&lt;&gt;''
then 'Y'
else '' end,
'01',
'01','01',dm_ydjh.dmrq dmjhrq,dm_ydjh.pkrq pkjhrq,dm_ydjh.qjgrq qjgjhrq,'01'
from dm_ydjh,dm_bom
LEFT JOIN dm_qfxq on dm_qfxq.DC_CH=dm_bom.dcch and dm_qfxq.DC_PL=dm_bom.pl and dm_qfxq.DC_FD=dm_bom.fd
WHERE
dm_ydjh.dc_ch= dm_bom.dcch
and dm_ydjh.dc_pl=dm_bom.pl
and dm_ydjh.tzbh=dm_bom.tzbh
and dm_ydjh.dc_fd=dm_bom.fd
and dm_ydjh.dc_ch=#{dcCh} and dm_ydjh.dc_pl=#{dcPl} and dm_ydjh.tzbh=#{tzbh}
</select>
<select id="getYdjhMin" parameterType="string" resultType="com.dsic.gj_erp.bean.jhgk.DmYdjh"> <select id="getYdjhMin" parameterType="string" resultType="com.dsic.gj_erp.bean.jhgk.DmYdjh">
select isnull(min (slrq),'') as slrq, select isnull(min (slrq),'') as slrq,
isnull(min (pwrq),'') as pwrq, isnull(min (pwrq),'') as pwrq,

Loading…
Cancel
Save