|
@@ -7,7 +7,8 @@ import com.ozs.common.utils.DateUtils;
|
|
import com.ozs.common.utils.StringUtils;
|
|
import com.ozs.common.utils.StringUtils;
|
|
import com.ozs.common.utils.bean.BeanUtils;
|
|
import com.ozs.common.utils.bean.BeanUtils;
|
|
import com.ozs.pm.doman.*;
|
|
import com.ozs.pm.doman.*;
|
|
-import com.ozs.pm.doman.vo.requestVo.PmRequestVo;
|
|
|
|
|
|
+import com.ozs.pm.doman.vo.requestVo.PmBookBuildingReqVo;
|
|
|
|
+import com.ozs.pm.doman.vo.requestVo.PmReqVo;
|
|
import com.ozs.pm.doman.vo.responseVo.*;
|
|
import com.ozs.pm.doman.vo.responseVo.*;
|
|
import com.ozs.pm.mapper.PmDemandMapper;
|
|
import com.ozs.pm.mapper.PmDemandMapper;
|
|
import com.ozs.pm.service.*;
|
|
import com.ozs.pm.service.*;
|
|
@@ -59,11 +60,10 @@ public class PmDemandServiceImpl implements IPmDemandService
|
|
* @return 采购需求
|
|
* @return 采购需求
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public PmDemandResponseVo selectPmDemandByDemandId(Long demandId)
|
|
|
|
- {
|
|
|
|
|
|
+ public PmDemandResVo selectPmDemandByDemandId(Long demandId) {
|
|
PmDemand pmDemand = pmDemandMapper.selectPmDemandByDemandId(demandId);
|
|
PmDemand pmDemand = pmDemandMapper.selectPmDemandByDemandId(demandId);
|
|
if(pmDemand != null){
|
|
if(pmDemand != null){
|
|
- PmDemandResponseVo vo = new PmDemandResponseVo();
|
|
|
|
|
|
+ PmDemandResVo vo = new PmDemandResVo();
|
|
BeanUtils.copyProperties(pmDemand, vo);
|
|
BeanUtils.copyProperties(pmDemand, vo);
|
|
|
|
|
|
SysDeptResponseVo sysDeptResponseVo = (SysDeptResponseVo) deptService.selectDeptById(vo.getPurchaseDeptId()).get("sysDept");
|
|
SysDeptResponseVo sysDeptResponseVo = (SysDeptResponseVo) deptService.selectDeptById(vo.getPurchaseDeptId()).get("sysDept");
|
|
@@ -76,9 +76,14 @@ public class PmDemandServiceImpl implements IPmDemandService
|
|
vo.setPurchaseServicesName(purchaseServicesName);
|
|
vo.setPurchaseServicesName(purchaseServicesName);
|
|
}
|
|
}
|
|
|
|
|
|
- HashMap<String, String> fileMap = getFileMap(vo.getDemandId(),"4");
|
|
|
|
- if(fileMap != null){
|
|
|
|
- vo.setFileMap(fileMap);
|
|
|
|
|
|
+ HashMap<String, String> demandFileMap = getFileMap(vo.getDemandId(),SysFileRefEnum.PM_DEMAND.getType());
|
|
|
|
+ if(demandFileMap != null){
|
|
|
|
+ vo.setDemandFileMap(demandFileMap);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ HashMap<String, String> auditFileMap = getFileMap(vo.getDemandId(),SysFileRefEnum.PM_DEMAND_EXAMINE.getType());
|
|
|
|
+ if(auditFileMap != null){
|
|
|
|
+ vo.setAuditFileMap(auditFileMap);
|
|
}
|
|
}
|
|
|
|
|
|
//项目类型
|
|
//项目类型
|
|
@@ -131,7 +136,7 @@ public class PmDemandServiceImpl implements IPmDemandService
|
|
obj.setDemandId(demandId);
|
|
obj.setDemandId(demandId);
|
|
List<PmDemandEquip> list = iPmDemandEquipService.selectPmDemandEquipList(obj);
|
|
List<PmDemandEquip> list = iPmDemandEquipService.selectPmDemandEquipList(obj);
|
|
if(list !=null && list.size() > 0){
|
|
if(list !=null && list.size() > 0){
|
|
- PmDemandEquipResponseVo responseVo = new PmDemandEquipResponseVo();
|
|
|
|
|
|
+ PmDemandEquipResVo responseVo = new PmDemandEquipResVo();
|
|
BeanUtils.copyProperties(list.get(0),responseVo);
|
|
BeanUtils.copyProperties(list.get(0),responseVo);
|
|
//采购方式建议
|
|
//采购方式建议
|
|
for (ProcurementMethodSuggest value : ProcurementMethodSuggest.values()) {
|
|
for (ProcurementMethodSuggest value : ProcurementMethodSuggest.values()) {
|
|
@@ -141,9 +146,9 @@ public class PmDemandServiceImpl implements IPmDemandService
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- HashMap<String, String> fileMap1 = getFileMap(vo.getDemandId(),"5");
|
|
|
|
|
|
+ HashMap<String, String> fileMap1 = getFileMap(vo.getDemandId(),SysFileRefEnum.PM_DEMAND_EQUIP.getType());
|
|
if(fileMap1 != null){
|
|
if(fileMap1 != null){
|
|
- vo.setFileMap(fileMap1);
|
|
|
|
|
|
+ responseVo.setFileMap(fileMap1);
|
|
}
|
|
}
|
|
|
|
|
|
vo.setPmDemandEquipResponseVo(responseVo);
|
|
vo.setPmDemandEquipResponseVo(responseVo);
|
|
@@ -153,7 +158,7 @@ public class PmDemandServiceImpl implements IPmDemandService
|
|
obj.setDemandId(demandId);
|
|
obj.setDemandId(demandId);
|
|
List<PmDemandMaterials> list = iPmDemandMaterialsService.selectPmDemandMaterialsList(obj);
|
|
List<PmDemandMaterials> list = iPmDemandMaterialsService.selectPmDemandMaterialsList(obj);
|
|
if(list !=null && list.size() > 0){
|
|
if(list !=null && list.size() > 0){
|
|
- PmDemandMaterialsResponseVo responseVo = new PmDemandMaterialsResponseVo();
|
|
|
|
|
|
+ PmDemandMaterialsResVo responseVo = new PmDemandMaterialsResVo();
|
|
BeanUtils.copyProperties(list.get(0),responseVo);
|
|
BeanUtils.copyProperties(list.get(0),responseVo);
|
|
//采购方式建议
|
|
//采购方式建议
|
|
for (ProcurementMethodSuggest value : ProcurementMethodSuggest.values()) {
|
|
for (ProcurementMethodSuggest value : ProcurementMethodSuggest.values()) {
|
|
@@ -162,9 +167,9 @@ public class PmDemandServiceImpl implements IPmDemandService
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- HashMap<String, String> fileMap2 = getFileMap(vo.getDemandId(),"6");
|
|
|
|
|
|
+ HashMap<String, String> fileMap2 = getFileMap(vo.getDemandId(),SysFileRefEnum.PM_DEMAND_MATERIALS.getType());
|
|
if(fileMap2 != null){
|
|
if(fileMap2 != null){
|
|
- vo.setFileMap(fileMap2);
|
|
|
|
|
|
+ responseVo.setFileMap(fileMap2);
|
|
}
|
|
}
|
|
vo.setPmDemandMaterialsResponseVo(responseVo);
|
|
vo.setPmDemandMaterialsResponseVo(responseVo);
|
|
}
|
|
}
|
|
@@ -173,7 +178,7 @@ public class PmDemandServiceImpl implements IPmDemandService
|
|
obj.setDemandId(demandId);
|
|
obj.setDemandId(demandId);
|
|
List<PmDemandServe> list = iPmDemandServeService.selectPmDemandServeList(obj);
|
|
List<PmDemandServe> list = iPmDemandServeService.selectPmDemandServeList(obj);
|
|
if(list !=null && list.size() > 0){
|
|
if(list !=null && list.size() > 0){
|
|
- PmDemandServeResponseVo responseVo = new PmDemandServeResponseVo();
|
|
|
|
|
|
+ PmDemandServeResVo responseVo = new PmDemandServeResVo();
|
|
BeanUtils.copyProperties(list.get(0),responseVo);
|
|
BeanUtils.copyProperties(list.get(0),responseVo);
|
|
//采购方式建议
|
|
//采购方式建议
|
|
for (ProcurementMethodSuggest value : ProcurementMethodSuggest.values()) {
|
|
for (ProcurementMethodSuggest value : ProcurementMethodSuggest.values()) {
|
|
@@ -182,9 +187,9 @@ public class PmDemandServiceImpl implements IPmDemandService
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- HashMap<String, String> fileMap3 = getFileMap(vo.getDemandId(),"7");
|
|
|
|
|
|
+ HashMap<String, String> fileMap3 = getFileMap(vo.getDemandId(),SysFileRefEnum.PM_DEMAND_SERVE.getType());
|
|
if(fileMap3 != null){
|
|
if(fileMap3 != null){
|
|
- vo.setFileMap(fileMap3);
|
|
|
|
|
|
+ responseVo.setFileMap(fileMap3);
|
|
}
|
|
}
|
|
vo.setPmDemandServeResponseVo(responseVo);
|
|
vo.setPmDemandServeResponseVo(responseVo);
|
|
}
|
|
}
|
|
@@ -193,7 +198,7 @@ public class PmDemandServiceImpl implements IPmDemandService
|
|
obj.setDemandId(demandId);
|
|
obj.setDemandId(demandId);
|
|
List<PmDemandEngineering> list = iPmDemandEngineeringService.selectPmDemandEngineeringList(obj);
|
|
List<PmDemandEngineering> list = iPmDemandEngineeringService.selectPmDemandEngineeringList(obj);
|
|
if(list !=null && list.size() > 0){
|
|
if(list !=null && list.size() > 0){
|
|
- PmDemandEngineeringResponseVo responseVo = new PmDemandEngineeringResponseVo();
|
|
|
|
|
|
+ PmDemandEngineeringResVo responseVo = new PmDemandEngineeringResVo();
|
|
BeanUtils.copyProperties(list.get(0),responseVo);
|
|
BeanUtils.copyProperties(list.get(0),responseVo);
|
|
//采购方式建议
|
|
//采购方式建议
|
|
for (ProcurementMethodSuggest value : ProcurementMethodSuggest.values()) {
|
|
for (ProcurementMethodSuggest value : ProcurementMethodSuggest.values()) {
|
|
@@ -223,9 +228,9 @@ public class PmDemandServiceImpl implements IPmDemandService
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- HashMap<String, String> fileMap4 = getFileMap(vo.getDemandId(),"8");
|
|
|
|
|
|
+ HashMap<String, String> fileMap4 = getFileMap(vo.getDemandId(),SysFileRefEnum.PM_DEMAND_ENGINEERING.getType());
|
|
if(fileMap4 != null){
|
|
if(fileMap4 != null){
|
|
- vo.setFileMap(fileMap4);
|
|
|
|
|
|
+ responseVo.setFileMap(fileMap4);
|
|
}
|
|
}
|
|
vo.setPmDemandEngineeringResponseVo(responseVo);
|
|
vo.setPmDemandEngineeringResponseVo(responseVo);
|
|
}
|
|
}
|
|
@@ -240,25 +245,25 @@ public class PmDemandServiceImpl implements IPmDemandService
|
|
/**
|
|
/**
|
|
* 查询采购需求列表
|
|
* 查询采购需求列表
|
|
*
|
|
*
|
|
- * @param requestVo
|
|
|
|
|
|
+ * @param pmReqVo
|
|
* @return 采购需求
|
|
* @return 采购需求
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public List<PmDemandResponseVo> selectPmDemandList(PmRequestVo requestVo)
|
|
|
|
- {
|
|
|
|
|
|
+ public List<PmDemandResVo> selectPmDemandList(PmReqVo pmReqVo) {
|
|
PmDemand pmDemand = new PmDemand();
|
|
PmDemand pmDemand = new PmDemand();
|
|
- pmDemand.setProjectName(requestVo.getProjectName());
|
|
|
|
- pmDemand.setPurchaseServices(requestVo.getPurchaseServiceStation());
|
|
|
|
- pmDemand.setProjectStatus(requestVo.getProjectStatus());
|
|
|
|
|
|
+ pmDemand.setProjectName(pmReqVo.getProjectName());
|
|
|
|
+ pmDemand.setPurchaseServices(pmReqVo.getPurchaseServiceStation());
|
|
|
|
+ pmDemand.setProjectStatus(pmReqVo.getProjectStatus());
|
|
|
|
+ pmDemand.setIsExcess(pmReqVo.getIsExcess());
|
|
Map<String,Object> params = new HashMap<>();
|
|
Map<String,Object> params = new HashMap<>();
|
|
- params.put("beginDate",requestVo.getBeginDate());
|
|
|
|
- params.put("endDate",requestVo.getEndDate());
|
|
|
|
|
|
+ params.put("beginDate",pmReqVo.getBeginDate());
|
|
|
|
+ params.put("endDate",pmReqVo.getEndDate());
|
|
pmDemand.setParams(params);
|
|
pmDemand.setParams(params);
|
|
List<PmDemand> pmDemandList = pmDemandMapper.selectPmDemandList(pmDemand);
|
|
List<PmDemand> pmDemandList = pmDemandMapper.selectPmDemandList(pmDemand);
|
|
- List<PmDemandResponseVo> pmDemandResponseVoList = new ArrayList<>();
|
|
|
|
|
|
+ List<PmDemandResVo> pmDemandResponseVoList = new ArrayList<>();
|
|
if(pmDemandList != null && !pmDemandList.isEmpty()){
|
|
if(pmDemandList != null && !pmDemandList.isEmpty()){
|
|
for(PmDemand pmDemand1 : pmDemandList){
|
|
for(PmDemand pmDemand1 : pmDemandList){
|
|
- PmDemandResponseVo vo = new PmDemandResponseVo();
|
|
|
|
|
|
+ PmDemandResVo vo = new PmDemandResVo();
|
|
BeanUtils.copyBeanProp(pmDemand1,vo);
|
|
BeanUtils.copyBeanProp(pmDemand1,vo);
|
|
SysDeptResponseVo sysDeptResponseVo = (SysDeptResponseVo) deptService.selectDeptById(vo.getPurchaseDeptId()).get("sysDept");
|
|
SysDeptResponseVo sysDeptResponseVo = (SysDeptResponseVo) deptService.selectDeptById(vo.getPurchaseDeptId()).get("sysDept");
|
|
if(sysDeptResponseVo != null){
|
|
if(sysDeptResponseVo != null){
|
|
@@ -327,8 +332,7 @@ public class PmDemandServiceImpl implements IPmDemandService
|
|
* @return 结果
|
|
* @return 结果
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public int insertPmDemand(PmDemand pmDemand)
|
|
|
|
- {
|
|
|
|
|
|
+ public int insertPmDemand(PmDemand pmDemand) {
|
|
pmDemand.setCreateTime(DateUtils.getNowDate());
|
|
pmDemand.setCreateTime(DateUtils.getNowDate());
|
|
return pmDemandMapper.insertPmDemand(pmDemand);
|
|
return pmDemandMapper.insertPmDemand(pmDemand);
|
|
}
|
|
}
|
|
@@ -340,13 +344,26 @@ public class PmDemandServiceImpl implements IPmDemandService
|
|
* @return 结果
|
|
* @return 结果
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public int updatePmDemand(PmDemand pmDemand)
|
|
|
|
- {
|
|
|
|
|
|
+ public int updatePmDemand(PmDemand pmDemand) {
|
|
|
|
+ pmDemand.setUpdateTime(DateUtils.getNowDate());
|
|
|
|
+ return pmDemandMapper.updatePmDemand(pmDemand);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 需求建档
|
|
|
|
+ *
|
|
|
|
+ * @param pmBookBuildingReqVo 采购需求
|
|
|
|
+ * @return 结果
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public int bookBuilding(PmBookBuildingReqVo pmBookBuildingReqVo) {
|
|
|
|
+ PmDemand pmDemand = new PmDemand();
|
|
|
|
+ pmDemand.setDemandId(pmBookBuildingReqVo.getDemandId());
|
|
pmDemand.setUpdateTime(DateUtils.getNowDate());
|
|
pmDemand.setUpdateTime(DateUtils.getNowDate());
|
|
return pmDemandMapper.updatePmDemand(pmDemand);
|
|
return pmDemandMapper.updatePmDemand(pmDemand);
|
|
}
|
|
}
|
|
|
|
|
|
- private HashMap<String, String> getFileMap(Long redId,String type){
|
|
|
|
|
|
+ private HashMap<String, String> getFileMap(Long redId,Integer type){
|
|
HashMap<String, Object> map = new HashMap<>();
|
|
HashMap<String, Object> map = new HashMap<>();
|
|
map.put("red_id", redId);
|
|
map.put("red_id", redId);
|
|
map.put("type", type);
|
|
map.put("type", type);
|
|
@@ -363,4 +380,77 @@ public class PmDemandServiceImpl implements IPmDemandService
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 查看流程图
|
|
|
|
+ *
|
|
|
|
+ * @param demandId 采购需求主键
|
|
|
|
+ * @return 采购需求
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public PmDemandResVo viewFlowChart(Long demandId) {
|
|
|
|
+ PmDemandResVo pmDemandResVo = new PmDemandResVo();
|
|
|
|
+ return pmDemandResVo;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 提交采购需求
|
|
|
|
+ *
|
|
|
|
+ * @param pmReqVo
|
|
|
|
+ * @return 结果
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public int commit(PmReqVo pmReqVo) {
|
|
|
|
+ PmDemand pmDemand = new PmDemand();
|
|
|
|
+ pmDemand.setDemandId(pmReqVo.getDemandId());
|
|
|
|
+ pmDemand.setProjectStatus(Long.parseLong(PmProjectStatus.DEMAND_WAIT_AUDIT.getCode()));
|
|
|
|
+ pmDemand.setUpdateTime(DateUtils.getNowDate());
|
|
|
|
+ return pmDemandMapper.updatePmDemand(pmDemand);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 审核采购需求通过
|
|
|
|
+ *
|
|
|
|
+ * @param pmReqVo
|
|
|
|
+ * @return 结果
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public int reviewTo(PmReqVo pmReqVo) {
|
|
|
|
+ PmDemand pmDemand = new PmDemand();
|
|
|
|
+ pmDemand.setDemandId(pmReqVo.getDemandId());
|
|
|
|
+ pmDemand.setProjectStatus(Long.parseLong(PmProjectStatus.TASK_WAIT_RELEASE.getCode()));
|
|
|
|
+ List<SysFileRef> sysFileRefs = pmReqVo.getSysFileRefs();
|
|
|
|
+ if (!ObjectUtils.isEmpty(sysFileRefs)) {
|
|
|
|
+ for (SysFileRef ref : sysFileRefs) {
|
|
|
|
+ ref.setRedId(pmReqVo.getDemandId());
|
|
|
|
+ ref.setType(SysFileRefEnum.PM_DEMAND_EXAMINE.getType());
|
|
|
|
+ ref.setCreated(pmReqVo.getUpdateBy());
|
|
|
|
+ ref.setCreateTime(new Date());
|
|
|
|
+ ref.setUpdated(pmReqVo.getUpdateBy());
|
|
|
|
+ ref.setUpdateTime(new Date());
|
|
|
|
+ sysFileRefService.save(ref);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ pmDemand.setUpdateTime(DateUtils.getNowDate());
|
|
|
|
+ pmDemand.setAuditTime(DateUtils.getNowDate());
|
|
|
|
+ return pmDemandMapper.updatePmDemand(pmDemand);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 审核采购需求退回
|
|
|
|
+ *
|
|
|
|
+ * @param pmReqVo
|
|
|
|
+ * @return 结果
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public int reviewReturn(PmReqVo pmReqVo) {
|
|
|
|
+ PmDemand pmDemand = new PmDemand();
|
|
|
|
+ pmDemand.setDemandId(pmReqVo.getDemandId());
|
|
|
|
+ pmDemand.setProjectStatus(Long.parseLong(PmProjectStatus.DEMAND_WAIT_COMMIT.getCode()));
|
|
|
|
+ pmDemand.setAdjustReason(pmReqVo.getRefuseReason());
|
|
|
|
+ pmDemand.setUpdateTime(DateUtils.getNowDate());
|
|
|
|
+ pmDemand.setAuditTime(DateUtils.getNowDate());
|
|
|
|
+ return pmDemandMapper.updatePmDemand(pmDemand);
|
|
|
|
+ }
|
|
}
|
|
}
|