| | |
| | | public Response add(@RequestBody Product product) throws IOException { |
| | | return service.add(product); |
| | | } |
| | | |
| | | @ApiOperation(value = "根据产品id查询被锁定的物料dwg和产品丝印",notes = "8.17修改后使用") |
| | | @GetMapping("getLockedByProductId") |
| | | public Response getLockedByProductId( @RequestParam int productId){ |
| | | return service.getLockedByProductId(productId); |
| | | } |
| | | } |
| | |
| | | package com.whyc.mapper; |
| | | |
| | | import com.whyc.pojo.AttachLock; |
| | | import com.whyc.pojo.Product; |
| | | |
| | | import java.util.List; |
| | |
| | | int insertPselectPH(Integer id); |
| | | //查询出所有的产品信息(分页加模糊查询<产品的编码,型号,名字,定制表编号> |
| | | List<Product> getAllProduct(String subCode, String parentCode, String parentName, String parentModel, String customCode); |
| | | //根据产品id查询被锁定的物料dwg |
| | | List<AttachLock> selectListMaterial(int productId); |
| | | //根据产品id查询被锁定的产品丝印 |
| | | List<AttachLock> selectListProduct(int productId); |
| | | } |
| | |
| | | package com.whyc.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.AllArgsConstructor; |
| | |
| | | public class AttachLock implements Serializable { |
| | | private int id; |
| | | private int materialId; |
| | | |
| | | @TableField(exist = false) |
| | | private String subName; |
| | | |
| | | private int productId; |
| | | |
| | | @TableField(exist = false) |
| | | private String parentName; |
| | | |
| | | private String attachName; |
| | | private int lockFlag; |
| | | private String localReason; |
| | |
| | | List list=mapper.selectList(null); |
| | | return new Response().setII(1,list.size()>0,list,""); |
| | | } |
| | | //根据产品id查询被锁定的物料dwg和产品丝印 |
| | | public Response getLockedByProductId(int productId) { |
| | | List listMaterial=mapper.selectListMaterial(productId); |
| | | List listProduct=mapper.selectListProduct(productId); |
| | | return new Response().setIII(1,listMaterial.size()>0||listProduct.size()>0,listMaterial,listProduct,""); |
| | | } |
| | | } |
| | |
| | | </if> |
| | | </where> |
| | | </select> |
| | | <select id="selectListMaterial" resultType="attachLock"> |
| | | select tb_attach_lock.*,tb_material.sub_name from tb_product,tb_material,tb_product_bom,tb_attach_lock |
| | | where tb_product.id=tb_product_bom.product_id |
| | | and tb_product_bom.material_id=tb_material.id |
| | | and tb_material.id=tb_attach_lock.material_id |
| | | and tb_product.id=#{productId} and locate(".dwg",tb_attach_lock.attach_name)>0 |
| | | </select> |
| | | <select id="selectListProduct" resultType="com.whyc.pojo.AttachLock"> |
| | | select tb_attach_lock.*,tb_product.parent_name from tb_product,tb_attach_lock |
| | | where tb_product.id=tb_attach_lock.product_id |
| | | and tb_product.id=#{productId} |
| | | </select> |
| | | </mapper> |