src/main/java/com/whyc/controller/AttachLockController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/whyc/controller/ProductController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/whyc/pojo/AttachLock.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/whyc/pojo/ProductBomHistory.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/whyc/service/AttachLockService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/whyc/service/ProductBomHistoryService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/resources/mapper/ProductBomHistoryMapper.xml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/main/java/com/whyc/controller/AttachLockController.java
@@ -26,4 +26,10 @@ public Response updateAttachLock(@RequestBody List<AttachLock> list){ return service.attachLock(list); } @ApiOperation(tags = "产品管理",value = "修改丝印锁定状态") @PostMapping("updateProductLock") public Response updateProductLock(@RequestBody List<AttachLock> list){ return service.updateProductLock(list); } } src/main/java/com/whyc/controller/ProductController.java
@@ -75,6 +75,8 @@ public Response getBomHistoryAndMaterial( @RequestParam int productId, @RequestParam int version){ return bomHistoryService.getBomHistoryAndMaterial(productId,version); } @ApiOperation(value = "历史产品下载(产品id和版本<下载的版本>)",notes = "8.17修改后使用") @GetMapping("downloadProductHistory") public void downloadProductHistory(HttpServletRequest req, HttpServletResponse resp, @RequestParam int productId, @RequestParam int version){ src/main/java/com/whyc/pojo/AttachLock.java
@@ -17,6 +17,7 @@ public class AttachLock implements Serializable { private int id; private int materialId; private int productId; private String attachName; private int lockFlag; private String localReason; src/main/java/com/whyc/pojo/ProductBomHistory.java
@@ -113,6 +113,10 @@ @ApiModelProperty(value = "是否是bom的管理,excel导出有用,0:原件,1:关联件") private Integer connFlag; @TableField(exist = false) @ApiModelProperty(value = "丝印锁定信息") private List<AttachLock> attachLocks; public Integer getId() { return id; } @@ -336,4 +340,12 @@ public void setConnFlag(Integer connFlag) { this.connFlag = connFlag; } public List<AttachLock> getAttachLocks() { return attachLocks; } public void setAttachLocks(List<AttachLock> attachLocks) { this.attachLocks = attachLocks; } } src/main/java/com/whyc/service/AttachLockService.java
@@ -30,6 +30,7 @@ UpdateWrapper uwrapper=new UpdateWrapper(); uwrapper.set("lock_flag",attachLock.getLockFlag()); uwrapper.set("local_reason",attachLock.getLocalReason()); uwrapper.eq("material_id",attachLock.getMaterialId()); mapper.update(null,uwrapper); }else{ mapper.insert(attachLock); @@ -37,4 +38,27 @@ }); return new Response().set(1,true,""); } @Transactional public Response updateProductLock(List<AttachLock> list) { if(list!=null&&list.size()>0){} list.stream().forEach(attachLock -> { //1.查询是否存在该记录 QueryWrapper qwrapper=new QueryWrapper(); qwrapper.eq("product_id",attachLock.getProductId()); qwrapper.eq("attach_name",attachLock.getAttachName()); qwrapper.last("limit 1"); AttachLock attach=mapper.selectOne(qwrapper); if(attach!=null){ UpdateWrapper uwrapper=new UpdateWrapper(); uwrapper.set("lock_flag",attachLock.getLockFlag()); uwrapper.set("local_reason",attachLock.getLocalReason()); uwrapper.set("product_id",attachLock.getProductId()); mapper.update(null,uwrapper); }else{ mapper.insert(attachLock); } }); return new Response().set(1,true,""); } } src/main/java/com/whyc/service/ProductBomHistoryService.java
@@ -111,7 +111,7 @@ withOutDwg+=File.separator+"standard"+File.separator+version; } String fileDirName = FileDirPath.getFileDirName(); //将没有管理BOM的dwg文件拷贝下载 //将没有管理BOM的dwg文件(丝印)拷贝下载 fileDirName=fileDirName+File.separator+withOutDwg; File start = new File(fileDirName); String[] files =new String[]{}; src/main/resources/mapper/ProductBomHistoryMapper.xml
@@ -60,6 +60,8 @@ </collection> <collection property="softwares" javaType="java.util.ArrayList" ofType="com.whyc.pojo.Software" column="{subCode=sub_code}" select="selectSoftWares"> </collection> <collection property="attachLocks" javaType="java.util.ArrayList" ofType="com.whyc.pojo.AttachLock" column="{productId=product_id}" select="selectInAttachLock"> </collection> </resultMap> <select id="getBomHistoryAndMaterial" resultMap="BomHistoryList"> select distinct tb_product_bom_history.* @@ -94,7 +96,10 @@ and tb_material_product_history.s_version<=#{version} and tb_material_product_history.e_version>=#{version} </select> <select id="selectInAttachLock" resultType="attachLock"> select DISTINCT tb_attach_lock.* FROM db_doc.tb_attach_lock where tb_attach_lock.product_id=#{productId} </select> <select id="selectSoftware" resultType="com.whyc.pojo.Software"> select DISTINCT tb_software.* FROM db_doc.tb_software