|
|
|
@ -5,6 +5,7 @@ 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.query.QueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
|
|
import com.dsic.gj_erp.annotation.AuthFunction;
|
|
|
|
|
import com.dsic.gj_erp.bean.ResultBean;
|
|
|
|
@ -53,16 +54,31 @@ public class ZyjhController {
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping("pwdr")
|
|
|
|
|
@AuthFunction
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public ResultBean<?> pwdr(MultipartFile file,HttpServletRequest request) throws IOException {
|
|
|
|
|
String yhdm= (String) request.getAttribute("yhdm");
|
|
|
|
|
String yhms= (String) request.getAttribute("yhms");
|
|
|
|
|
String date=DateUtil.date().toString("yyyy/MM/dd HH:mm:ss");
|
|
|
|
|
|
|
|
|
|
ExcelPwListener excelPwListener = new ExcelPwListener();
|
|
|
|
|
EasyExcel.read(file.getInputStream(), PwExcel.class, excelPwListener).sheet(0).headRowNumber(1).doRead();
|
|
|
|
|
List<PwExcel> objList = excelPwListener.getObjectList();
|
|
|
|
|
objList.forEach(item-> {
|
|
|
|
|
Ycldw ycldw = ycldwService.getOne(new QueryWrapper<Ycldw>().select("top 1 *").eq("name", item.getLldw()));
|
|
|
|
|
Integer dwId=null;
|
|
|
|
|
if (ycldw!=null){
|
|
|
|
|
dwId=ycldw.getId();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
DmYdjh ydjh = zyjhService.getOne(new QueryWrapper<DmYdjh>()
|
|
|
|
|
.eq("dc_ch", item.getDcCh())
|
|
|
|
|
.eq("dc_pl", item.getDcPl())
|
|
|
|
|
.eq("dc_fd", item.getDcFd())
|
|
|
|
|
.eq("tzbh", item.getTlth())
|
|
|
|
|
);
|
|
|
|
|
zyjhService.update(Wrappers.<DmYdjh>lambdaUpdate()
|
|
|
|
|
.set(DmYdjh::getPwfkrq,date).set(DmYdjh::getPwfkry,yhdm)
|
|
|
|
|
.set(DmYdjh::getLldw,dwId).set(DmYdjh::getLlcs,item.getLlcs())
|
|
|
|
|
.eq(DmYdjh::getDcCh, item.getDcCh())
|
|
|
|
|
.eq(DmYdjh::getDcPl, item.getDcPl())
|
|
|
|
|
.eq(DmYdjh::getDcFd, item.getDcFd())
|
|
|
|
@ -74,6 +90,33 @@ public class ZyjhController {
|
|
|
|
|
.eq(YcldwInfo::getFd, item.getDcFd())
|
|
|
|
|
.eq(YcldwInfo::getTlth, item.getTlth())
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
YcldwInfo ycldwInfo = new YcldwInfo();
|
|
|
|
|
ycldwInfo.setDwId(dwId);
|
|
|
|
|
try {
|
|
|
|
|
ycldwInfo.setCeng(Integer.parseInt(item.getLlcs()));
|
|
|
|
|
}catch (Exception ignored){}
|
|
|
|
|
try {
|
|
|
|
|
ycldwInfo.setYdid(ydjh.getId());
|
|
|
|
|
ycldwInfo.setKw(ydjh.getKw());
|
|
|
|
|
ycldwInfo.setZl(ydjh.getZl());
|
|
|
|
|
ycldwInfo.setWph(ydjh.getWpxh());
|
|
|
|
|
ycldwInfo.setWlh(ydjh.getSlwlh());
|
|
|
|
|
ycldwInfo.setLph(ydjh.getSllph());
|
|
|
|
|
ycldwInfo.setWpgg(ydjh.getWpgg());
|
|
|
|
|
ycldwInfo.setNbsbm(ydjh.getNbsbm());
|
|
|
|
|
ycldwInfo.setSljhrq(ydjh.getSljhrq());
|
|
|
|
|
ycldwInfo.setQgjhrq(ydjh.getQgjhrq());
|
|
|
|
|
ycldwInfo.setBfr(yhms);
|
|
|
|
|
ycldwInfo.setBfrq(date);
|
|
|
|
|
}catch (Exception ignored){}
|
|
|
|
|
ycldwInfo.setCzbh(item.getDcCh());
|
|
|
|
|
ycldwInfo.setPl(item.getDcPl());
|
|
|
|
|
ycldwInfo.setFd(item.getDcFd());
|
|
|
|
|
ycldwInfo.setTlth(item.getTlth());
|
|
|
|
|
ycldwInfo.baifang();
|
|
|
|
|
ycldwInfoService.save(ycldwInfo);
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return new ResultBean<>();
|
|
|
|
|