diff --git a/itc-pcitc-mdm/itc-pcitc-mdm-service/src/main/java/com/xjrsoft/module/contract/service/impl/ContractFactServiceImpl.java b/itc-pcitc-mdm/itc-pcitc-mdm-service/src/main/java/com/xjrsoft/module/contract/service/impl/ContractFactServiceImpl.java index 593a7a5..d897566 100644 --- a/itc-pcitc-mdm/itc-pcitc-mdm-service/src/main/java/com/xjrsoft/module/contract/service/impl/ContractFactServiceImpl.java +++ b/itc-pcitc-mdm/itc-pcitc-mdm-service/src/main/java/com/xjrsoft/module/contract/service/impl/ContractFactServiceImpl.java @@ -42,8 +42,7 @@ public class ContractFactServiceImpl extends MPJBaseServiceImpl lngContractFactCpList = lngContractFactCpMapper.selectList( diff --git a/itc-pcitc-mdm/itc-pcitc-mdm-service/src/main/java/com/xjrsoft/module/contract/service/impl/ContractSalesServiceImpl.java b/itc-pcitc-mdm/itc-pcitc-mdm-service/src/main/java/com/xjrsoft/module/contract/service/impl/ContractSalesServiceImpl.java index cdd5a41..92f2e5c 100644 --- a/itc-pcitc-mdm/itc-pcitc-mdm-service/src/main/java/com/xjrsoft/module/contract/service/impl/ContractSalesServiceImpl.java +++ b/itc-pcitc-mdm/itc-pcitc-mdm-service/src/main/java/com/xjrsoft/module/contract/service/impl/ContractSalesServiceImpl.java @@ -62,8 +62,7 @@ public class ContractSalesServiceImpl extends MPJBaseServiceImpl lngContractSalesPngList = lngContractSalesPngMapper.selectList( diff --git a/itc-pcitc-mdm/itc-pcitc-mdm-service/src/main/java/com/xjrsoft/module/dayPlan/controller/PngApproController.java b/itc-pcitc-mdm/itc-pcitc-mdm-service/src/main/java/com/xjrsoft/module/dayPlan/controller/PngApproController.java index 15f832b..9c47529 100644 --- a/itc-pcitc-mdm/itc-pcitc-mdm-service/src/main/java/com/xjrsoft/module/dayPlan/controller/PngApproController.java +++ b/itc-pcitc-mdm/itc-pcitc-mdm-service/src/main/java/com/xjrsoft/module/dayPlan/controller/PngApproController.java @@ -63,6 +63,13 @@ public class PngApproController { return R.ok(logs); } + @GetMapping(value = "/compare") + @ApiOperation(value="根据id查询LngPngAppro信息") + @SaCheckPermission("pngAppro:compare") + public R compare(@RequestParam Long demandOrgId){ + return R.ok(pngApproService.compare(demandOrgId)); + } + @ApiOperation(value = "销售审批") @PostMapping(value = "/approveXS") @SaCheckPermission("pngAppro:approveXS") diff --git a/itc-pcitc-mdm/itc-pcitc-mdm-service/src/main/java/com/xjrsoft/module/dayPlan/mapper/LngPngApproMapper.java b/itc-pcitc-mdm/itc-pcitc-mdm-service/src/main/java/com/xjrsoft/module/dayPlan/mapper/LngPngApproMapper.java index 7bad2fe..0ddcb43 100644 --- a/itc-pcitc-mdm/itc-pcitc-mdm-service/src/main/java/com/xjrsoft/module/dayPlan/mapper/LngPngApproMapper.java +++ b/itc-pcitc-mdm/itc-pcitc-mdm-service/src/main/java/com/xjrsoft/module/dayPlan/mapper/LngPngApproMapper.java @@ -24,7 +24,7 @@ import java.util.List; @Mapper public interface LngPngApproMapper extends MPJBaseMapper, BaseMapper { - @Select("SELECT a.id, a.rule_user_id, a.demand_org_id, a.date_plan, " + + @Select("SELECT a.id, a.rule_user_id, a.demand_org_id, a.date_plan," + " (CASE a.date_plan - CURRENT_DATE " + " WHEN 0 THEN '当日' " + " WHEN 1 THEN '次日' " + @@ -70,6 +70,29 @@ public interface LngPngApproMapper extends MPJBaseMapper, BaseMappe " WHERE a.id = #{id}") LngPngApproVo getOneById(@Param("id") Long id); + @Select("SELECT a.*," + + " (CASE a.date_plan - CURRENT_DATE " + + " WHEN 0 THEN '当日' " + + " WHEN 1 THEN '次日' " + + " ELSE IF(a.date_plan - CURRENT_DATE < 0,'',a.date_plan - CURRENT_DATE || '日后') " + + " END) days_sign," + + " cu.cu_name, cu.cu_sname, sp.full_name AS poin_dely_name," + + " k.k_name, dd_iud.name AS alter_name," + + " com.name AS com_name, dd_a.name as appro_name" + + " FROM lng_png_appro a" + + " LEFT JOIN lng_customer cu ON cu.cu_code=a.cu_code" + + " LEFT JOIN lng_contract k ON k.id=a.ks_id" + + " LEFT JOIN xjr_dictionary_item di_iud on di_iud.code='LNG_ALTER'" + + " LEFT JOIN xjr_dictionary_detail dd_iud on dd_iud.item_id=di_iud.id AND dd_iud.code=a.alter_sign" + + " LEFT JOIN xjr_dictionary_item di_a on di_a.code='LNG_APPRO1'" + + " LEFT JOIN xjr_dictionary_detail dd_a on dd_a.item_id=di_a.id AND dd_a.code=a.appro_code" + + " LEFT JOIN lng_b_station_png sp ON sp.code=a.point_dely_code" + + " LEFT JOIN xjr_department com ON com.id=a.com_id" + + " WHERE a.demand_org_id = #{orgId}" + + " ORDER BY a.ver_no DESC" + + " LIMIT 2") + List getListByOrgId(@Param("orgId") Long orgId); + @Select("SELECT a.*, su.su_name, k.k_name AS kp_name, sp.full_name AS point_up_name" + " FROM lng_png_appro_pur a" + " LEFT JOIN lng_supplier su ON su.su_code=a.su_code" + diff --git a/itc-pcitc-mdm/itc-pcitc-mdm-service/src/main/java/com/xjrsoft/module/dayPlan/service/IPngApproService.java b/itc-pcitc-mdm/itc-pcitc-mdm-service/src/main/java/com/xjrsoft/module/dayPlan/service/IPngApproService.java index 80fca42..8d96abb 100644 --- a/itc-pcitc-mdm/itc-pcitc-mdm-service/src/main/java/com/xjrsoft/module/dayPlan/service/IPngApproService.java +++ b/itc-pcitc-mdm/itc-pcitc-mdm-service/src/main/java/com/xjrsoft/module/dayPlan/service/IPngApproService.java @@ -12,6 +12,7 @@ import com.xjrsoft.module.dayPlan.vo.LngPngApproPageVo; import com.xjrsoft.module.dayPlan.vo.LngPngApproVo; import javax.validation.Valid; +import java.util.List; /** * @title: service @@ -27,4 +28,6 @@ public interface IPngApproService extends MPJBaseService, MPJDeepSe LngPngApproVo getInfoById(Long id); void approve(@Valid ApproveDto dto); + + List compare(Long orgId); } diff --git a/itc-pcitc-mdm/itc-pcitc-mdm-service/src/main/java/com/xjrsoft/module/dayPlan/service/impl/PngApproServiceImpl.java b/itc-pcitc-mdm/itc-pcitc-mdm-service/src/main/java/com/xjrsoft/module/dayPlan/service/impl/PngApproServiceImpl.java index 2b4bc89..e5ee998 100644 --- a/itc-pcitc-mdm/itc-pcitc-mdm-service/src/main/java/com/xjrsoft/module/dayPlan/service/impl/PngApproServiceImpl.java +++ b/itc-pcitc-mdm/itc-pcitc-mdm-service/src/main/java/com/xjrsoft/module/dayPlan/service/impl/PngApproServiceImpl.java @@ -29,6 +29,7 @@ import com.xjrsoft.module.dayPlan.vo.LngPngApproPurVo; import com.xjrsoft.module.dayPlan.vo.LngPngApproVo; import com.xjrsoft.module.organization.dto.UserDto; import lombok.AllArgsConstructor; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -70,20 +71,33 @@ public class PngApproServiceImpl extends MPJBaseServiceImpl lngPngApproPurList = this.baseMapper.queryLngPngApproPurList(id); vo.setLngPngApproPurList(lngPngApproPurList); return vo; } + @Override + public List compare(Long orgId) { + List voList = this.baseMapper.getListByOrgId(orgId); + if(CollectionUtils.isEmpty(voList)) { + throw new BusinessException(BusinessCode.of(10500,"找不到此数据")); + } + for (LngPngApproVo vo : voList) { + List lngPngApproPurList = this.baseMapper.queryLngPngApproPurList(vo.getId()); + vo.setLngPngApproPurList(lngPngApproPurList); + } + return voList; + } + @Override @Transactional(rollbackFor = Exception.class) public void approve(ApproveDto dto) { UpdateLngPngApproDto data = dto.getData(); LngPngAppro lngPngAppro = this.baseMapper.selectById(data.getId()); if(lngPngAppro == null) { - new BusinessException(BusinessCode.of(10500,"找不到此数据")); + throw new BusinessException(BusinessCode.of(10500,"找不到此数据")); } lngPngAppro.setQtySalesGj(data.getQtySalesGj()); lngPngAppro.setQtySalesM3(data.getQtySalesM3()); @@ -91,7 +105,7 @@ public class PngApproServiceImpl extends MPJBaseServiceImpl impl public LngApproVo getInfoById(Long id) { LngAppro lngAppro = this.getById(id); if(lngAppro == null) { - new BusinessException(BusinessCode.of(10500,"找不到此数据")); - + throw new BusinessException(BusinessCode.of(10500,"找不到此数据")); } LngApproVo vo = BeanUtil.toBean(lngAppro, LngApproVo.class); List fileList = fileClient.getTableFiles("lng_appro",