master
xhj 1 year ago
parent 18ae8b1596
commit 78aa65e8be

@ -1,13 +1,17 @@
package com.dsic.gj_erp.controller.jcsj;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dsic.gj_erp.annotation.AuthFunction;
import com.dsic.gj_erp.bean.ResultBean;
import com.dsic.gj_erp.bean.jcsj.DmBom;
import com.dsic.gj_erp.bean.jcsj.excel.PlExcel;
import com.dsic.gj_erp.bean.jcsj.vo.BomVO;
import com.dsic.gj_erp.exception.CustomException;
import com.dsic.gj_erp.service.jcsj.DmBomService;
import com.dsic.gj_erp.service.jcsj.impl.BomUploadServiceImpl;
import com.dsic.gj_erp.service.sy.SYService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -17,6 +21,7 @@ import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* <p>
@ -54,6 +59,19 @@ public class DmBomController {
List<DmBom> listBom = dmBomService.getListBomRealy(req,map);
return new ResultBean(listBom);
}
@PostMapping("/getListBomRealy1")
public ResultBean getListBomRealy1(HttpServletRequest req, @RequestBody Map map) throws CustomException {
List<DmBom> list1 = dmBomService.list(new QueryWrapper<DmBom>().eq("dcch", map.get("mbch")));
List<String> idds = list1.stream().filter(f -> StringUtils.isNotBlank(f.getYidd())).map(DmBom::getYidd).collect(Collectors.toList());
List<DmBom> list = dmBomService.list(new QueryWrapper<DmBom>().eq("dcch", map.get("dcch"))
.eq(StrUtil.isNotEmpty((String) map.get("fd")), "fd", map.get("dcfd"))
.eq(StrUtil.isNotEmpty((String) map.get("dcpl")), "pl", map.get("dcpl"))
.eq(StrUtil.isNotEmpty((String) map.get("zt")), "zt", map.get("zt"))
.notIn("idd",idds)
.orderBy(true,true,"pl","fd","type","tzbh","ljbh")
);
return new ResultBean(list);
}
@PostMapping("/addListBom")
@AuthFunction

@ -1456,6 +1456,8 @@ public class BomUploadServiceImpl {
//dmBom.setLjsl(e.getLjslZ());
dmBom.setDcch(e.getDcCh());
dmBom.setPl(e.getDcPl());
dmBom.setBzrq(DateUtil.format(DateUtil.date(), "yyyy/MM/dd"));
dmBom.setBzry((String) request.getAttribute("yhms"));
//dmBom.setFd(e.getWph().substring(0,4));
dmBom.setSjch(e.getDcCh());
dmBom.setWpcz(e.getWpxh());
@ -1535,6 +1537,8 @@ public class BomUploadServiceImpl {
dmBom.setSjch(e.getDcChZ());
dmBom.setWpcz(e.getWpxhZ());
dmBom.setWpgg(e.getWpggZ());
dmBom.setBzrq(DateUtil.format(DateUtil.date(), "yyyy/MM/dd"));
dmBom.setBzry((String) request.getAttribute("yhms"));
System.out.println("e.getWpggZ().split(\"\\\\*\")[0] = " + e.getWpggZ().split("\\*")[0]);
System.out.println("e.getWpggZ().split(\"\\\\*\")[0] = " + e.getWpggZ());
dmBom.setBh(new BigDecimal(e.getWpggZ().split("\\*")[0]));

@ -2,7 +2,10 @@ package com.dsic.gj_erp.service.jcsj.impl;
import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dsic.gj_erp.bean.jcsj.DmBom;
import com.dsic.gj_erp.bean.jcsj.vo.BomVO;
@ -63,8 +66,8 @@ public class DmBomServiceImpl extends ServiceImpl<DmBomMapper, DmBom> implements
List<DmBom> list = this.list(new QueryWrapper<DmBom>().eq("dcch", map.get("dcch"))
.eq(StrUtil.isNotEmpty((String) map.get("fd")), "fd", map.get("dcfd"))
.eq(StrUtil.isNotEmpty((String) map.get("dcpl")), "pl", map.get("dcpl"))
.eq(StrUtil.isNotEmpty((String) map.get("zt")), "zt", map.get("zt"))
.orderBy(true,true,"pl","fd","type")
.eq(StrUtil.isNotEmpty((String) map.get("type")), "type", map.get("type"))
.orderBy(true,true,"pl","fd","type","tzbh","ljbh")
);
return list;
// }
@ -101,13 +104,18 @@ public class DmBomServiceImpl extends ServiceImpl<DmBomMapper, DmBom> implements
public void copyListBom(HttpServletRequest req, Map map) {
String dcch=(String) map.get("dcch");
String mbch=(String) map.get("mbch");
List<DmBom> list= this.list(new QueryWrapper<DmBom>().eq("dcch",dcch));
List<DmBom> list=(List<DmBom>)map.get("list");
String str= JSON.toJSONString(list);
list= JSONObject.parseArray(str, DmBom.class);
// List<DmBom> list= this.list(new QueryWrapper<DmBom>().eq("dcch",dcch));
list.forEach(e->{
e.setMbch(e.getDcch());
e.setDcch(mbch);
e.setSjch("");
e.setId(null);
e.setYidd(e.getIdd());
e.setIdd(IdWorker.get32UUID());
});
this.saveBatch(list,1000);
//this.saveBatch()

Loading…
Cancel
Save