2.技术准备,导入导出
3.修复班组人员设置/取消班长时,foreman未正确赋值的bug
4.增加光电报工
5.临时优化,划线,切割报工时存在无套料图号的任务,导致数据不显示的情况发生
master
董哲奇 1 month ago
parent 2d69e0eb09
commit 7123e501ec

@ -22,7 +22,7 @@ import java.util.Properties;
@SpringBootApplication @SpringBootApplication
@EnableSwagger2 @EnableSwagger2
//@EnableTransactionManagement //@EnableTransactionManagement
@MapperScan({"com.dsic.gj_erp.mapper"}) @MapperScan({"com.dsic.gj_erp.mapper","com.dsic.gj_erp.jszb.mapper"})
public class GjErpApplication { public class GjErpApplication {
public static void main(String[] args) { public static void main(String[] args) {

@ -436,11 +436,17 @@ public class DmYdjh implements Serializable {
public void setZtByZyjhzx(String type){ public void setZtByZyjhzx(String type){
ZyjhzxEnum zyjhzxEnum = ZyjhzxEnum.valueOf(type); ZyjhzxEnum zyjhzxEnum = ZyjhzxEnum.valueOf(type);
ZyjhzxEnum zt = ZyjhzxEnum.getEnumByCode(this.zt); //光电跳过划线,抛丸后直接进行切割流程
if (zyjhzxEnum==null){ if ("17".equals(kw)&&zyjhzxEnum==ZyjhzxEnum.PWFK){
throw new ServiceException(10001,"作业计划执行内容不存在"); //this.zt=ZyjhzxEnum.HXFK.code;
}else{
ZyjhzxEnum zt = ZyjhzxEnum.getEnumByCode(this.zt);
if (zyjhzxEnum==null){
throw new ServiceException(10001,"作业计划执行内容不存在");
}
this.zt=zyjhzxEnum.computeCode<=zt.computeCode?zt.code:zyjhzxEnum.code;
} }
this.zt=zyjhzxEnum.computeCode<=zt.computeCode?zt.code:zyjhzxEnum.code;
} }
@AllArgsConstructor @AllArgsConstructor

@ -4,6 +4,7 @@ package com.dsic.gj_erp.controller.jcsj;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 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.annotation.AuthFunction;
import com.dsic.gj_erp.bean.ResultBean; import com.dsic.gj_erp.bean.ResultBean;
import com.dsic.gj_erp.bean.jcsj.DmBzry; import com.dsic.gj_erp.bean.jcsj.DmBzry;
@ -21,6 +22,7 @@ import javax.servlet.http.HttpServletRequest;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Optional;
/** /**
* <p> * <p>
@ -62,16 +64,27 @@ public class DmBzryController {
public ResultBean getBzryUpdate(@RequestBody List<DmBzry> t, HttpServletRequest request){ public ResultBean getBzryUpdate(@RequestBody List<DmBzry> t, HttpServletRequest request){
String bzry= (String) request.getAttribute("yhms"); String bzry= (String) request.getAttribute("yhms");
String bzrq= DateUtil.format(DateUtil.date(), "yyyy/MM/dd"); String bzrq= DateUtil.format(DateUtil.date(), "yyyy/MM/dd");
List<DmBzry> list = service.list();
t.forEach(e->{ t.forEach(e->{
e.setXgrq(bzrq); e.setXgrq(bzrq);
e.setXgry(bzry); e.setXgry(bzry);
service.updateById(e); if ("班长".equals(e.getPosition())){
e.setForeman("1");
}else{
Optional<DmBzry> = list.stream().filter(item ->
StrUtil.isNotEmpty(item.getZyq()) && item.getZyq().equals(e.getZyq())
&& StrUtil.isNotEmpty(item.getResourcesCode()) && item.getResourcesCode().equals(e.getResourcesCode())
&& StrUtil.isNotEmpty(item.getPosition()) && item.getPosition().equals("班长")).findFirst();
.ifPresent(it-> e.setForeman(it.getUserCode()));
}
service.updateById(e);
}); });
return new ResultBean(); return new ResultBean();
} }
@PostMapping(value = "/getryBase") @PostMapping(value = "/getryBase")
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public ResultBean getryBase(@RequestBody Map mapp, HttpServletRequest request){ public ResultBean getryBase(@RequestBody Map mapp, HttpServletRequest request){

@ -3,6 +3,8 @@ package com.dsic.gj_erp.controller.kban;
import cn.hutool.core.date.DateField; import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.dsic.gj_erp.bean.ResultBean; import com.dsic.gj_erp.bean.ResultBean;
@ -25,8 +27,13 @@ public class SCKbanController {
@GetMapping("getYdjhByMonth") @GetMapping("getYdjhByMonth")
public ResultBean<?> getYdjhByMonth(){ public ResultBean<?> getYdjhByMonth(){
DateTime date=DateUtil.date(); DateTime date=DateUtil.date();
String begin=DateUtil.beginOfMonth(date).toString("yyyy/MM/dd");
String end=DateUtil.endOfMonth(date).offsetNew(DateField.DAY_OF_YEAR,1).toString("yyyy/MM/dd");
List<DmYdjh> between = service.list(Wrappers.<DmYdjh>lambdaQuery() List<DmYdjh> between = service.list(Wrappers.<DmYdjh>lambdaQuery()
.between(DmYdjh::getQgfkrq, DateUtil.beginOfMonth(date).toString("yyyy/MM/dd"), DateUtil.endOfMonth(date).offsetNew(DateField.DAY_OF_YEAR,1).toString("yyyy/MM/dd"))); .select(DmYdjh::getKw,DmYdjh::getQgfkrq,DmYdjh::getZyq1,DmYdjh::getBcshzl,DmYdjh::getQgjhrq)
return new ResultBean<>(between); .between(DmYdjh::getQgfkrq, begin, end)
.or(it->it.between(DmYdjh::getQgjhrq,begin,end))
);
return new ResultBean<>(JSONArray.toJSONString(between));
} }
} }

@ -1,11 +1,14 @@
package com.dsic.gj_erp.jszb.control; package com.dsic.gj_erp.jszb.control;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.alibaba.excel.EasyExcel; import com.alibaba.excel.EasyExcel;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.dsic.gj_erp.bean.ResultBean; import com.dsic.gj_erp.bean.ResultBean;
import com.dsic.gj_erp.bean.jhgk.YdjhImportNew; import com.dsic.gj_erp.bean.jhgk.YdjhImportNew;
import com.dsic.gj_erp.exception.CustomException;
import com.dsic.gj_erp.exception.ServiceException;
import com.dsic.gj_erp.jszb.entity.PartFlowInfo; import com.dsic.gj_erp.jszb.entity.PartFlowInfo;
import com.dsic.gj_erp.jszb.excel.ExcelFlowInfoListener; import com.dsic.gj_erp.jszb.excel.ExcelFlowInfoListener;
import com.dsic.gj_erp.jszb.service.FlowInfoService; import com.dsic.gj_erp.jszb.service.FlowInfoService;
@ -17,6 +20,7 @@ import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Objects;
@RestController @RestController
@RequestMapping("jszb") @RequestMapping("jszb")
@ -34,8 +38,9 @@ public class JszbController {
public ResultBean<?> getFlowInfoList(String ch,String begin,String end) { public ResultBean<?> getFlowInfoList(String ch,String begin,String end) {
List<PartFlowInfo> list = flowInfoService.list(Wrappers.<PartFlowInfo>lambdaQuery() List<PartFlowInfo> list = flowInfoService.list(Wrappers.<PartFlowInfo>lambdaQuery()
.eq(PartFlowInfo::getCh, ch) .eq(PartFlowInfo::getCh, ch)
.eq(StrUtil.isEmpty(end) && StrUtil.isNotEmpty(begin), PartFlowInfo::getFd, begin) .eq(StrUtil.isEmpty(end) && StrUtil.isNotEmpty(begin), PartFlowInfo::getPl, begin)
.between(StrUtil.isAllNotEmpty(begin, end), PartFlowInfo::getFd, begin, end) .between(StrUtil.isAllNotEmpty(begin, end), PartFlowInfo::getPl, begin, end)
.orderByAsc(PartFlowInfo::getPl,PartFlowInfo::getFd)
); );
return new ResultBean<>(list); return new ResultBean<>(list);
} }
@ -44,42 +49,34 @@ public class JszbController {
public ResultBean<?> importFLowInfo(@RequestParam("file") MultipartFile file) throws IOException { public ResultBean<?> importFLowInfo(@RequestParam("file") MultipartFile file) throws IOException {
ExcelFlowInfoListener objectListener = new ExcelFlowInfoListener(); ExcelFlowInfoListener objectListener = new ExcelFlowInfoListener();
EasyExcel.read(file.getInputStream(), PartFlowInfo.class, objectListener).sheet(0).headRowNumber(1).doRead(); EasyExcel.read(file.getInputStream(), PartFlowInfo.class, objectListener).sheet(0).headRowNumber(1).doRead();
List<PartFlowInfo> objList = objectListener.getObjectList(); List<PartFlowInfo> objList = objectListener.getObjectList();
List<String> errors = objectListener.getErrors();
List<PartFlowInfo> updateList=new ArrayList<>(); List<PartFlowInfo> updateList=new ArrayList<>();
objList.forEach(item->{ objList.forEach(item->{
PartFlowInfo one=null; PartFlowInfo one = flowInfoService.getOne(Wrappers.<PartFlowInfo>lambdaQuery()
if (StrUtil.isNotEmpty(item.getCh())){ .eq(StrUtil.isNotEmpty(item.getCh()),PartFlowInfo::getCh, item.getCh())
one = flowInfoService.getOne(Wrappers.<PartFlowInfo>lambdaQuery() .eq(StrUtil.isNotEmpty(item.getCh()),PartFlowInfo::getPartName,item.getPartName())
.and(it->it.eq(PartFlowInfo::getCh, item.getCh()) .eq(StrUtil.isNotEmpty(item.getProject()),PartFlowInfo::getCh,item.getProject())
.or(it0->it0.eq(PartFlowInfo::getCh, item.getProject()))) .eq(StrUtil.isNotEmpty(item.getProject()),PartFlowInfo::getPartName,item.getPartName0())
.and(it->it.eq(PartFlowInfo::getPartName, item.getPartName()) );
.or(it0->it0.eq(PartFlowInfo::getPartName, item.getPartName0()))
));
}
if (StrUtil.isNotEmpty(item.getProject())){ if (ObjUtil.isEmpty(one)){
one = flowInfoService.getOne(Wrappers.<PartFlowInfo>lambdaQuery()
.eq(PartFlowInfo::getCh, item.getCh())
.eq(PartFlowInfo::getPartName, item.getPartName())
);
}
if (one==null){
one = new PartFlowInfo(); one = new PartFlowInfo();
} }
BeanUtil.copyProperties(item,one); BeanUtil.copyProperties(item,one,"id");
if(item.getProject()!=null){ if(item.getProject()!=null){
one.setCh(item.getProject()); one.setCh(item.getProject());
one.setFd(item.getBlock());
one.setPartName(item.getPartName0()); one.setPartName(item.getPartName0());
} }
updateList.add(one); updateList.add(one);
}); });
flowInfoService.saveOrUpdateBatch(updateList); flowInfoService.saveOrUpdateBatch(updateList);
return new ResultBean<>(); return new ResultBean<>(errors);
} }
} }

@ -1,13 +1,18 @@
package com.dsic.gj_erp.jszb.entity; package com.dsic.gj_erp.jszb.entity;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.dsic.gj_erp.jszb.excel.ExcelFlowInfoListener;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import java.io.File;
import java.util.List;
@Getter @Getter
@Setter @Setter
@TableName("part_flow_info") @TableName("part_flow_info")
@ -19,7 +24,7 @@ public class PartFlowInfo {
@ExcelProperty("分段号") @ExcelProperty("分段号")
private String fd; private String fd;
@ExcelProperty("批量") @ExcelProperty("批量")
private Integer pl; private String pl;
@ExcelProperty("零件名称") @ExcelProperty("零件名称")
private String partName; private String partName;
@ExcelProperty("种类") @ExcelProperty("种类")
@ -27,7 +32,7 @@ public class PartFlowInfo {
@ExcelProperty("规格") @ExcelProperty("规格")
private String specification; private String specification;
@ExcelProperty("数量") @ExcelProperty("数量")
private Integer quantity; private String quantity;
@ExcelProperty("材质") @ExcelProperty("材质")
private String material; private String material;
@ExcelProperty("特征") @ExcelProperty("特征")
@ -60,47 +65,55 @@ public class PartFlowInfo {
@ExcelProperty("TYPE") @ExcelProperty("TYPE")
private String type0; private String type0;
@ExcelProperty("P") @ExcelProperty("P")
private Integer p; private String p;
@ExcelProperty("C") @ExcelProperty("C")
private Integer c; private String c;
@ExcelProperty("S") @ExcelProperty("S")
private Integer s; private String s;
@ExcelProperty("NP") @ExcelProperty("NP")
private Integer np; private String np;
@ExcelProperty("NC") @ExcelProperty("NC")
private Integer nc; private String nc;
@ExcelProperty("NS") @ExcelProperty("NS")
private Integer ns; private String ns;
@ExcelProperty("AREA") @ExcelProperty("AREA")
private Double area; private String area;
@ExcelProperty("WEIGHT") @ExcelProperty("WEIGHT")
private Double weight; private String weight;
@ExcelProperty("CUTLEN") @ExcelProperty("CUTLEN")
private Double cutLength; private String cutLength;
@ExcelProperty("MARKLEN") @ExcelProperty("MARKLEN")
private Double markLength; private String markLength;
@ExcelProperty("X-SIZE") @ExcelProperty("X-SIZE")
private Double xSize; @TableField("x_size")
private String xxSize;//x-size
@ExcelProperty("Y-SIZE") @ExcelProperty("Y-SIZE")
private Double ySize; @TableField("y_size")
private String yySize;//y-size
@ExcelProperty("OPTION") @ExcelProperty("OPTION")
private String option; private String option0;
@ExcelProperty("MPARTNAME") @ExcelProperty("MPARTNAME")
private String mPartName; private String m_part_name;
@ExcelProperty("SPARTNAME") @ExcelProperty("SPARTNAME")
private String sPartName; private String s_part_name;
@ExcelProperty("LOT") @ExcelProperty("LOT")
private String lot; private String lot;
@ExcelProperty("BAREA") @ExcelProperty("BAREA")
private Double bArea; @TableField("b_area")
private String bbArea;
@ExcelProperty("SANGLE") @ExcelProperty("SANGLE")
private Double sAngle; @TableField("s_angle")
private String ssAngle;
@ExcelProperty("SSIZE-X") @ExcelProperty("SSIZE-X")
private Double sSizeX; @TableField("s_size_x")
private String ssSizeX;
@ExcelProperty("SSIZE-Y") @ExcelProperty("SSIZE-Y")
private Double sSizeY; @TableField("s_size_y")
private String ssSizeY;
@ExcelProperty("GOID") @ExcelProperty("GOID")
private Double goid; private String goid;
@ExcelProperty("DATE") @ExcelProperty("DATE")
private String date; private String date;
@ExcelProperty("TIME") @ExcelProperty("TIME")
@ -122,7 +135,15 @@ public class PartFlowInfo {
@ExcelProperty("DIRECTION") @ExcelProperty("DIRECTION")
private String direction; private String direction;
@ExcelProperty("ISMODIFY") @ExcelProperty("ISMODIFY")
private Integer isModify; private String isModify;
@ExcelProperty("NESTNAME") @ExcelProperty("NESTNAME")
private String nestName; private String nestName;
public static void main(String[] args) {
ExcelFlowInfoListener objectListener = new ExcelFlowInfoListener();
EasyExcel.read(new File("E:\\文档\\润芃\\项目管理\\钢加\\生产管控\\实施相关\\2025年4月\\技术准备\\零件重量信息.xls"), PartFlowInfo.class, objectListener).sheet(0).headRowNumber(1).doRead();
List<PartFlowInfo> objList = objectListener.getObjectList();
System.out.println(objList);
}
} }

@ -1,12 +1,15 @@
package com.dsic.gj_erp.jszb.excel; package com.dsic.gj_erp.jszb.excel;
import cn.hutool.core.util.StrUtil;
import com.alibaba.excel.context.AnalysisContext; import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener; import com.alibaba.excel.event.AnalysisEventListener;
import com.dsic.gj_erp.jszb.entity.PartFlowInfo; import com.dsic.gj_erp.jszb.entity.PartFlowInfo;
import lombok.Getter; import lombok.Getter;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* Excel * Excel
@ -16,8 +19,22 @@ public class ExcelFlowInfoListener extends AnalysisEventListener<PartFlowInfo> {
@Getter @Getter
List<PartFlowInfo> objectList = new ArrayList<>(); List<PartFlowInfo> objectList = new ArrayList<>();
Map<String,PartFlowInfo> map=new HashMap<>();
@Getter
List<String> errors=new ArrayList<>();
@Override @Override
public void invoke(PartFlowInfo excelDemo, AnalysisContext analysisContext) { public void invoke(PartFlowInfo excelDemo, AnalysisContext analysisContext) {
String partName=excelDemo.getPartName0()!=null?excelDemo.getPartName0():excelDemo.getPartName();
if (map.containsKey(partName)){
String error= StrUtil.format("存在重复数据,检查修改后单独导入即可,零件编号:{},已过滤该行",partName);
this.errors.add(error);
return;
}
map.put(partName,excelDemo);
objectList.add(excelDemo); objectList.add(excelDemo);
} }

@ -0,0 +1,5 @@
<?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.jszb.mapper.PartFlowInfoMapper">
</mapper>
Loading…
Cancel
Save