master
xhj 5 months ago
parent 783c20a66d
commit c70fc0d5d3

@ -0,0 +1,85 @@
package com.dsic.gj_erp.bean.jcsj.excel;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* <p>
*
* </p>
*
* @author xn
* @since 2023-09-11
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="DmCzplpNew对象", description="")
public class PlExcelNew implements Serializable {
private static final long serialVersionUID=1L;
@ApiModelProperty(value = "批量")
@ExcelProperty(index = 0)
private String dcPL;
@ApiModelProperty(value = "分段")
@ExcelProperty(index = 1)
private String dcFd;
@ApiModelProperty(value = "吨位")
@ExcelProperty(index = 2)
private BigDecimal zl;
@ApiModelProperty(value = "钢加结束")
@ExcelProperty(index = 3)
@DateTimeFormat("yyyy/MM/dd")
private String xzjsq;
@ApiModelProperty(value = "钢加开始")
@ExcelProperty(index = 4)
@DateTimeFormat("yyyy/MM/dd")
private String gjks;
@ApiModelProperty(value = "套料图")
@ExcelProperty(index = 5)
@DateTimeFormat("yyyy/MM/dd")
private String xfqTlt;
@ApiModelProperty(value = "板材领取表")
@ExcelProperty(index = 6)
@DateTimeFormat("yyyy/MM/dd")
private String xfqLqb;
@ApiModelProperty(value = "订货清单发放")
@ExcelProperty(index = 7)
@DateTimeFormat("yyyy/MM/dd")
private String xfqDhqd;
@ApiModelProperty(value = "钢料到齐时间")
@ExcelProperty(index = 8)
@DateTimeFormat("yyyy/MM/dd")
private String bcdq;
@ApiModelProperty(value = "备注")
@ExcelProperty(index = 9)
private String bz;
}

@ -146,10 +146,12 @@ public class DmBomController {
List<String> AAA=new ArrayList<>();
AAA.add("165");
AAA.add("115");
AAA.add("117");
for(String aa:AAA){
List<DmBchxjbp> dmBchxjbps = dmBchxjbpService.list(new QueryWrapper<DmBchxjbp>().eq("DC_CH", "G175K-7").eq("DC_PL", aa));
List<DmBchxjbp> dmBchxjbps = dmBchxjbpService.list(new QueryWrapper<DmBchxjbp>().eq("DC_CH", "T300K-103").eq("DC_PL", aa));
List<Dm_zhbmp> zllbs = dm_zhbmpRepository.findByBMLB("ZLLB");
List<Dm_zhbmp> kwxxs = dm_zhbmpRepository.findByBMLB("KWXX");
@ -205,7 +207,9 @@ public class DmBomController {
dmYdjhadd.setHxcd(dmBchxjbp.getHxcd().doubleValue());
dmYdjhadd.setQgcd(dmBchxjbp.getYlzd4().doubleValue());
dmYdjhadd.setLjsl(dmBchxjbp.getLjsl().doubleValue());
dmYdjhadd.setZl(dmBchxjbp.getDcZl());
String zl = this.getZL(tzbh);
String zlbm = zllbMap.get(zl);
dmYdjhadd.setZl(zlbm);
String s = (String) kwxxMap.get(tzbh.substring(4, 7));
String zzcj = (String) qgKwMap.get(s); //xhj
dmYdjhadd.setKw(zzcj);
@ -237,7 +241,30 @@ public class DmBomController {
public String getZL(String tzbh) {
String bh = tzbh.substring(6, 8); // 72
if (tzbh.substring(4, 5).equals("X")) { // 51
if ("XX".equalsIgnoreCase(bh)) {
return "小组立";
} else if ("XD".equalsIgnoreCase(bh)) {
return "中大组立";
}
} else {
if ("XX".equalsIgnoreCase(bh)) {
return "焊接机器人肘板"; // todo 小组
} else if ("GX".equalsIgnoreCase(bh)) {
return "光电"; // todo
}
}
String bh1 = tzbh.substring(7, 8); // 81
if ("X".equalsIgnoreCase(bh1)) {
return "小组立";
}
if ("D".equalsIgnoreCase(bh1)) {
return "中大组立";
}
return "";
}

@ -99,7 +99,7 @@ public class BomUploadServiceImpl {
int ldpt = 1;
String czbh1 = "";
String pl1 = "";
//
List<DmBom> oloList = dmBomService.list(new QueryWrapper<DmBom>().eq("dcch", czbh)
.eq("pl", pl)
@ -148,6 +148,31 @@ public class BomUploadServiceImpl {
}
boolean fbom = false;
Integer cs = null;
System.out.println("Before sort:");
for (MultipartFile file1 : file) {
System.out.println(file1.getOriginalFilename());
}
// file 文件排序
Arrays.sort(file, (f1, f2) -> {
String name1 = f1.getOriginalFilename();
String name2 = f2.getOriginalFilename();
boolean containsKeyword1 = name1.contains("套料图") ;
boolean containsKeyword2 = name2.contains("套料图") ;
// 如果一个包含“套料图”,另一个不包含,则优先不包含的文件
if (containsKeyword1 && !containsKeyword2) {
return 1;
} else if (!containsKeyword1 && containsKeyword2) {
return -1;
}
// 如果都包含或都不包含,则按默认字母顺序排序
return name1.compareTo(name2);
});
System.out.println("After sort:");
for (MultipartFile file1 : file) {
System.out.println(file1.getOriginalFilename());
}
for (MultipartFile f : file) {
String fname = f.getOriginalFilename();
@ -158,6 +183,7 @@ public class BomUploadServiceImpl {
try (InputStream inputStream = f.getInputStream()) {
FileUtil.writeFromStream(inputStream, destFile);
}
List<String> lines = FileUtil.readLines(destFile, "GBK");
lines.forEach(e -> {
System.out.println("lines = " + e);
@ -1075,6 +1101,7 @@ public class BomUploadServiceImpl {
List<DmYdjh> adds1 = (List<DmYdjh>) bomxzjh.get("adds");
List<DmYdjh> ups = (List<DmYdjh>) bomxzjh.get("ups");
List<DmYdjh> yds = (List<DmYdjh>) bomxzjh.get("ydjhs");
String delid = (String) bomxzjh.get("deyd");
if(yds.size()>0){
for(DmYdjh dmYdjh:yds){
DmYdjh dmYdjh1 =new DmYdjh();
@ -1084,11 +1111,13 @@ public class BomUploadServiceImpl {
}
}
dmYdjhService.saveBatch(adds1);
dmYdjhService.updateBatchById(ups);
// 修正 生产计划。
DmYdjh delyd=new DmYdjh();
delyd.setZt("-1");
delyd.setId(delid);
dmYdjhService.updateById(delyd);
dmBchxmxpMapper.updateWpgg(czbh, pl);
dmBchxmxpMapper.updateWph(czbh, pl);
//上传文件到服务器
@ -1765,6 +1794,7 @@ public class BomUploadServiceImpl {
public Map bomxzjh( List<DmBchxjbp> dmBchxjbps,Map kwxxMap,Map qgKwMap , HttpServletRequest req,List<DmBchxmxp>mxs){
String dcch=dmBchxjbps.get(0).getDcCh();
String dcpl=dmBchxjbps.get(0).getDcPl();
Map rMap = new HashMap();
List<DmBchxylp> tjListOld = bchxylpService.list(new QueryWrapper<DmBchxylp>().eq("dc_ch", dcch).eq("dc_pl", dcpl));
List<DmYdjh> ydjhs = dmYdjhService.list(new QueryWrapper<DmYdjh>().eq("dc_ch", dcch )
.eq("dc_pl",dcpl)
@ -1776,7 +1806,11 @@ public class BomUploadServiceImpl {
}else{
ydjhMin = dmYdjhMapper.getYdjhMin(dcch, dcpl);
}
Boolean oneadd=false;
if(1==ydjhs.size()){
oneadd=true;
rMap.put("deyd",ydjhs.get(0).getId());
}
List<DmYdjh> adds =new ArrayList<>();
List<DmYdjh> ups =new ArrayList<>();
List<DmCbxxp> czList = dmCbxxpService.list();
@ -1863,7 +1897,7 @@ public class BomUploadServiceImpl {
&& StringUtils.isNotBlank(fst.getWpxh())
&& fst.getWpgg().equalsIgnoreCase(dmBchxjbp.getWpgg())
&& (fst.getWpxh().equalsIgnoreCase(dmBchxjbp.getWpxh())
|| (cjs1 + fst.getWpxh()).equalsIgnoreCase(dmBchxjbp.getWpxh()))
|| (cjs1 + fst.getWpxh()).equalsIgnoreCase(dmBchxjbp.getWpxh()) || ( fst.getWpxh()).equalsIgnoreCase(cjs1 +dmBchxjbp.getWpxh()) )
)
.findFirst()
@ -1901,7 +1935,7 @@ public class BomUploadServiceImpl {
dmYdjh.setBmxgry((String) req.getAttribute("yhms"));
if(StringUtils.isNotBlank(dmYdjh.getSlxhth())){ // 说明已经上料 需要修正数据
// 修正
dmYdjh.setJhlx("3");
}else{
// 没上料 规格材质
dmYdjh.setWpgg(dmBchxjbp.getWpgg());
@ -1911,6 +1945,8 @@ public class BomUploadServiceImpl {
ydjhs.remove(dmYdjh); // 从列表中移除找到的元素
}else{
// 没找到需要把这几条月度计划id 状态改成 -1
DmYdjh dmYdjhadd =new DmYdjh();
String hxlx="";
if (tzbh.substring(4, 5).equals("S")) {
@ -1993,7 +2029,7 @@ public class BomUploadServiceImpl {
Map rMap = new HashMap();
rMap.put("adds",adds);
rMap.put("ups",ups);
rMap.put("ydjhs",ydjhs);

@ -862,7 +862,7 @@ where dc_ch=#{dcch} and dc_pl =#{dcpl}
SUM(CASE WHEN ISNULL(dm_ydjh.ylbs, 'N') = 'Y' THEN 1 ELSE 0 END) AS ylbs
FROM
dm_ydjh
where 1=1 AND lx='B'
where 1=1 AND lx='B' and isnull(dm_ydjh.zt,'') != '-1'
<if test=" dcCh!=null and dcCh!=''">
and dm_ydjh.dc_ch=#{dcCh}
</if>

Loading…
Cancel
Save