Browse Source

2025-06-06

材料信息中的油墨需要待入到印刷模版中的颜色中
      1、材料信息中单位是kg的
      2、将物料编码放到颜色中
master
fengyuan_yang 1 year ago
parent
commit
578aab2fe6
  1. 2
      src/main/java/com/spring/modules/part/mapper/BomManagementMapper.java
  2. 30
      src/main/java/com/spring/modules/sampleManagement/controller/TechnicalSpecificationController.java
  3. 12
      src/main/java/com/spring/modules/sampleManagement/dao/TechnicalSpecificationMapper.java
  4. 165
      src/main/java/com/spring/modules/sampleManagement/service/Impl/TechnicalSpecificationServiceImpl.java
  5. 6
      src/main/java/com/spring/modules/sampleManagement/service/TechnicalSpecificationService.java
  6. 18
      src/main/resources/mapper/part/BomManagementMapper.xml
  7. 96
      src/main/resources/mapper/sampleManagement/TechnicalSpecificationMapper.xml

2
src/main/java/com/spring/modules/part/mapper/BomManagementMapper.java

@ -137,4 +137,6 @@ public interface BomManagementMapper extends BaseMapper<BomHeaderEntity> {
List<BomHeaderVo> selectBomHeaderByPartNo(@Param("site") String site, @Param("partNo") String partNo);
List<BomManufStructCostDistribVo> selectBomManufStructCostDistribByPartNo(@Param("site") String site, @Param("partNo") String partNo);
List<BomComponentVo> queryBomComponentByKg(BomDetailEntity bomDetailEntity);
}

30
src/main/java/com/spring/modules/sampleManagement/controller/TechnicalSpecificationController.java

@ -1062,6 +1062,16 @@ public class TechnicalSpecificationController {
return R.ok();
}
/**
* 一键导入
*/
@PostMapping(value="/saveBMPrintingColorBatch")
@ResponseBody
public R saveBMPrintingColorBatch(@RequestBody PlmBmPrintingColorData data){
technicalSpecificationService.saveBMPrintingColorBatch(data);
return R.ok();
}
@PostMapping(value="/deleteBMPrintingColor")
@ResponseBody
public R deleteBMPrintingColor(@RequestBody PlmBmPrintingColorData data){
@ -1140,6 +1150,16 @@ public class TechnicalSpecificationController {
return R.ok();
}
/**
* 一键导入
*/
@PostMapping(value="/saveBMPrintFlexoColorBatch")
@ResponseBody
public R saveBMPrintFlexoColorBatch(@RequestBody PlmBmPrintFlexoColorData data){
technicalSpecificationService.saveBMPrintFlexoColorBatch(data);
return R.ok();
}
@PostMapping(value="/deleteBMprintFlexoColor")
@ResponseBody
public R deleteBMprintFlexoColor(@RequestBody PlmBmPrintFlexoColorData data){
@ -1161,6 +1181,16 @@ public class TechnicalSpecificationController {
return R.ok();
}
/**
* 一键导入
*/
@PostMapping(value="/saveBMPrintIndigoColorBatch")
@ResponseBody
public R saveBMPrintIndigoColorBatch(@RequestBody PlmBmPrintIndigoColorData data){
technicalSpecificationService.saveBMPrintIndigoColorBatch(data);
return R.ok();
}
@PostMapping(value="/deleteBMprintIndigoColor")
@ResponseBody
public R deleteBMprintIndigoColor(@RequestBody PlmBmPrintIndigoColorData data){

12
src/main/java/com/spring/modules/sampleManagement/dao/TechnicalSpecificationMapper.java

@ -1185,4 +1185,16 @@ public interface TechnicalSpecificationMapper {
void updateBMIsRemark(PlmTechnicalSpecificationSheetData data);
List<NodeVo> nodeList(PlmTechnicalSpecificationSheetData data);
void deleteBMPrintIndigoColorByCodeNo(PlmBmPrintIndigoColorData data);
void saveBMPrintIndigoColors(List<PlmBmPrintIndigoColorData> colorList);
void deleteBMPrintFlexoColorByCodeNo(PlmBmPrintFlexoColorData data);
void saveBMPrintFlexoColors(List<PlmBmPrintFlexoColorData> colorList);
void deleteBMPrintingColorByCodeNo(PlmBmPrintingColorData data);
void saveBMPrintingColors(List<PlmBmPrintingColorData> colorList);
}

165
src/main/java/com/spring/modules/sampleManagement/service/Impl/TechnicalSpecificationServiceImpl.java

@ -492,18 +492,18 @@ public class TechnicalSpecificationServiceImpl implements TechnicalSpecification
// return technicalSpecificationMapper.searchBMBom(inData);
// }
@Override
public Map<String, Object> searchBMBom(PlmBmBomData inData){
public Map<String, Object> searchBMBom(PlmBmBomData inData) {
HashMap<String, Object> map = new HashMap<>();
List<BomDetailEntity> bomDetailEntity=technicalSpecificationMapper.getBMBomDetail(inData);
if(bomDetailEntity.size()>1){
List<BomDetailEntity> bomDetailEntity = technicalSpecificationMapper.getBMBomDetail(inData);
if (bomDetailEntity.size() > 1) {
throw new RuntimeException("物料编码在物料视图view_Project_final_Part中有重复!请联系管理员");
}
if(bomDetailEntity.size()==0){
if (bomDetailEntity.isEmpty()) {
throw new RuntimeException("物料BOM状态不为Buildable!请联系管理员");
}
List<BomComponentVo> list= bomManagementMapper.queryBomComponent(bomDetailEntity.get(0));
map.put("rows",list);
map.put("row",bomDetailEntity.get(0));
List<BomComponentVo> list = bomManagementMapper.queryBomComponent(bomDetailEntity.get(0));
map.put("rows", list);
map.put("row", bomDetailEntity.get(0));
return map;
}
@Override
@ -1063,9 +1063,7 @@ public class TechnicalSpecificationServiceImpl implements TechnicalSpecification
@Override
public void deleteBMCutCut(PlmBmCutCutData data){
technicalSpecificationMapper.deleteBMCutCut(data);
}
@ -1107,18 +1105,55 @@ public class TechnicalSpecificationServiceImpl implements TechnicalSpecification
}
}
/**
* 一键导入
*/
@Override
public void deleteBMPrintingColor(PlmBmPrintingColorData data){
@Transactional
public void saveBMPrintingColorBatch(PlmBmPrintingColorData data) {
// 获取人员
SysUserEntity sysUserEntity = (SysUserEntity) SecurityUtils.getSubject().getPrincipal();
data.setUpdateBy(sysUserEntity.getUsername());
// 查询对象
PlmBmBomData inData = new PlmBmBomData();
inData.setSite(data.getSite());
inData.setCodeNo(data.getCodeNo());
// 数据集
List<PlmBmPrintingColorData> colorList = new ArrayList<>();
// 删除原数据
technicalSpecificationMapper.deleteBMPrintingColorByCodeNo(data);
List<BomDetailEntity> bomDetailEntity = technicalSpecificationMapper.getBMBomDetail(inData);
if (bomDetailEntity.size() > 1) {
throw new RuntimeException("物料编码在物料视图view_Project_final_Part中有重复!请联系管理员");
}
if (bomDetailEntity.isEmpty()) {
throw new RuntimeException("物料BOM状态不为Buildable!请联系管理员");
}
// 查出单位是kg的物料
List<BomComponentVo> list = bomManagementMapper.queryBomComponentByKg(bomDetailEntity.get(0));
for (BomComponentVo component : list) {
PlmBmPrintingColorData colorData = new PlmBmPrintingColorData();
colorData.setSite(data.getSite());
colorData.setCodeNo(data.getCodeNo());
colorData.setOrder(component.getLineSequence());
colorData.setColorReference(component.getComponentPart());
colorData.setUpdateBy(data.getUpdateBy());
colorList.add(colorData);
}
// 批量新增
technicalSpecificationMapper.saveBMPrintingColors(colorList);
}
@Override
public void deleteBMPrintingColor(PlmBmPrintingColorData data){
technicalSpecificationMapper.deleteBMPrintingColor(data);
}
@Override
@Transactional
public void upBMRevNo(UpBMRevNoData data){
SysUserEntity sysUserEntity = (SysUserEntity) SecurityUtils.getSubject().getPrincipal();
List<Object> params = new ArrayList<>();
params.add(data.getSite());
params.add(data.getOldCodeNo());
@ -1135,7 +1170,6 @@ public class TechnicalSpecificationServiceImpl implements TechnicalSpecification
String msg = String.valueOf(resultList.get(0).get("resultMsg"));
throw new RuntimeException(msg);
}
}
@Override
@ -1147,7 +1181,6 @@ public class TechnicalSpecificationServiceImpl implements TechnicalSpecification
@Override
@Transactional
public void updateBMRouteRev(PlmTechnicalSpecificationSheetData data){
List<Object> params = new ArrayList<>();
params.add(data.getSite());
params.add(data.getCodeNo());
@ -1233,25 +1266,64 @@ public class TechnicalSpecificationServiceImpl implements TechnicalSpecification
}
@Override
public void saveBMprintFlexoColor(PlmBmPrintFlexoColorData data){
public void saveBMprintFlexoColor(PlmBmPrintFlexoColorData data) {
SysUserEntity sysUserEntity = (SysUserEntity) SecurityUtils.getSubject().getPrincipal();
data.setUpdateBy(sysUserEntity.getUsername());
if(data.getId()==0){
List<PlmBmPrintFlexoColorData> checkOrder=technicalSpecificationMapper.checkBMprintFlexoColorOrder(data);
if(checkOrder.size()>0){
if (data.getId() == 0) {
List<PlmBmPrintFlexoColorData> checkOrder = technicalSpecificationMapper.checkBMprintFlexoColorOrder(data);
if (!checkOrder.isEmpty()) {
throw new RuntimeException("该面色序号已经重复!");
}
technicalSpecificationMapper.saveBMprintFlexoColor(data);
}else{
} else {
technicalSpecificationMapper.updateBMprintFlexoColor(data);
}
}
/**
* 一键导入
*/
@Override
public void deleteBMprintFlexoColor(PlmBmPrintFlexoColorData data){
@Transactional
public void saveBMPrintFlexoColorBatch(PlmBmPrintFlexoColorData data) {
// 获取人员
SysUserEntity sysUserEntity = (SysUserEntity) SecurityUtils.getSubject().getPrincipal();
data.setUpdateBy(sysUserEntity.getUsername());
// 查询对象
PlmBmBomData inData = new PlmBmBomData();
inData.setSite(data.getSite());
inData.setCodeNo(data.getCodeNo());
// 数据集
List<PlmBmPrintFlexoColorData> colorList = new ArrayList<>();
// 删除原数据
technicalSpecificationMapper.deleteBMPrintFlexoColorByCodeNo(data);
List<BomDetailEntity> bomDetailEntity = technicalSpecificationMapper.getBMBomDetail(inData);
if (bomDetailEntity.size() > 1) {
throw new RuntimeException("物料编码在物料视图view_Project_final_Part中有重复!请联系管理员");
}
if (bomDetailEntity.isEmpty()) {
throw new RuntimeException("物料BOM状态不为Buildable!请联系管理员");
}
// 查出单位是kg的物料
List<BomComponentVo> list = bomManagementMapper.queryBomComponentByKg(bomDetailEntity.get(0));
for (BomComponentVo component : list) {
PlmBmPrintFlexoColorData colorData = new PlmBmPrintFlexoColorData();
colorData.setSite(data.getSite());
colorData.setCodeNo(data.getCodeNo());
colorData.setOrder(component.getLineSequence());
colorData.setPrintSide(data.getPrintSide());
colorData.setInkCode(component.getComponentPart());
colorData.setUpdateBy(data.getUpdateBy());
colorList.add(colorData);
}
// 批量新增
technicalSpecificationMapper.saveBMPrintFlexoColors(colorList);
}
@Override
public void deleteBMprintFlexoColor(PlmBmPrintFlexoColorData data){
technicalSpecificationMapper.deleteBMprintFlexoColor(data);
}
@Override
@ -1260,20 +1332,61 @@ public class TechnicalSpecificationServiceImpl implements TechnicalSpecification
}
@Override
public void saveBMprintIndigoColor(PlmBmPrintIndigoColorData data){
public void saveBMprintIndigoColor(PlmBmPrintIndigoColorData data) {
SysUserEntity sysUserEntity = (SysUserEntity) SecurityUtils.getSubject().getPrincipal();
data.setUpdateBy(sysUserEntity.getUsername());
if(data.getId()==0){
List<PlmBmPrintIndigoColorData> checkOrder=technicalSpecificationMapper.checkBMprintIndigoColorOrder(data);
if(checkOrder.size()>0){
if (data.getId() == 0) {
List<PlmBmPrintIndigoColorData> checkOrder = technicalSpecificationMapper.checkBMprintIndigoColorOrder(data);
if (!checkOrder.isEmpty()) {
throw new RuntimeException("该面色序号已经重复!");
}
technicalSpecificationMapper.saveBMprintIndigoColor(data);
}else{
} else {
technicalSpecificationMapper.updateBMprintIndigoColor(data);
}
}
/**
* 一键导入
*/
@Override
@Transactional
public void saveBMPrintIndigoColorBatch (PlmBmPrintIndigoColorData data) {
// 获取人员
SysUserEntity sysUserEntity = (SysUserEntity) SecurityUtils.getSubject().getPrincipal();
data.setUpdateBy(sysUserEntity.getUsername());
// 查询对象
PlmBmBomData inData = new PlmBmBomData();
inData.setSite(data.getSite());
inData.setCodeNo(data.getCodeNo());
// 数据集
List<PlmBmPrintIndigoColorData> colorList = new ArrayList<>();
// 删除原数据
technicalSpecificationMapper.deleteBMPrintIndigoColorByCodeNo(data);
List<BomDetailEntity> bomDetailEntity = technicalSpecificationMapper.getBMBomDetail(inData);
if (bomDetailEntity.size() > 1) {
throw new RuntimeException("物料编码在物料视图view_Project_final_Part中有重复!请联系管理员");
}
if (bomDetailEntity.isEmpty()) {
throw new RuntimeException("物料BOM状态不为Buildable!请联系管理员");
}
// 查出单位是kg的物料
List<BomComponentVo> list = bomManagementMapper.queryBomComponentByKg(bomDetailEntity.get(0));
for (BomComponentVo component : list) {
PlmBmPrintIndigoColorData colorData = new PlmBmPrintIndigoColorData();
colorData.setSite(data.getSite());
colorData.setCodeNo(data.getCodeNo());
colorData.setOrder(component.getLineSequence());
colorData.setPrintSide(data.getPrintSide());
colorData.setInkCode(component.getComponentPart());
colorData.setUpdateBy(data.getUpdateBy());
colorList.add(colorData);
}
// 批量新增
technicalSpecificationMapper.saveBMPrintIndigoColors(colorList);
}
@Override
public void deleteBMprintIndigoColor(PlmBmPrintIndigoColorData data){
technicalSpecificationMapper.deleteBMprintIndigoColor(data);

6
src/main/java/com/spring/modules/sampleManagement/service/TechnicalSpecificationService.java

@ -990,4 +990,10 @@ public interface TechnicalSpecificationService {
void bmStatusToFinish(PlmTechnicalSpecificationSheetData data);
List<NodeVo> nodeList(PlmTechnicalSpecificationSheetData data);
void saveBMPrintIndigoColorBatch(PlmBmPrintIndigoColorData data);
void saveBMPrintFlexoColorBatch(PlmBmPrintFlexoColorData data);
void saveBMPrintingColorBatch(PlmBmPrintingColorData data);
}

18
src/main/resources/mapper/part/BomManagementMapper.xml

@ -270,6 +270,24 @@
order by a.line_sequence
</select>
<!-- 查bom子明细 -->
<select id="queryBomComponentByKg" parameterType="com.spring.modules.part.entity.BomDetailEntity" resultType="com.spring.modules.part.vo.BomComponentVo">
SELECT
a.site,
a.part_no,
a.bom_type,
a.eng_chg_level,
a.alternative_no,
a.component_part,
a.print_unit,
a.line_sequence
FROM plm_bom_component as a
where a.site = #{site} and a.part_no = #{partNo} and a.bom_type = #{bomType}
and a.eng_chg_level = #{engChgLevel} and a.alternative_no = #{alternativeNo}
and a.qty_per_assembly <![CDATA[ >= ]]> 0 and a.print_unit = 'kg'
order by a.line_sequence
</select>
<!-- 查bom子明细 -->
<select id="queryBomByProducts" parameterType="BomDetailEntity" resultType="com.spring.modules.part.vo.BomComponentVo">
SELECT

96
src/main/resources/mapper/sampleManagement/TechnicalSpecificationMapper.xml

@ -1767,7 +1767,6 @@
update_date,
update_by,
id
from plm_bm_PrintingColor
where site = #{site}
and code_no = #{codeNo}
@ -1781,6 +1780,17 @@
#{gallus}, #{markAndy}, #{lp}, #{hexiang}, #{updateBy}, GetDate())
</insert>
<insert id="saveBMPrintingColors">
insert into plm_bm_PrintingColor
(site, code_no, [order], ink_type, color_reference, color_match, bcm, speed,
dry, gallus, mark_andy, lp, Hexiang, update_by, update_date)
values
<foreach collection="list" item="item" index="index" separator=",">
(#{item.site}, #{item.codeNo}, #{item.order}, #{item.inkType}, #{item.colorReference}, #{item.colorMatch}, #{item.bcm}, #{item.speed},
#{item.dry}, #{item.gallus}, #{item.markAndy}, #{item.lp}, #{item.hexiang}, #{item.updateBy}, GetDate())
</foreach>
</insert>
<update id="updateBMPrintingColor">
update plm_bm_PrintingColor
set [order]=#{order},
@ -1800,11 +1810,15 @@
</update>
<delete id="deleteBMPrintingColor">
delete
from plm_bm_PrintingColor
delete from plm_bm_PrintingColor
where id = #{id}
</delete>
<delete id="deleteBMPrintingColorByCodeNo">
delete from plm_bm_PrintingColor
where site = #{site} and code_no = #{codeNo}
</delete>
<select id="checkPlmBmPrintingColorOrder" resultType="PlmBmPrintingColorData">
select site
from plm_bm_PrintingColor
@ -1848,12 +1862,15 @@
and routing_revision = #{routingRevision}
</select>
<select id="getBMBomDetail" resultType="com.spring.modules.part.entity.BomDetailEntity">
select a.site, a.bom_type, a.eng_chg_level, a.bom_alternative_no alternativeNo, b.final_part_no partNo
select
a.site,
a.bom_type,
a.eng_chg_level,
a.bom_alternative_no alternativeNo,
b.final_part_no partNo
from plm_technical_specification_sheet a
left join view_Project_final_Part b on a.site = b.site and a.test_part_no = b.test_part_no
left join plm_bom_detail c
on a.site = c.site and b.final_part_no = c.part_no and a.eng_chg_level = c.eng_chg_level
and a.bom_alternative_no = c.alternative_no and a.bom_type = c.bom_type
left join view_Project_final_Part b on a.site = b.site and a.test_part_no = b.test_part_no
left join plm_bom_detail c on a.site = c.site and b.final_part_no = c.part_no and a.eng_chg_level = c.eng_chg_level and a.bom_alternative_no = c.alternative_no and a.bom_type = c.bom_type
where a.site = #{site}
and a.code_no = #{codeNo}
and a.project_id = b.project_id
@ -2005,12 +2022,23 @@
</select>
<insert id="saveBMprintFlexoColor">
insert into plm_bm_printFlexoColor(site, codeNo, printSide, [order], colorReference, inkCode, colorMatch, lpi,
bcm, openFlag, gallus, markAndy, hexiang, temperature,
pressure, updateDate, updateBy, remark)
values (#{site}, #{codeNo}, #{printSide}, #{order}, #{colorReference}, #{inkCode}, #{colorMatch}, #{lpi},
#{bcm}, #{openFlag}, #{gallus},
#{markAndy}, #{hexiang}, #{temperature}, #{pressure}, GetDate(), #{updateBy}, #{remark})
insert into plm_bm_printFlexoColor
(site, codeNo, printSide, [order], colorReference, inkCode, colorMatch, lpi,
bcm, openFlag, gallus, markAndy, hexiang, temperature, pressure, updateDate, updateBy, remark)
values
(#{site}, #{codeNo}, #{printSide}, #{order}, #{colorReference}, #{inkCode}, #{colorMatch}, #{lpi},
#{bcm}, #{openFlag}, #{gallus}, #{markAndy}, #{hexiang}, #{temperature}, #{pressure}, GetDate(), #{updateBy}, #{remark})
</insert>
<insert id="saveBMPrintFlexoColors">
insert into plm_bm_printFlexoColor
(site, codeNo, printSide, [order], colorReference, inkCode, colorMatch, lpi,
bcm, openFlag, gallus, markAndy, hexiang, temperature, pressure, updateDate, updateBy, remark)
values
<foreach collection="list" item="item" index="index" separator=",">
(#{item.site}, #{item.codeNo}, #{item.printSide}, #{item.order}, #{item.colorReference}, #{item.inkCode}, #{item.colorMatch}, #{item.lpi},
#{item.bcm}, #{item.openFlag}, #{item.gallus}, #{item.markAndy}, #{item.hexiang}, #{item.temperature}, #{item.pressure}, GetDate(), #{item.updateBy}, #{item.remark})
</foreach>
</insert>
<update id="updateBMprintFlexoColor">
@ -2035,11 +2063,15 @@
</update>
<delete id="deleteBMprintFlexoColor">
delete
from plm_bm_printFlexoColor
delete from plm_bm_printFlexoColor
where id = #{id}
</delete>
<delete id="deleteBMPrintFlexoColorByCodeNo">
delete from plm_bm_printFlexoColor
where site = #{site} and code_no = #{codeNo}
</delete>
<select id="searchBMprintIndigoColor" resultType="PlmBmPrintIndigoColorData">
select id,
code_no,
@ -2075,12 +2107,27 @@
</select>
<insert id="saveBMprintIndigoColor">
insert into plm_bm_printIndigoColor(site, code_no, [order], printSide, colorReference, inkCode, colorMatch,
printMotion, opticalDensity, lut, lpi, screenAngle, printHits,
blanketTemperture, remark, updateBy, updateDate)
values (#{site}, #{codeNo}, #{order}, #{printSide}, #{colorReference}, #{inkCode}, #{colorMatch},
#{printMotion}, #{opticalDensity}, #{lut}, #{lpi},
#{screenAngle}, #{printHits}, #{blanketTemperture}, #{remark}, #{updateBy}, GetDate())
insert into plm_bm_printIndigoColor
(site, code_no, [order], printSide, colorReference, inkCode, colorMatch,
printMotion, opticalDensity, lut, lpi, screenAngle, printHits, blanketTemperture,
remark, updateBy, updateDate)
values
(#{site}, #{codeNo}, #{order}, #{printSide}, #{colorReference}, #{inkCode}, #{colorMatch},
#{printMotion}, #{opticalDensity}, #{lut}, #{lpi}, #{screenAngle}, #{printHits}, #{blanketTemperture},
#{remark}, #{updateBy}, GetDate())
</insert>
<insert id="saveBMPrintIndigoColors">
insert into plm_bm_printIndigoColor
(site, code_no, [order], printSide, colorReference, inkCode, colorMatch,
printMotion, opticalDensity, lut, lpi, screenAngle, printHits, blanketTemperture,
remark, updateBy, updateDate)
values
<foreach collection="list" item="item" index="index" separator=",">
(#{item.site}, #{item.codeNo}, #{item.order}, #{item.printSide}, #{item.colorReference}, #{item.inkCode}, #{item.colorMatch},
#{item.printMotion}, #{item.opticalDensity}, #{item.lut}, #{item.lpi}, #{item.screenAngle}, #{item.printHits}, #{item.blanketTemperture},
#{item.remark}, #{item.updateBy}, GetDate())
</foreach>
</insert>
<update id="updateBMprintIndigoColor">
@ -2109,6 +2156,11 @@
where id = #{id}
</delete>
<delete id="deleteBMPrintIndigoColorByCodeNo">
delete from plm_bm_printIndigoColor
where site = #{site} and code_no = #{codeNo}
</delete>
<select id="selectTechnicalSpecification" resultType="PlmTechnicalSpecificationSheet">
SELECT id,
site,

Loading…
Cancel
Save