parent
36722d66d3
commit
6866dc0c5e
@ -0,0 +1,145 @@
|
|||||||
|
package com.dsic.gj_erp.jszb.entity;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
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.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@TableName("part_weight_info")
|
||||||
|
public class PartWeightInfo{
|
||||||
|
|
||||||
|
@MppMultiId
|
||||||
|
@ExcelProperty("船号")
|
||||||
|
private String ch;
|
||||||
|
@MppMultiId
|
||||||
|
@ExcelProperty("分段号")
|
||||||
|
private String fd;
|
||||||
|
@ExcelProperty("批量")
|
||||||
|
private String pl;
|
||||||
|
@MppMultiId
|
||||||
|
@ExcelProperty("零件名称")
|
||||||
|
private String partName;
|
||||||
|
@ExcelProperty("种类")
|
||||||
|
private String type;
|
||||||
|
@ExcelProperty("规格")
|
||||||
|
private String specification;
|
||||||
|
@ExcelProperty("数量")
|
||||||
|
private String quantity;
|
||||||
|
@ExcelProperty("材质")
|
||||||
|
private String material;
|
||||||
|
@ExcelProperty("特征")
|
||||||
|
private String feature;
|
||||||
|
@ExcelProperty("流向")
|
||||||
|
private String flow;
|
||||||
|
@ExcelProperty("下级")
|
||||||
|
private String nextLevel;
|
||||||
|
@ExcelProperty("套料图信息")
|
||||||
|
private String nestingInfo;
|
||||||
|
@ExcelProperty("场地")
|
||||||
|
private String location;
|
||||||
|
|
||||||
|
//========重量信息========
|
||||||
|
@TableField(exist = false)
|
||||||
|
@ExcelProperty("PROJECT")
|
||||||
|
private String project;
|
||||||
|
@TableField(exist = false)
|
||||||
|
@ExcelProperty("BLOCK")
|
||||||
|
private String block;
|
||||||
|
@TableField(exist = false)
|
||||||
|
@ExcelProperty("PARTNAME")
|
||||||
|
private String partName0;
|
||||||
|
@ExcelProperty("PARTNO")
|
||||||
|
private String partNo;
|
||||||
|
@ExcelProperty("MATERIAL")
|
||||||
|
private String material0;
|
||||||
|
@ExcelProperty("THICK")
|
||||||
|
private String thickness;
|
||||||
|
@ExcelProperty("TYPE")
|
||||||
|
private String type0;
|
||||||
|
@ExcelProperty("P")
|
||||||
|
private String p;
|
||||||
|
@ExcelProperty("C")
|
||||||
|
private String c;
|
||||||
|
@ExcelProperty("S")
|
||||||
|
private String s;
|
||||||
|
@ExcelProperty("NP")
|
||||||
|
private String np;
|
||||||
|
@ExcelProperty("NC")
|
||||||
|
private String nc;
|
||||||
|
@ExcelProperty("NS")
|
||||||
|
private String ns;
|
||||||
|
@ExcelProperty("AREA")
|
||||||
|
private String area;
|
||||||
|
@ExcelProperty("WEIGHT")
|
||||||
|
private String weight;
|
||||||
|
@ExcelProperty("CUTLEN")
|
||||||
|
private String cutLength;
|
||||||
|
@ExcelProperty("MARKLEN")
|
||||||
|
private String markLength;
|
||||||
|
|
||||||
|
@ExcelProperty("X-SIZE")
|
||||||
|
@TableField("x_size")
|
||||||
|
private String xxSize;//x-size
|
||||||
|
@ExcelProperty("Y-SIZE")
|
||||||
|
@TableField("y_size")
|
||||||
|
private String yySize;//y-size
|
||||||
|
|
||||||
|
@ExcelProperty("OPTION")
|
||||||
|
private String option0;
|
||||||
|
@ExcelProperty("MPARTNAME")
|
||||||
|
private String m_part_name;
|
||||||
|
@ExcelProperty("SPARTNAME")
|
||||||
|
private String s_part_name;
|
||||||
|
@ExcelProperty("LOT")
|
||||||
|
private String lot;
|
||||||
|
@ExcelProperty("BAREA")
|
||||||
|
@TableField("b_area")
|
||||||
|
private String bbArea;
|
||||||
|
@ExcelProperty("SANGLE")
|
||||||
|
@TableField("s_angle")
|
||||||
|
private String ssAngle;
|
||||||
|
@ExcelProperty("SSIZE-X")
|
||||||
|
@TableField("s_size_x")
|
||||||
|
private String ssSizeX;
|
||||||
|
@ExcelProperty("SSIZE-Y")
|
||||||
|
@TableField("s_size_y")
|
||||||
|
private String ssSizeY;
|
||||||
|
@ExcelProperty("GOID")
|
||||||
|
private String goid;
|
||||||
|
@ExcelProperty("DATE")
|
||||||
|
private String date;
|
||||||
|
@ExcelProperty("TIME")
|
||||||
|
private String time;
|
||||||
|
@ExcelProperty("SHAPE")
|
||||||
|
private String shape;
|
||||||
|
@ExcelProperty("ASSEMBLY")
|
||||||
|
private String assembly;
|
||||||
|
@ExcelProperty("OPTION1")
|
||||||
|
private String option1;
|
||||||
|
@ExcelProperty("OPTION2")
|
||||||
|
private String option2;
|
||||||
|
@ExcelProperty("OPTION3")
|
||||||
|
private String option3;
|
||||||
|
@ExcelProperty("OPTION4")
|
||||||
|
private String option4;
|
||||||
|
@ExcelProperty("OPTION5")
|
||||||
|
private String option5;
|
||||||
|
@ExcelProperty("DIRECTION")
|
||||||
|
private String direction;
|
||||||
|
@ExcelProperty("ISMODIFY")
|
||||||
|
private String isModify;
|
||||||
|
@ExcelProperty("NESTNAME")
|
||||||
|
private String nestName;
|
||||||
|
|
||||||
|
public String getDcch(){
|
||||||
|
return this.ch!=null?this.ch:this.project;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
package com.dsic.gj_erp.jszb.mapper;
|
||||||
|
|
||||||
|
import com.dsic.gj_erp.jszb.entity.PartWeightInfo;
|
||||||
|
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface PartWeightInfoMapper extends MppBaseMapper<PartWeightInfo> {
|
||||||
|
}
|
||||||
@ -0,0 +1,33 @@
|
|||||||
|
package com.dsic.gj_erp.jszb.service;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.dsic.gj_erp.exception.CustomException;
|
||||||
|
import com.dsic.gj_erp.jszb.entity.PartFlowInfo;
|
||||||
|
import com.dsic.gj_erp.jszb.entity.PartWeightInfo;
|
||||||
|
import com.dsic.gj_erp.jszb.mapper.PartFlowInfoMapper;
|
||||||
|
import com.dsic.gj_erp.jszb.mapper.PartWeightInfoMapper;
|
||||||
|
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||||
|
import com.google.protobuf.ServiceException;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class WeightInfoService extends MppServiceImpl<PartWeightInfoMapper, PartWeightInfo> {
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void saveOrUpdateBatch(List<PartFlowInfo> objList) {
|
||||||
|
|
||||||
|
List<PartWeightInfo> collect = new ArrayList<>();
|
||||||
|
for (PartFlowInfo partFlowInfo : objList) {
|
||||||
|
PartWeightInfo partWeightInfo = new PartWeightInfo();
|
||||||
|
BeanUtil.copyProperties(partFlowInfo, partWeightInfo);
|
||||||
|
collect.add(partWeightInfo);
|
||||||
|
}
|
||||||
|
this.saveOrUpdateBatch(collect);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in new issue