| | |
| | | query.eq("parent_code",parentCode).eq("custom_code",customCode).orderByDesc("version").last(" limit 1"); |
| | | return mapper.selectOne(query); |
| | | } |
| | | //历史版本可用性设定<产品中包含PCB> |
| | | //历史版本可用性设定<产品中包含钣金件(0120)如果包含需要把当成产品的钣金件锁掉 |
| | | @Transactional |
| | | public Response setpHistoryEnable(String parentCode, String customCode, int version, int enabled, String reason, String versionTime) { |
| | | UpdateWrapper wrapper=new UpdateWrapper(); |
| | |
| | | productMapper.update(null,uWrapper); |
| | | |
| | | //4.查询产品是否存在物料时钣金件的产品 |
| | | Material material_0120=productMapper.selectMaterial_0120(parentCode,customCode); |
| | | List<Material> list=productMapper.selectMaterial_0120(parentCode,customCode); |
| | | //如果存在则锁定 |
| | | if(material_0120!=null){ |
| | | if(list!=null&&list.size()>0){ |
| | | for (Material material_0120:list) { |
| | | //先锁定历史 |
| | | UpdateWrapper wrapperHistory_0120=new UpdateWrapper(); |
| | | wrapperHistory_0120.eq("parent_code",material_0120.getSubCode()); |
| | |
| | | wrapper_0120.set("version",-1); |
| | | productMapper.update(null,wrapper_0120); |
| | | } |
| | | } |
| | | /*if(flag>0){ |
| | | // |
| | | QueryWrapper qWrapper=new QueryWrapper(); |