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

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

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

@ -4,6 +4,7 @@ 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.toolkit.Wrappers;
import com.dsic.gj_erp.annotation.AuthFunction;
import com.dsic.gj_erp.bean.ResultBean;
import com.dsic.gj_erp.bean.jcsj.DmBzry;
@ -21,6 +22,7 @@ import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
/**
* <p>
@ -62,16 +64,27 @@ public class DmBzryController {
public ResultBean getBzryUpdate(@RequestBody List<DmBzry> t, HttpServletRequest request){
String bzry= (String) request.getAttribute("yhms");
String bzrq= DateUtil.format(DateUtil.date(), "yyyy/MM/dd");
List<DmBzry> list = service.list();
t.forEach(e->{
e.setXgrq(bzrq);
e.setXgry(bzry);
service.updateById(e);
e.setXgrq(bzrq);
e.setXgry(bzry);
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();
}
@PostMapping(value = "/getryBase")
@Transactional(rollbackFor = Exception.class)
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.DateTime;
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.extension.conditions.query.LambdaQueryChainWrapper;
import com.dsic.gj_erp.bean.ResultBean;
@ -25,8 +27,13 @@ public class SCKbanController {
@GetMapping("getYdjhByMonth")
public ResultBean<?> getYdjhByMonth(){
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()
.between(DmYdjh::getQgfkrq, DateUtil.beginOfMonth(date).toString("yyyy/MM/dd"), DateUtil.endOfMonth(date).offsetNew(DateField.DAY_OF_YEAR,1).toString("yyyy/MM/dd")));
return new ResultBean<>(between);
.select(DmYdjh::getKw,DmYdjh::getQgfkrq,DmYdjh::getZyq1,DmYdjh::getBcshzl,DmYdjh::getQgjhrq)
.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;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.excel.EasyExcel;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.dsic.gj_erp.bean.ResultBean;
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.excel.ExcelFlowInfoListener;
import com.dsic.gj_erp.jszb.service.FlowInfoService;
@ -17,6 +20,7 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@RestController
@RequestMapping("jszb")
@ -34,8 +38,9 @@ public class JszbController {
public ResultBean<?> getFlowInfoList(String ch,String begin,String end) {
List<PartFlowInfo> list = flowInfoService.list(Wrappers.<PartFlowInfo>lambdaQuery()
.eq(PartFlowInfo::getCh, ch)
.eq(StrUtil.isEmpty(end) && StrUtil.isNotEmpty(begin), PartFlowInfo::getFd, begin)
.between(StrUtil.isAllNotEmpty(begin, end), PartFlowInfo::getFd, begin, end)
.eq(StrUtil.isEmpty(end) && StrUtil.isNotEmpty(begin), PartFlowInfo::getPl, begin)
.between(StrUtil.isAllNotEmpty(begin, end), PartFlowInfo::getPl, begin, end)
.orderByAsc(PartFlowInfo::getPl,PartFlowInfo::getFd)
);
return new ResultBean<>(list);
}
@ -44,42 +49,34 @@ public class JszbController {
public ResultBean<?> importFLowInfo(@RequestParam("file") MultipartFile file) throws IOException {
ExcelFlowInfoListener objectListener = new ExcelFlowInfoListener();
EasyExcel.read(file.getInputStream(), PartFlowInfo.class, objectListener).sheet(0).headRowNumber(1).doRead();
List<PartFlowInfo> objList = objectListener.getObjectList();
List<String> errors = objectListener.getErrors();
List<PartFlowInfo> updateList=new ArrayList<>();
objList.forEach(item->{
PartFlowInfo one=null;
if (StrUtil.isNotEmpty(item.getCh())){
one = flowInfoService.getOne(Wrappers.<PartFlowInfo>lambdaQuery()
.and(it->it.eq(PartFlowInfo::getCh, item.getCh())
.or(it0->it0.eq(PartFlowInfo::getCh, item.getProject())))
.and(it->it.eq(PartFlowInfo::getPartName, item.getPartName())
.or(it0->it0.eq(PartFlowInfo::getPartName, item.getPartName0()))
));
}
PartFlowInfo one = flowInfoService.getOne(Wrappers.<PartFlowInfo>lambdaQuery()
.eq(StrUtil.isNotEmpty(item.getCh()),PartFlowInfo::getCh, item.getCh())
.eq(StrUtil.isNotEmpty(item.getCh()),PartFlowInfo::getPartName,item.getPartName())
.eq(StrUtil.isNotEmpty(item.getProject()),PartFlowInfo::getCh,item.getProject())
.eq(StrUtil.isNotEmpty(item.getProject()),PartFlowInfo::getPartName,item.getPartName0())
);
if (StrUtil.isNotEmpty(item.getProject())){
one = flowInfoService.getOne(Wrappers.<PartFlowInfo>lambdaQuery()
.eq(PartFlowInfo::getCh, item.getCh())
.eq(PartFlowInfo::getPartName, item.getPartName())
);
}
if (one==null){
if (ObjUtil.isEmpty(one)){
one = new PartFlowInfo();
}
BeanUtil.copyProperties(item,one);
BeanUtil.copyProperties(item,one,"id");
if(item.getProject()!=null){
one.setCh(item.getProject());
one.setFd(item.getBlock());
one.setPartName(item.getPartName0());
}
updateList.add(one);
});
flowInfoService.saveOrUpdateBatch(updateList);
return new ResultBean<>();
return new ResultBean<>(errors);
}
}

@ -1,13 +1,18 @@
package com.dsic.gj_erp.jszb.entity;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.dsic.gj_erp.jszb.excel.ExcelFlowInfoListener;
import lombok.Getter;
import lombok.Setter;
import java.io.File;
import java.util.List;
@Getter
@Setter
@TableName("part_flow_info")
@ -19,7 +24,7 @@ public class PartFlowInfo {
@ExcelProperty("分段号")
private String fd;
@ExcelProperty("批量")
private Integer pl;
private String pl;
@ExcelProperty("零件名称")
private String partName;
@ExcelProperty("种类")
@ -27,7 +32,7 @@ public class PartFlowInfo {
@ExcelProperty("规格")
private String specification;
@ExcelProperty("数量")
private Integer quantity;
private String quantity;
@ExcelProperty("材质")
private String material;
@ExcelProperty("特征")
@ -60,47 +65,55 @@ public class PartFlowInfo {
@ExcelProperty("TYPE")
private String type0;
@ExcelProperty("P")
private Integer p;
private String p;
@ExcelProperty("C")
private Integer c;
private String c;
@ExcelProperty("S")
private Integer s;
private String s;
@ExcelProperty("NP")
private Integer np;
private String np;
@ExcelProperty("NC")
private Integer nc;
private String nc;
@ExcelProperty("NS")
private Integer ns;
private String ns;
@ExcelProperty("AREA")
private Double area;
private String area;
@ExcelProperty("WEIGHT")
private Double weight;
private String weight;
@ExcelProperty("CUTLEN")
private Double cutLength;
private String cutLength;
@ExcelProperty("MARKLEN")
private Double markLength;
private String markLength;
@ExcelProperty("X-SIZE")
private Double xSize;
@TableField("x_size")
private String xxSize;//x-size
@ExcelProperty("Y-SIZE")
private Double ySize;
@TableField("y_size")
private String yySize;//y-size
@ExcelProperty("OPTION")
private String option;
private String option0;
@ExcelProperty("MPARTNAME")
private String mPartName;
private String m_part_name;
@ExcelProperty("SPARTNAME")
private String sPartName;
private String s_part_name;
@ExcelProperty("LOT")
private String lot;
@ExcelProperty("BAREA")
private Double bArea;
@TableField("b_area")
private String bbArea;
@ExcelProperty("SANGLE")
private Double sAngle;
@TableField("s_angle")
private String ssAngle;
@ExcelProperty("SSIZE-X")
private Double sSizeX;
@TableField("s_size_x")
private String ssSizeX;
@ExcelProperty("SSIZE-Y")
private Double sSizeY;
@TableField("s_size_y")
private String ssSizeY;
@ExcelProperty("GOID")
private Double goid;
private String goid;
@ExcelProperty("DATE")
private String date;
@ExcelProperty("TIME")
@ -122,7 +135,15 @@ public class PartFlowInfo {
@ExcelProperty("DIRECTION")
private String direction;
@ExcelProperty("ISMODIFY")
private Integer isModify;
private String isModify;
@ExcelProperty("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;
import cn.hutool.core.util.StrUtil;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.dsic.gj_erp.jszb.entity.PartFlowInfo;
import lombok.Getter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Excel
@ -16,8 +19,22 @@ public class ExcelFlowInfoListener extends AnalysisEventListener<PartFlowInfo> {
@Getter
List<PartFlowInfo> objectList = new ArrayList<>();
Map<String,PartFlowInfo> map=new HashMap<>();
@Getter
List<String> errors=new ArrayList<>();
@Override
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);
}

@ -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