diff --git a/src/main/java/com/dsic/gj_erp/bean/zyjh/PwExcel.java b/src/main/java/com/dsic/gj_erp/bean/zyjh/PwExcel.java index c8823e7..b0e86a3 100644 --- a/src/main/java/com/dsic/gj_erp/bean/zyjh/PwExcel.java +++ b/src/main/java/com/dsic/gj_erp/bean/zyjh/PwExcel.java @@ -14,14 +14,13 @@ public class PwExcel { @ExcelProperty(value = "批量") public String dcPl; - @ExcelProperty(value = "分段") + @ExcelProperty(value = "分段",index = 5) public String dcFd; - @ExcelProperty(value = "套料图") + @ExcelProperty(value = "套料图号") public String tlth; @ExcelProperty(value = "备注") public String bz; - public int dataOrder; } diff --git a/src/main/java/com/dsic/gj_erp/bean/zyjh/YcldwInfo.java b/src/main/java/com/dsic/gj_erp/bean/zyjh/YcldwInfo.java index 6cfca3f..b4351a7 100644 --- a/src/main/java/com/dsic/gj_erp/bean/zyjh/YcldwInfo.java +++ b/src/main/java/com/dsic/gj_erp/bean/zyjh/YcldwInfo.java @@ -30,7 +30,9 @@ public class YcldwInfo { private String tlth; private String wph; + private String wlh; private String wpgg; + private String nm;//内码 private String sljhrq; private String qgjhrq; private String bfr;//摆放人 diff --git a/src/main/java/com/dsic/gj_erp/controller/zyjh/ZyjhController.java b/src/main/java/com/dsic/gj_erp/controller/zyjh/ZyjhController.java index 1966b1c..1650484 100644 --- a/src/main/java/com/dsic/gj_erp/controller/zyjh/ZyjhController.java +++ b/src/main/java/com/dsic/gj_erp/controller/zyjh/ZyjhController.java @@ -5,6 +5,9 @@ import cn.hutool.core.util.ObjUtil; import cn.hutool.core.util.StrUtil; import com.alibaba.excel.EasyExcel; import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.dsic.gj_erp.annotation.AuthFunction; import com.dsic.gj_erp.bean.ResultBean; @@ -53,10 +56,29 @@ public class ZyjhController { * 抛丸导入 */ @PostMapping("pwdr") - public ResultBean pwdr(MultipartFile file) throws IOException { + @AuthFunction + public ResultBean pwdr(MultipartFile file,HttpServletRequest request) throws IOException { + String yhdm= (String) request.getAttribute("yhdm"); + String date=DateUtil.date().toString("yyyy/MM/dd HH:mm:ss"); + ExcelPwListener excelPwListener = new ExcelPwListener(); - EasyExcel.read(file.getInputStream(), GdxqExcel.class, excelPwListener).sheet(0).headRowNumber(1).doRead(); + EasyExcel.read(file.getInputStream(), PwExcel.class, excelPwListener).sheet(0).headRowNumber(1).doRead(); List objList = excelPwListener.getObjectList(); + objList.forEach(item-> { + zyjhService.update(Wrappers.lambdaUpdate() + .set(DmYdjh::getPwfkrq,date).set(DmYdjh::getPwfkry,yhdm) + .eq(DmYdjh::getDcCh, item.getDcCh()) + .eq(DmYdjh::getDcPl, item.getDcPl()) + .eq(DmYdjh::getDcFd, item.getDcFd()) + .eq(DmYdjh::getTzbh, item.getTlth())); + + ycldwInfoService.remove(Wrappers.lambdaQuery() + .eq(YcldwInfo::getCzbh, item.getDcCh()) + .eq(YcldwInfo::getPl, item.getDcPl()) + .eq(YcldwInfo::getFd, item.getDcFd()) + .eq(YcldwInfo::getTlth, item.getTlth()) + ); + }); return new ResultBean<>(); } diff --git a/src/main/java/com/dsic/gj_erp/controller/zyjh/dto/ShangLiao.java b/src/main/java/com/dsic/gj_erp/controller/zyjh/dto/ShangLiao.java index f26b074..1c2b1df 100644 --- a/src/main/java/com/dsic/gj_erp/controller/zyjh/dto/ShangLiao.java +++ b/src/main/java/com/dsic/gj_erp/controller/zyjh/dto/ShangLiao.java @@ -26,7 +26,9 @@ public class ShangLiao { private String zl; private String tlth; private String wph; + private String wlh; private String wpgg; + private String nm;//内码 private String sljhrq; private String qgjhrq; private String bfr;//摆放人