Merge remote-tracking branch 'origin/master'

master
xhj 4 months ago
commit 4a84f0444b

@ -10,10 +10,8 @@ import org.modelmapper.convention.MatchingStrategies;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import javax.persistence.EntityManager;

@ -6,25 +6,19 @@ import cn.hutool.extra.qrcode.QrCodeUtil;
import cn.hutool.extra.qrcode.QrConfig;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.WriterException;
import com.google.zxing.client.j2se.MatrixToImageWriter;
import com.google.zxing.common.BitMatrix;
import com.google.zxing.qrcode.QRCodeWriter;
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.pdmodel.PDPage;
import org.apache.pdfbox.pdmodel.PDPageContentStream;
import org.apache.pdfbox.pdmodel.PDPageTree;
import org.apache.pdfbox.pdmodel.graphics.image.JPEGFactory;
import org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject;
import org.apache.pdfbox.text.PDFTextStripper;
import org.apache.pdfbox.text.PDFTextStripperByArea;
import java.awt.*;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class Test {
public static void main(String[] args) throws IOException {

@ -281,6 +281,7 @@ public class DmSygdMx implements Serializable {
}
}
public static DmSygdMx ofWithDmSygdMxlj(DmSygdMxLj lj){
DmSygdMx mx = new DmSygdMx();
BeanUtil.copyProperties(lj,mx);
@ -374,7 +375,4 @@ public class DmSygdMx implements Serializable {
this.ylbhgg=bom.getYlbhgg();
}
public boolean isAvailable(){
return !StrUtil.isAllBlank(this.slrq,this.xcpw,this.pw,this.qgrq,this.qgjs,this.mbjb,this.xcmb,this.fdxq,this.gdjs);
}
}

@ -0,0 +1,177 @@
package com.dsic.gj_erp.bean.jhgk;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@TableName("ydjh_import_new")
public class YdjhImportNew {
@TableId(type = IdType.AUTO)
private String id;
@ExcelProperty("序号")
private String xh;
@ExcelProperty("产品")
private String dcCh;
@ExcelProperty("批量")
private String dcPl;
@ExcelProperty("分段")
private String dcFd;
@ExcelProperty("板数")
private String ;
@ExcelProperty("上料\n完成")
@DateTimeFormat("yyyy/MM/dd")
private String ;
@ExcelProperty("型材抛丸")
@DateTimeFormat("yyyy/MM/dd")
private String ;
@ExcelProperty("抛丸\n完成")
@DateTimeFormat("yyyy/MM/dd")
private String ;
@ExcelProperty("一垮\n龙门\n板数")
private String ;
@ExcelProperty("一垮\n数控\n板数")
private String ;
@ExcelProperty(value = "切割完成",index = 10)
@DateTimeFormat("yyyy/MM/dd")
private String 1;
@ExcelProperty("二垮\n面板\n板数")
private String ;
@ExcelProperty(value = "切割完成",index = 12)
@DateTimeFormat("yyyy/MM/dd")
private String 2;
@ExcelProperty("二垮\n数控\n板数")
private String ;
@ExcelProperty(value = "切割完成",index = 14)
@DateTimeFormat("yyyy/MM/dd")
private String 3;
@ExcelProperty("三垮\n平铁\n板数")
private String ;
@ExcelProperty(value = "切割完成",index = 16)
@DateTimeFormat("yyyy/MM/dd")
private String 4;
@ExcelProperty("曲平铁曲完成")
@DateTimeFormat("yyyy/MM/dd")
private String ;
@ExcelProperty("三垮\n数控\n板数")
private String ;
@ExcelProperty(value = "切割完成",index = 19)
@DateTimeFormat("yyyy/MM/dd")
private String 5;
@ExcelProperty("曲外板曲完成")
@DateTimeFormat("yyyy/MM/dd")
private String ;
@ExcelProperty("四区\n腹板\n板数")
private String ;
@ExcelProperty(value = "切割完成",index = 22)
@DateTimeFormat("yyyy/MM/dd")
private String 6;
@ExcelProperty("四区\n数控\n板数")
private String ;
@ExcelProperty(value = "切割完成",index = 24)
@DateTimeFormat("yyyy/MM/dd")
private String 7;
@ExcelProperty("面板挤边完成")
@DateTimeFormat("yyyy/MM/dd")
private String ;
@ExcelProperty("面板切割完成")
@DateTimeFormat("yyyy/MM/dd")
private String ;
@ExcelProperty("七垮\n型材\n米数")
private String ;
@ExcelProperty("型材切割完成")
@DateTimeFormat("yyyy/MM/dd")
private String ;
@ExcelProperty("光电 完成")
@DateTimeFormat("yyyy/MM/dd")
private String ;
@ExcelProperty("小组\n配送\n完成")
@DateTimeFormat("yyyy/MM/dd")
private String ;
@ExcelProperty("备注")
private String ;
private String fdxq;
private String ;
private boolean nonBom=true;
private String mbcz;
private String qfxqrqxz;
private String qfxqrqdz;
private String zt="0";
private String bzr;
private String bzrq;
private String shry;
private String shrq;
public void updateToBz(String bzr,String bzrq){
this.bzr=bzr;
this.bzrq=bzrq;
}
public void updateToSh(String shr,String shrq){
this.shry =shr;
this.shrq=shrq;
}
public void tj(){
this.zt=ZtEnum.TJ.ordinal()+"";
}
public void sh(){
this.zt=ZtEnum.SH.ordinal()+"";
}
public enum ZtEnum{
BZ,TJ,SH
}
}

@ -3,6 +3,7 @@ package com.dsic.gj_erp.bean.pgd;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.dsic.gj_erp.bean.jhgk.YdjhImport;
import com.dsic.gj_erp.bean.jhgk.YdjhImportNew;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -86,9 +87,17 @@ public class PgdTzjh implements Serializable {
tzjh.setPl(pl);
tzjh.setQfxqrqxz(jh.getQfxqrqxz());
tzjh.setQfxqrqdz(jh.getQfxqrqdz());
// tzjh.setFd(fd);
tzjh.setZt("01");
// tzjh.setTzzt("0");
return tzjh;
}
public static PgdTzjh of(YdjhImportNew jh, String pl){
PgdTzjh tzjh = new PgdTzjh();
tzjh.setCzbh(jh.getDcCh());
tzjh.setPl(pl);
tzjh.setQfxqrqxz(jh.getQfxqrqxz());
tzjh.setQfxqrqdz(jh.getQfxqrqdz());
tzjh.setZt("01");
return tzjh;
}
}

@ -3,7 +3,6 @@ package com.dsic.gj_erp.config;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import javax.sql.DataSource;

@ -11,8 +11,6 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.core.env.Environment;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.jdbc.datasource.init.DataSourceInitializer;

@ -12,7 +12,6 @@ import org.mybatis.spring.SqlSessionTemplate;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;

@ -12,7 +12,6 @@ import org.mybatis.spring.SqlSessionTemplate;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;

@ -1,13 +1,10 @@
package com.dsic.gj_erp.controller.jcsj;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
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.DmTltpdf;
import com.dsic.gj_erp.bean.sy.Dm_zhbmp;
import com.dsic.gj_erp.dao.sy.Dm_zhbmpRepository;
import com.dsic.gj_erp.exception.CustomException;
@ -16,17 +13,13 @@ import com.dsic.gj_erp.service.jcsj.DmBomService;
import com.dsic.gj_erp.service.jcsj.DmTltpdfService;
import com.dsic.gj_erp.service.jcsj.impl.BomUploadServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.text.PDFTextStripper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

@ -7,7 +7,10 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.dsic.gj_erp.annotation.AuthFunction;
import com.dsic.gj_erp.bean.ResultBean;
import com.dsic.gj_erp.bean.jcsj.*;
import com.dsic.gj_erp.bean.jcsj.DmBchxjbp;
import com.dsic.gj_erp.bean.jcsj.DmBchxmxp;
import com.dsic.gj_erp.bean.jcsj.DmBchxylp;
import com.dsic.gj_erp.bean.jcsj.DmBom;
import com.dsic.gj_erp.bean.jcsj.vo.BomVO;
import com.dsic.gj_erp.bean.jhgk.DmYdjh;
import com.dsic.gj_erp.bean.sy.Dm_zhbmp;
@ -31,7 +34,6 @@ import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

@ -17,9 +17,7 @@ import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* <p>

@ -1,17 +1,13 @@
package com.dsic.gj_erp.controller.jhgk;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.dsic.gj_erp.annotation.AuthFunction;
import com.dsic.gj_erp.bean.ResultBean;
import com.dsic.gj_erp.bean.jcsj.DmCzplpNew;
import com.dsic.gj_erp.bean.jhgk.DmYdjh;
import com.dsic.gj_erp.bean.kc.ImCkwpkwp;
import com.dsic.gj_erp.exception.CustomException;
import com.dsic.gj_erp.mapper.jhgk.DmYdjhMapper;
import com.dsic.gj_erp.service.jcsj.DmCzplpNewService;
@ -28,7 +24,6 @@ import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;

@ -0,0 +1,66 @@
package com.dsic.gj_erp.controller.jhgk;
import cn.hutool.core.util.StrUtil;
import com.alibaba.excel.EasyExcel;
import com.dsic.gj_erp.annotation.AuthFunction;
import com.dsic.gj_erp.bean.ResultBean;
import com.dsic.gj_erp.bean.jhgk.YdjhImportNew;
import com.dsic.gj_erp.listeners.ExcelYdjhImportNewListener;
import com.dsic.gj_erp.service.jhgk.impl.YdjhImportNewService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.List;
@RestController
@RequestMapping("ydjhImportNew")
@AllArgsConstructor
public class YdjhImportNewController {
private final YdjhImportNewService ydjhImportNewService;
@GetMapping("listByFileName")
public ResultBean<?> listByFileName(String fileName,String zt) {
return new ResultBean<>(ydjhImportNewService.listByFileName(fileName,zt));
}
@RequestMapping("/getFileNameList")
public ResultBean<?> getFileNameList(){
return new ResultBean<>(ydjhImportNewService.getFileNameList());
}
@RequestMapping("/ydjhImportNew")
@AuthFunction
public ResultBean ydjhImportNew(@RequestParam("file") MultipartFile file, HttpServletRequest req) throws IOException {
ExcelYdjhImportNewListener objectListener = new ExcelYdjhImportNewListener();
EasyExcel.read(file.getInputStream(), YdjhImportNew.class, objectListener).sheet(0).headRowNumber(1).doRead();
List<YdjhImportNew> objList = objectListener.getObjectList();
String fileName = file.getOriginalFilename();
fileName= StrUtil.removeSuffix(fileName, ".xls");
fileName=StrUtil.removeSuffix(fileName, ".xlsx");
ydjhImportNewService.handler(objList, fileName, req);
return new ResultBean(fileName);
}
@GetMapping("/tj")
public ResultBean<?> tj(String fileName) {
ydjhImportNewService.tj(fileName);
return new ResultBean<>();
}
@GetMapping("/sh")
@AuthFunction
public ResultBean<?> sh(String fileName,HttpServletRequest request) {
String yhms = (String) request.getAttribute("yhms");
ydjhImportNewService.sh(fileName,yhms);
return new ResultBean<>();
}
}

@ -1,20 +1,10 @@
package com.dsic.gj_erp.controller.kban;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.ObjUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.dsic.gj_erp.bean.ResultBean;
@ -27,13 +17,16 @@ import com.dsic.gj_erp.service.jcsj.DmBzryService;
import com.dsic.gj_erp.service.jhgk.DmSygdMxService;
import com.dsic.gj_erp.service.sy.impl.SyMsgService;
import com.dsic.gj_erp.service.zyjh.ZyjhService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.ObjUtil;
import cn.hutool.core.util.StrUtil;
import lombok.AllArgsConstructor;
import java.io.File;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
/**
*

@ -2,10 +2,8 @@ package com.dsic.gj_erp.controller.pgd;
import cn.hutool.core.date.DateUtil;
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.jhgk.DmYdjh;
import com.dsic.gj_erp.bean.jhgk.DmYdjhLj;
import com.dsic.gj_erp.bean.zyjh.DmYppyz;
import com.dsic.gj_erp.mapper.pgd.PgdQmjhMapper;

@ -21,7 +21,6 @@ import com.dsic.gj_erp.controller.zyjh.dto.PwExportExcel;
import com.dsic.gj_erp.controller.zyjh.dto.PwpgDto;
import com.dsic.gj_erp.dao.sy.Dm_zhbmpRepository;
import com.dsic.gj_erp.exception.CustomException;
import com.dsic.gj_erp.exception.ServiceException;
import com.dsic.gj_erp.mapper.jhgk.DmYdjhMapper;
import com.dsic.gj_erp.mapper.kc.ImCkwpkwpMapper;
import com.dsic.gj_erp.service.jcsj.DmCbxxpService;
@ -42,8 +41,6 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
/**

@ -4,7 +4,6 @@ import cn.hutool.core.util.StrUtil;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.dsic.gj_erp.bean.jhgk.excel.JhxfExcel;
import com.dsic.gj_erp.util.ObjConvertUtils;
import org.apache.commons.lang3.StringUtils;
import java.util.ArrayList;

@ -0,0 +1,29 @@
package com.dsic.gj_erp.listeners;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.dsic.gj_erp.bean.jhgk.YdjhImportNew;
import lombok.Getter;
import java.util.ArrayList;
import java.util.List;
/**
* Excel
*/
public class ExcelYdjhImportNewListener extends AnalysisEventListener<YdjhImportNew> {
@Getter
List<YdjhImportNew> objectList = new ArrayList<>();
@Override
public void invoke(YdjhImportNew excelDemo, AnalysisContext analysisContext) {
objectList.add(excelDemo);
}
@Override
public void doAfterAllAnalysed(AnalysisContext analysisContext) {
}
}

@ -1,13 +1,12 @@
package com.dsic.gj_erp.mapper;
import com.dsic.gj_erp.bean.jhgk.DmYdjh;
import org.apache.ibatis.annotations.Mapper;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Mapper;
import com.dsic.gj_erp.bean.jhgk.DmYdjh;
@Mapper
public interface KbanMapper {

@ -24,5 +24,5 @@ public interface DmBomMapper extends BaseMapper<DmBom> {
int insertFile(@Param("filepath")String filepath,@Param("yhdm") String yhdm);
List<DmBom> getBomUni(String dcCh,String dcPl);
List<DmBom> getBomUni(String dcCh,String dcPl,String kw);
}

@ -0,0 +1,13 @@
package com.dsic.gj_erp.mapper.jhgk;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dsic.gj_erp.bean.jhgk.YdjhImportNew;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface YdjhImportNewMapper extends BaseMapper<YdjhImportNew> {
List<String> getFileNameList();
}

@ -5,9 +5,7 @@ import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.dsic.gj_erp.bean.ResultBean;
import com.dsic.gj_erp.bean.jcsj.DmBchxylp;
import com.dsic.gj_erp.bean.jhgk.DmSygd;
import com.dsic.gj_erp.bean.jhgk.DmSygdMx;
import com.dsic.gj_erp.bean.jhgk.DmSygdMxLj;

@ -1,23 +1,20 @@
package com.dsic.gj_erp.service;
import java.io.File;
import java.math.BigDecimal;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.FileUtil;
import com.dsic.gj_erp.bean.jhgk.DmYdjh;
import com.dsic.gj_erp.bean.xiaochi.Device;
import com.dsic.gj_erp.mapper.KbanMapper;
import com.dsic.gj_erp.mapper.xiaochi.DeviceMapper;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import com.dsic.gj_erp.bean.jhgk.DmYdjh;
import com.dsic.gj_erp.mapper.KbanMapper;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import lombok.AllArgsConstructor;
import java.io.File;
import java.math.BigDecimal;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
@Service
@RequiredArgsConstructor

@ -26,5 +26,5 @@ public interface DmBomService extends IService<DmBom> {
void copyListBom(HttpServletRequest req, Map map);
List<DmBom> getBomUni(String dcCh,String dcPl);
List<DmBom> getBomUni(String dcCh,String dcPl,String kw);
}

@ -8,7 +8,6 @@ import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.dsic.gj_erp.bean.ResultBean;
import com.dsic.gj_erp.bean.jcsj.*;
import com.dsic.gj_erp.bean.jcsj.vo.BomVO;
import com.dsic.gj_erp.bean.jhgk.DmTzjh;
import com.dsic.gj_erp.bean.jhgk.DmYdjh;
import com.dsic.gj_erp.bean.pgd.PgdTzjh;
import com.dsic.gj_erp.bean.sy.Dm_zhbmp;

@ -15,7 +15,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
import java.util.Collections;
import java.util.List;
import java.util.Map;
@ -125,7 +124,7 @@ public class DmBomServiceImpl extends ServiceImpl<DmBomMapper, DmBom> implements
}
@Override
public List<DmBom> getBomUni(String dcCh, String dcPl) {
return baseMapper.getBomUni(dcCh,dcPl);
public List<DmBom> getBomUni(String dcCh, String dcPl,String kw) {
return baseMapper.getBomUni(dcCh,dcPl,kw);
}
}

@ -7,7 +7,6 @@ import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

@ -12,7 +12,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dsic.gj_erp.bean.jhgk.DmDhqdp;
import com.dsic.gj_erp.mapper.jhgk.DmDhqdpMapper;
import com.dsic.gj_erp.service.jhgk.DmDhqdpService;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.*;

@ -1,18 +1,11 @@
package com.dsic.gj_erp.service.jhgk.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dsic.gj_erp.bean.jhgk.DmSygd;
import com.dsic.gj_erp.bean.jhgk.DmSygdMx;
import com.dsic.gj_erp.bean.jhgk.DmYdjh;
import com.dsic.gj_erp.bean.jhgk.excel.SyExcel;
import com.dsic.gj_erp.mapper.jhgk.DmSygdMapper;
import com.dsic.gj_erp.service.jhgk.DmSygdMxService;
import com.dsic.gj_erp.service.jhgk.DmSygdService;
import com.dsic.gj_erp.service.jhgk.DmYdjhService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -21,7 +14,6 @@ import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* <p>

@ -16,7 +16,6 @@ import com.dsic.gj_erp.bean.jhgk.DmDhqdp;
import com.dsic.gj_erp.bean.jhgk.DmSygdMx;
import com.dsic.gj_erp.bean.jhgk.DmSygdxq;
import com.dsic.gj_erp.bean.jhgk.DmSygdxqOld;
import com.dsic.gj_erp.exception.ServiceException;
import com.dsic.gj_erp.mapper.jhgk.DmSygdxqMapper;
import com.dsic.gj_erp.service.jcsj.DmBomService;
import com.dsic.gj_erp.service.jcsj.DmCbxxpService;

@ -15,7 +15,6 @@ import com.dsic.gj_erp.bean.pgd.*;
import com.dsic.gj_erp.mapper.jhgk.DmYdjhMapper;
import com.dsic.gj_erp.service.jhgk.DmQfxqService;
import com.dsic.gj_erp.service.jhgk.DmYdjhService;
import com.dsic.gj_erp.service.jiuzhou.SljhService;
import com.dsic.gj_erp.service.pgd.*;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;

@ -0,0 +1,717 @@
package com.dsic.gj_erp.service.jhgk.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjUtil;
import cn.hutool.core.util.StrUtil;
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.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dsic.gj_erp.bean.jcsj.DmBom;
import com.dsic.gj_erp.bean.jhgk.DmSygdMx;
import com.dsic.gj_erp.bean.jhgk.DmSygdxq;
import com.dsic.gj_erp.bean.jhgk.DmYdjh;
import com.dsic.gj_erp.bean.jhgk.YdjhImportNew;
import com.dsic.gj_erp.bean.pgd.PgdTzjh;
import com.dsic.gj_erp.mapper.jhgk.DmSygdxqMapper;
import com.dsic.gj_erp.mapper.jhgk.YdjhImportNewMapper;
import com.dsic.gj_erp.service.jcsj.DmBomService;
import com.dsic.gj_erp.service.jcsj.DmCbxxpService;
import com.dsic.gj_erp.service.jhgk.DmSygdMxService;
import com.dsic.gj_erp.service.jhgk.DmYdjhService;
import com.dsic.gj_erp.service.pgd.PgdTzjhService;
import lombok.AllArgsConstructor;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.support.TransactionTemplate;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Consumer;
import java.util.stream.Collectors;
@Service
@AllArgsConstructor
public class YdjhImportNewService extends ServiceImpl<YdjhImportNewMapper, YdjhImportNew> {
private final DmSygdxqMapper sygdxqMapper;
private final DmBomService bomService;
private final DmCbxxpService dmCbxxpService;
private final PgdTzjhService tzjhService;
private final DmYdjhService dmYdjhService;
private final TransactionTemplate transactionTemplate;
private final DmSygdMxService sygdMxService;
private final RedisTemplate<String, Object> redisTemplate;
private static final String GJSCGK_SYGDMX_KEY = "GJSCGK::SYGDMX::";
private static final String GJSCGK_TZJH_KEY = "GJSCGK::TZJH::";
private static final String GJSCGK_BOM_COUNT_KEY="GJSCGK::BOM::COUNT::";
public List<String> getFileNameList() {
return baseMapper.getFileNameList();
}
public List<YdjhImportNew> listByFileName(String fileName,String zt) {
List<YdjhImportNew> list = this.list(Wrappers.<YdjhImportNew>lambdaQuery()
.eq(StrUtil.isNotEmpty(fileName), YdjhImportNew::get, fileName)
.eq(StrUtil.isNotEmpty(zt),YdjhImportNew::getZt,zt)
.orderByAsc(YdjhImportNew::getId)
);
list.stream().filter(item->StrUtil.isNotEmpty(item.getDcPl()))
.forEach(item->{
String dcPl = item.getDcPl();
try {
dcPl = String.format("%03d", Integer.parseInt(dcPl));
item.setDcPl(dcPl);
} catch (Exception ignored) {
}
AtomicInteger = new AtomicInteger(0);
//一垮龙门和一垮数控
if (item.get1() != null) {
this.getBomSize(item, "7",(size)->{
item.set(size+"");
.addAndGet(size);
});
this.getBomSize(item, "8",(size)->{
item.set(size+"");
.addAndGet(size);
});
}
if (item.get2() != null) {
this.getBomSize(item, "5",(size)->{
item.set(size+"");
.addAndGet(size);
});
}
if (item.get3() != null) {
AtomicInteger atomicInteger = new AtomicInteger(0);
this.getBomSize(item, "9",(size)->{
atomicInteger.addAndGet(size);
.addAndGet(size);
});
this.getBomSize(item, "10",(size)->{
atomicInteger.addAndGet(size);
.addAndGet(size);
});
this.getBomSize(item, "12",(size)->{
atomicInteger.addAndGet(size);
.addAndGet(size);
});
item.set(atomicInteger.toString());
}
if (item.get4() != null) {
this.getBomSize(item, "6",(size)->{
item.set(size.toString());
.addAndGet(size);
});
}
if(item.get()!=null){
this.getBomSize(item, "13", ::addAndGet);
}
if (item.get5() != null) {
this.getBomSize(item, "14",(size)->{
item.set(size+"");
.addAndGet(size);
});
}
if (item.get6() != null) {
this.getBomSize(item, "11",(size)->{
item.set(size+"");
.addAndGet(size);
});
}
if (item.get7() != null) {
AtomicInteger atomicInteger = new AtomicInteger(0);
this.getBomSize(item, "15",(size)->{
atomicInteger.addAndGet(size);
.addAndGet(size);
});
this.getBomSize(item, "16",(size)->{
atomicInteger.addAndGet(size);
.addAndGet(size);
});
item.set(atomicInteger.toString());
}
if(item.get()!=null){
this.getBomSize(item, "17", ::addAndGet);
}
item.set(.toString());
});
return list;
}
private void getBomSize(YdjhImportNew item, String kw, Consumer<Integer> handler){
Integer o = (Integer) redisTemplate.opsForHash().get(GJSCGK_BOM_COUNT_KEY + item.getDcCh(), item.getDcPl() + "_"+kw);
// if (o==null||o==0){
// List<DmBom> bomUni = bomService.getBomUni(item.getDcCh(), item.getDcPl(), kw);
// if (bomUni!=null){
// o=bomUni.size();
// redisTemplate.opsForHash().put(GJSCGK_BOM_COUNT_KEY + item.getDcCh(), item.getDcPl() + "_"+kw,o);
// }
// }
Optional.ofNullable(o).ifPresent(handler);
}
@Transactional(rollbackFor = Exception.class)
public void sh(String fileName,String shr) {
LambdaQueryWrapper<YdjhImportNew> wrapper = Wrappers.<YdjhImportNew>lambdaQuery()
.eq(YdjhImportNew::get, fileName)
.eq(YdjhImportNew::getZt, YdjhImportNew.ZtEnum.TJ.ordinal());
String shrq=DateUtil.date().toString("yyyy/MM/dd");
List<YdjhImportNew> list = this.updateData(wrapper, (item)->{
item.updateToSh(shr,shrq);
item.sh();
});
if (ObjUtil.isEmpty(list)){
return;
}
List<DmYdjh> updateList=new ArrayList<>();
list.stream().filter(item->StrUtil.isAllNotEmpty(item.getDcCh(),item.getDcPl()))
.forEach(item->{
String dcPl = item.getDcPl();
try {
dcPl = String.format("%03d", Integer.parseInt(dcPl));
} catch (Exception ignored) {
}
List<DmYdjh> ydjhList = dmYdjhService.list(Wrappers.<DmYdjh>lambdaQuery()
.eq(DmYdjh::getDcCh, item.getDcCh())
.eq(DmYdjh::getDcPl, dcPl)
);
if (ObjUtil.isNotEmpty(ydjhList)){
Map<String, List<DmYdjh>> collect = ydjhList.stream()
.filter(ydjh->StrUtil.isNotEmpty(ydjh.getKw()))
.collect(Collectors.groupingBy(DmYdjh::getKw));
//一垮龙门和一垮数控
if (item.get1() != null) {
Optional.ofNullable(collect.get("7")).ifPresent(ydjhs -> {
ydjhs.forEach(ydjh->{
DmYdjh dmYdjh = this.updateYdjh(item.get(),item.get(),item.get1());
dmYdjh.setId(ydjh.getId());
updateList.add(dmYdjh);
});
});
Optional.ofNullable(collect.get("8")).ifPresent(ydjhs -> {
ydjhs.forEach(ydjh->{
DmYdjh dmYdjh = this.updateYdjh(item.get(),item.get(),item.get1());
dmYdjh.setId(ydjh.getId());
updateList.add(dmYdjh);
});
});
}
if (item.get2() != null) {
Optional.ofNullable(collect.get("5")).ifPresent(ydjhs -> {
ydjhs.forEach(ydjh->{
DmYdjh dmYdjh = this.updateYdjh(item.get(),item.get(),item.get2());
dmYdjh.setId(ydjh.getId());
updateList.add(dmYdjh);
});
});
}
if (item.get3() != null) {
Optional.ofNullable(collect.get("9")).ifPresent(ydjhs -> {
ydjhs.forEach(ydjh->{
DmYdjh dmYdjh = this.updateYdjh(item.get(),item.get(),item.get3());
dmYdjh.setId(ydjh.getId());
updateList.add(dmYdjh);
});
});
Optional.ofNullable(collect.get("10")).ifPresent(ydjhs -> {
ydjhs.forEach(ydjh->{
DmYdjh dmYdjh = this.updateYdjh(item.get(),item.get(),item.get3());
dmYdjh.setId(ydjh.getId());
updateList.add(dmYdjh);
});
});
Optional.ofNullable(collect.get("12")).ifPresent(ydjhs -> {
ydjhs.forEach(ydjh->{
DmYdjh dmYdjh = this.updateYdjh(item.get(),item.get(),item.get3());
dmYdjh.setId(ydjh.getId());
updateList.add(dmYdjh);
});
});
}
if (item.get4() != null) {
Optional.ofNullable(collect.get("6")).ifPresent(ydjhs -> {
ydjhs.forEach(ydjh->{
DmYdjh dmYdjh = this.updateYdjh(item.get(),item.get(),item.get4());
dmYdjh.setId(ydjh.getId());
updateList.add(dmYdjh);
});
});
}
if(item.get()!=null){
Optional.ofNullable(collect.get("13")).ifPresent(ydjhs -> {
ydjhs.forEach(ydjh->{
DmYdjh dmYdjh = this.updateYdjh(item.get(),item.get(),item.get());
dmYdjh.setId(ydjh.getId());
updateList.add(dmYdjh);
});
});
}
if (item.get5() != null) {
Optional.ofNullable(collect.get("14")).ifPresent(ydjhs -> {
ydjhs.forEach(ydjh->{
DmYdjh dmYdjh = this.updateYdjh(item.get(),item.get(),item.get5());
dmYdjh.setId(ydjh.getId());
updateList.add(dmYdjh);
});
});
}
if (item.get6() != null) {
Optional.ofNullable(collect.get("11")).ifPresent(ydjhs -> {
ydjhs.forEach(ydjh->{
DmYdjh dmYdjh = this.updateYdjh(item.get(),item.get(),item.get6());
dmYdjh.setId(ydjh.getId());
updateList.add(dmYdjh);
});
});
}
if (item.get7() != null) {
Optional.ofNullable(collect.get("15")).ifPresent(ydjhs -> {
ydjhs.forEach(ydjh->{
DmYdjh dmYdjh = this.updateYdjh(item.get(),item.get(),item.get7());
dmYdjh.setId(ydjh.getId());
updateList.add(dmYdjh);
});
});
Optional.ofNullable(collect.get("16")).ifPresent(ydjhs -> {
ydjhs.forEach(ydjh->{
DmYdjh dmYdjh = this.updateYdjh(item.get(),item.get(),item.get7());
dmYdjh.setId(ydjh.getId());
updateList.add(dmYdjh);
});
});
}
if(item.get()!=null){
Optional.ofNullable(collect.get("17")).ifPresent(ydjhs -> {
ydjhs.forEach(ydjh->{
DmYdjh dmYdjh = this.updateYdjh(item.get(),item.get(),item.get());
dmYdjh.setId(ydjh.getId());
updateList.add(dmYdjh);
});
});
}
}
});
dmYdjhService.updateBatchById(updateList);
}
private DmYdjh updateYdjh(String slrq,String pwrq,String qgrq){
DmYdjh dmYdjh = new DmYdjh();
dmYdjh.setSljhrq(slrq);
dmYdjh.setPwjhrq(pwrq);
dmYdjh.setHxjhrq(qgrq);
dmYdjh.setQgjhrq(qgrq);
return dmYdjh;
}
public void tj(String fileName) {
LambdaQueryWrapper<YdjhImportNew> wrapper = Wrappers.<YdjhImportNew>lambdaQuery()
.eq(YdjhImportNew::get, fileName)
.eq(YdjhImportNew::getZt, YdjhImportNew.ZtEnum.BZ.ordinal());
List<YdjhImportNew> list = this.updateData(wrapper, YdjhImportNew::tj);
List<DmSygdMx> sygdMxList = new ArrayList<>();
List<PgdTzjh> tzjhList = new ArrayList<>();
if (ObjUtil.isEmpty(list)){
return;
}
list.stream()
.filter(item -> !item.getDcPl().contains("-"))//批次范围的数据暂不处理
.forEach(item -> {
String dcPl = item.getDcPl();
try {
dcPl = String.format("%03d", Integer.parseInt(dcPl));
} catch (Exception ignored) {
}
item.setDcPl(dcPl);
List<DmSygdMx> sygdmx = (List<DmSygdMx>) redisTemplate.opsForHash().get(GJSCGK_SYGDMX_KEY + fileName, item.getDcCh() + "_" + dcPl);
if (ObjUtil.isNotEmpty(sygdmx)) {
sygdMxList.addAll(sygdmx);
}
PgdTzjh tzjh = (PgdTzjh) redisTemplate.opsForHash().get(GJSCGK_TZJH_KEY + fileName, item.getDcCh() + "_" + dcPl);
if (ObjUtil.isNotEmpty(tzjh)){
tzjhList.add(tzjh);
}
});
if (ObjUtil.isAllEmpty(sygdMxList,tzjhList)){
return;
}
transactionTemplate.execute((status)->{
list.stream()
.filter(item -> !item.getDcPl().contains("-"))//批次范围的数据暂不处理
.filter(item -> StrUtil.isAllNotEmpty(item.getDcCh(),item.getDcPl()))
.forEach(item->{
sygdMxService.remove(new QueryWrapper<DmSygdMx>()
.eq("dc_ch", item.getDcCh())
.eq("dc_pl", item.getDcPl())
);
//清理未处理的图纸计划
tzjhService.remove(Wrappers.<PgdTzjh>lambdaQuery()
.eq(PgdTzjh::getCzbh,item.getDcCh())
.eq(PgdTzjh::getPl,item.getDcPl())
.and(it->it.isNull(PgdTzjh::getFkrq).or().eq(PgdTzjh::getFkrq,""))
);
});
sygdMxService.saveBatch(sygdMxList);
//图纸计划入库
tzjhService.saveBatch(tzjhList);
return true;
});
// redisTemplate.opsForHash().delete(GJSCGK_SYGDMX_KEY+fileName);
// redisTemplate.opsForHash().delete(GJSCGK_TZJH_KEY+fileName);
}
private List<YdjhImportNew> updateData(LambdaQueryWrapper<YdjhImportNew> wrapper, Consumer<YdjhImportNew> handler) {
List<YdjhImportNew> list = this.list(wrapper);
list.forEach(item -> {
YdjhImportNew ydjhImportNew = new YdjhImportNew();
ydjhImportNew.setId(item.getId());
ydjhImportNew.setNonBom(item.isNonBom());
handler.accept(ydjhImportNew);
this.updateById(ydjhImportNew);
});
return list;
}
public void handler(List<YdjhImportNew> list, String fileName, HttpServletRequest request) {
String yhms = (String) request.getAttribute("yhms");
//三月滚动明细
this.createSygdmx(list, fileName);
//没有基础数据的计划生成图纸计划
this.createTzjh(list, fileName, yhms);
String date = DateUtil.date().toString("yyyy/MM/dd");
transactionTemplate.execute((status) -> {
list.stream()
.filter(item -> StrUtil.isAllNotEmpty(item.getDcCh(), item.getDcPl()))
.forEach(item -> {
item.set(fileName);
item.updateToBz(yhms,date);
this.remove(new QueryWrapper<YdjhImportNew>()
.eq("dc_ch", item.getDcCh())
.eq("dc_pl", item.getDcPl())
.eq("文件名", fileName)//根据同名文件进行删除
);
});
list.forEach(this::save);
return true;
});
}
private void createTzjh(List<YdjhImportNew> list, String fileName,String yhms) {
String date = DateUtil.date().toString("yyyy/MM/dd");
list.stream()
.filter(item -> !item.getDcPl().contains("-"))//批次范围的数据暂不处理
.filter(YdjhImportNew::isNonBom)
.forEach(item -> {
String dcPl = item.getDcPl();
try {
dcPl = String.format("%03d", Integer.parseInt(dcPl));
} catch (Exception ignored) {
}
PgdTzjh dmTzjh = PgdTzjh.of(item, dcPl);
dmTzjh.setBzry(yhms);
dmTzjh.setBzrq(date);
redisTemplate.opsForHash().put(GJSCGK_TZJH_KEY + fileName, item.getDcCh() + "_" + dcPl, dmTzjh);
});
}
/**
* ,使使
*/
private void createSygdmx(List<YdjhImportNew> objList, String fileName) {
objList.stream()
.filter(item -> !item.getDcPl().contains("-"))//批次范围的数据暂不处理
.forEach(item -> {
List<DmSygdMx> addList = new ArrayList<>();
String dcPl = item.getDcPl();
try {
dcPl = String.format("%03d", Integer.parseInt(dcPl));
} catch (Exception ignored) {
}
List<DmBom> bomList = bomService.getBomUni(item.getDcCh(), dcPl,null);
if (ObjUtil.isEmpty(bomList)) {
//无bom,明细数据使用目标船只替代,切在作业计划中生成一条(按照kw进行区分)数据
return;
}
if (ObjUtil.isNotEmpty(bomList)) {
item.setNonBom(false);
}
//修正前方需求数据
List<DmSygdxq> dmSygdxqs = sygdxqMapper.selectList(Wrappers.<DmSygdxq>lambdaQuery()
.eq(DmSygdxq::getDcCh, item.getDcCh()).eq(DmSygdxq::getDcPl, dcPl));
if (ObjUtil.isNotEmpty(dmSygdxqs)) {
DmSygdxq dmSygdxq = dmSygdxqs.get(0);
item.setQfxqrqxz(dmSygdxq.getXzglxq());
item.setQfxqrqdz(dmSygdxq.getDzglxq());
}
Map<String, List<DmBom>> collect = bomList.stream().collect(Collectors.groupingBy(DmBom::getKw));
//一垮龙门和一垮数控
String finalDcPl = dcPl;
if (item.get1() != null) {
Optional.ofNullable(collect.get("7")).ifPresent(boms -> {
redisTemplate.opsForHash().put(GJSCGK_BOM_COUNT_KEY+item.getDcCh(), finalDcPl +"_7",boms.size());
boms.forEach(bom -> {
DmSygdMx dmSygdMx = new DmSygdMx();
dmSygdMx.setDcCh(item.getDcCh());
dmSygdMx.setDcPl(item.getDcPl());
dmSygdMx.setQgrq(item.get1());
dmSygdMx.setJssj(item.getQfxqrqxz());
dmSygdMx.setGjjsDz(item.getQfxqrqdz());
dmSygdMx.setBomData(bom);
addList.add(dmSygdMx);
});
});
Optional.ofNullable(collect.get("8")).ifPresent(boms -> {
redisTemplate.opsForHash().put(GJSCGK_BOM_COUNT_KEY+item.getDcCh(), finalDcPl +"_8",boms.size());
boms.forEach(bom -> {
DmSygdMx dmSygdMx = new DmSygdMx();
dmSygdMx.setDcCh(item.getDcCh());
dmSygdMx.setDcPl(item.getDcPl());
dmSygdMx.setQgrq(item.get1());
dmSygdMx.setJssj(item.getQfxqrqxz());
dmSygdMx.setGjjsDz(item.getQfxqrqdz());
dmSygdMx.setBomData(bom);
addList.add(dmSygdMx);
});
});
}
if (item.get2() != null) {
Optional.ofNullable(collect.get("5")).ifPresent(boms -> {
redisTemplate.opsForHash().put(GJSCGK_BOM_COUNT_KEY+item.getDcCh(), finalDcPl +"_5",boms.size());
boms.forEach(bom -> {
DmSygdMx dmSygdMx = new DmSygdMx();
dmSygdMx.setDcCh(item.getDcCh());
dmSygdMx.setDcPl(item.getDcPl());
dmSygdMx.setQgrq(item.get2());
dmSygdMx.setJssj(item.getQfxqrqxz());
dmSygdMx.setGjjsDz(item.getQfxqrqdz());
dmSygdMx.setBomData(bom);
addList.add(dmSygdMx);
});
});
}
if (item.get3() != null) {
Optional.ofNullable(collect.get("9")).ifPresent(boms -> {
redisTemplate.opsForHash().put(GJSCGK_BOM_COUNT_KEY+item.getDcCh(), finalDcPl +"_9",boms.size());
boms.forEach(bom -> {
DmSygdMx dmSygdMx = new DmSygdMx();
dmSygdMx.setDcCh(item.getDcCh());
dmSygdMx.setDcPl(item.getDcPl());
dmSygdMx.setQgrq(item.get3());
dmSygdMx.setJssj(item.getQfxqrqxz());
dmSygdMx.setGjjsDz(item.getQfxqrqdz());
dmSygdMx.setBomData(bom);
addList.add(dmSygdMx);
});
});
Optional.ofNullable(collect.get("10")).ifPresent(boms -> {
redisTemplate.opsForHash().put(GJSCGK_BOM_COUNT_KEY+item.getDcCh(), finalDcPl +"_10",boms.size());
boms.forEach(bom -> {
DmSygdMx dmSygdMx = new DmSygdMx();
dmSygdMx.setDcCh(item.getDcCh());
dmSygdMx.setDcPl(item.getDcPl());
dmSygdMx.setQgrq(item.get3());
dmSygdMx.setJssj(item.getQfxqrqxz());
dmSygdMx.setGjjsDz(item.getQfxqrqdz());
dmSygdMx.setBomData(bom);
addList.add(dmSygdMx);
});
});
Optional.ofNullable(collect.get("12")).ifPresent(boms -> {
redisTemplate.opsForHash().put(GJSCGK_BOM_COUNT_KEY+item.getDcCh(), finalDcPl +"_12",boms.size());
boms.forEach(bom -> {
DmSygdMx dmSygdMx = new DmSygdMx();
dmSygdMx.setDcCh(item.getDcCh());
dmSygdMx.setDcPl(item.getDcPl());
dmSygdMx.setQgrq(item.get3());
dmSygdMx.setJssj(item.getQfxqrqxz());
dmSygdMx.setGjjsDz(item.getQfxqrqdz());
dmSygdMx.setBomData(bom);
addList.add(dmSygdMx);
});
});
}
if (item.get4() != null) {
Optional.ofNullable(collect.get("6")).ifPresent(boms -> {
redisTemplate.opsForHash().put(GJSCGK_BOM_COUNT_KEY+item.getDcCh(), finalDcPl +"_6",boms.size());
boms.forEach(bom -> {
DmSygdMx dmSygdMx = new DmSygdMx();
dmSygdMx.setDcCh(item.getDcCh());
dmSygdMx.setDcPl(item.getDcPl());
dmSygdMx.setQgrq(item.get4());
dmSygdMx.setJssj(item.getQfxqrqxz());
dmSygdMx.setGjjsDz(item.getQfxqrqdz());
dmSygdMx.setBomData(bom);
addList.add(dmSygdMx);
});
});
}
if(item.get()!=null){
Optional.ofNullable(collect.get("13")).ifPresent(boms -> {
redisTemplate.opsForHash().put(GJSCGK_BOM_COUNT_KEY+item.getDcCh(), finalDcPl +"_13",boms.size());
boms.forEach(bom -> {
DmSygdMx dmSygdMx = new DmSygdMx();
dmSygdMx.setDcCh(item.getDcCh());
dmSygdMx.setDcPl(item.getDcPl());
dmSygdMx.setQgrq(item.get());
dmSygdMx.setQbs("1");
dmSygdMx.setQjgrq(item.get());
dmSygdMx.setJssj(item.getQfxqrqxz());
dmSygdMx.setGjjsDz(item.getQfxqrqdz());
dmSygdMx.setBomData(bom);
addList.add(dmSygdMx);
});
});
}
if (item.get5() != null) {
Optional.ofNullable(collect.get("14")).ifPresent(boms -> {
redisTemplate.opsForHash().put(GJSCGK_BOM_COUNT_KEY+item.getDcCh(), finalDcPl +"_14",boms.size());
boms.forEach(bom -> {
DmSygdMx dmSygdMx = new DmSygdMx();
dmSygdMx.setDcCh(item.getDcCh());
dmSygdMx.setDcPl(item.getDcPl());
dmSygdMx.setQgrq(item.get5());
dmSygdMx.setJssj(item.getQfxqrqxz());
dmSygdMx.setGjjsDz(item.getQfxqrqdz());
dmSygdMx.setBomData(bom);
addList.add(dmSygdMx);
});
});
}
if (item.get6() != null) {
Optional.ofNullable(collect.get("11")).ifPresent(boms -> {
redisTemplate.opsForHash().put(GJSCGK_BOM_COUNT_KEY+item.getDcCh(), finalDcPl +"_11",boms.size());
boms.forEach(bom -> {
DmSygdMx dmSygdMx = new DmSygdMx();
dmSygdMx.setDcCh(item.getDcCh());
dmSygdMx.setDcPl(item.getDcPl());
dmSygdMx.setQgrq(item.get6());
dmSygdMx.setJssj(item.getQfxqrqxz());
dmSygdMx.setGjjsDz(item.getQfxqrqdz());
dmSygdMx.setBomData(bom);
addList.add(dmSygdMx);
});
});
}
if (item.get7() != null) {
Optional.ofNullable(collect.get("15")).ifPresent(boms -> {
redisTemplate.opsForHash().put(GJSCGK_BOM_COUNT_KEY+item.getDcCh(), finalDcPl +"_15",boms.size());
boms.forEach(bom -> {
DmSygdMx dmSygdMx = new DmSygdMx();
dmSygdMx.setDcCh(item.getDcCh());
dmSygdMx.setDcPl(item.getDcPl());
dmSygdMx.setQgrq(item.get7());
dmSygdMx.setJssj(item.getQfxqrqxz());
dmSygdMx.setGjjsDz(item.getQfxqrqdz());
dmSygdMx.setBomData(bom);
addList.add(dmSygdMx);
});
});
Optional.ofNullable(collect.get("16")).ifPresent(boms -> {
redisTemplate.opsForHash().put(GJSCGK_BOM_COUNT_KEY+item.getDcCh(), finalDcPl +"_16",boms.size());
boms.forEach(bom -> {
DmSygdMx dmSygdMx = new DmSygdMx();
dmSygdMx.setDcCh(item.getDcCh());
dmSygdMx.setDcPl(item.getDcPl());
dmSygdMx.setQgrq(item.get7());
dmSygdMx.setJssj(item.getQfxqrqxz());
dmSygdMx.setGjjsDz(item.getQfxqrqdz());
dmSygdMx.setBomData(bom);
addList.add(dmSygdMx);
});
});
}
if(item.get()!=null){
Optional.ofNullable(collect.get("17")).ifPresent(boms -> {
redisTemplate.opsForHash().put(GJSCGK_BOM_COUNT_KEY+item.getDcCh(), finalDcPl +"_17",boms.size());
boms.forEach(bom -> {
DmSygdMx dmSygdMx = new DmSygdMx();
dmSygdMx.setDcCh(item.getDcCh());
dmSygdMx.setDcPl(item.getDcPl());
dmSygdMx.setQgrq(item.get());
dmSygdMx.setJssj(item.getQfxqrqxz());
dmSygdMx.setGjjsDz(item.getQfxqrqdz());
dmSygdMx.setBomData(bom);
addList.add(dmSygdMx);
});
});
}
redisTemplate.opsForHash().put(GJSCGK_SYGDMX_KEY + fileName, item.getDcCh() + "_" + dcPl, addList);
});
}
}

@ -8,7 +8,10 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.dsic.gj_erp.bean.jcsj.DmBom;
import com.dsic.gj_erp.bean.jcsj.DmCbxxp;
import com.dsic.gj_erp.bean.jhgk.*;
import com.dsic.gj_erp.bean.jhgk.DmSygdMx;
import com.dsic.gj_erp.bean.jhgk.DmSygdMxLj;
import com.dsic.gj_erp.bean.jhgk.DmSygdxq;
import com.dsic.gj_erp.bean.jhgk.YdjhImport;
import com.dsic.gj_erp.bean.jhgk.excel.JhxfExcel;
import com.dsic.gj_erp.bean.pgd.PgdTzjh;
import com.dsic.gj_erp.mapper.jhgk.DmSygdxqMapper;

@ -7,7 +7,6 @@ import com.dsic.gj_erp.jiuzhoumapper.SljhMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.stream.Collectors;

@ -1,6 +1,5 @@
package com.dsic.gj_erp.service.zyjh;
import cn.hutool.core.util.ObjUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dsic.gj_erp.bean.jhgk.DmYdjh;

@ -19,7 +19,6 @@ import com.dsic.gj_erp.service.jcsj.DmBzryService;
import com.dsic.gj_erp.service.jcsj.DmCbxxpService;
import com.dsic.gj_erp.service.jhgk.DmYdjhLjService;
import com.google.common.collect.ImmutableMap;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

@ -285,6 +285,9 @@
dm_bom
WHERE
dcch =#{dcCh} and pl =#{dcPl} and type='b'
<if test="kw!=null and kw!=''">
and kw=#{kw}
</if>
</select>

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dsic.gj_erp.mapper.jhgk.YdjhImportNewMapper">
<select id="getFileNameList" resultType="java.lang.String">
SELECT distinct 文件名 from ydjh_import_new WHERE isnull(文件名,'')!=''
</select>
</mapper>
Loading…
Cancel
Save