|
@@ -71,14 +71,15 @@ public class PmDemandController extends BaseController {
|
|
|
// @PreAuthorize("@ss.hasPermi('pm:demand:view')") 首页去除权限
|
|
|
@Log(title = ModularConstans.demand, businessType = BusinessType.QUERY)
|
|
|
public AjaxResult view(@RequestBody PmDemandReqVo pmDemandReqVo) {
|
|
|
- if(pmDemandReqVo.getDemandId() == null){
|
|
|
+ if (pmDemandReqVo.getDemandId() == null) {
|
|
|
return AjaxResult.error("demandId不能为空");
|
|
|
}
|
|
|
- if(StringUtils.isEmpty(pmDemandReqVo.getDetailType())){
|
|
|
+ if (StringUtils.isEmpty(pmDemandReqVo.getDetailType())) {
|
|
|
return AjaxResult.error("详情的类型不能为空");
|
|
|
}
|
|
|
- return success(pmDemandService.selectPmDemandByDemandId(pmDemandReqVo.getDemandId(),pmDemandReqVo.getDetailType()));
|
|
|
+ return success(pmDemandService.selectPmDemandByDemandId(pmDemandReqVo.getDemandId(), pmDemandReqVo.getDetailType()));
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 获取回退下拉列表
|
|
|
*/
|
|
@@ -88,23 +89,24 @@ public class PmDemandController extends BaseController {
|
|
|
@Log(title = ModularConstans.demand, businessType = BusinessType.QUERY)
|
|
|
public AjaxResult getReturnList(@NotEmpty(message = "需求ID不能为空")
|
|
|
@RequestParam(value = "demandId", required = true) Long demandId) {
|
|
|
- List< Map<String,Integer>> list = new ArrayList<>();
|
|
|
+ List<Map<String, Integer>> list = new ArrayList<>();
|
|
|
LambdaQueryWrapper<PmDemandHis> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
- lambdaQueryWrapper.eq(PmDemandHis::getDemandId,demandId).orderByAsc(PmDemandHis::getReturnOrderNumber);
|
|
|
+ lambdaQueryWrapper.eq(PmDemandHis::getDemandId, demandId).orderByAsc(PmDemandHis::getReturnOrderNumber);
|
|
|
List<PmDemandHis> pmDemandHisList = this.pmDemandHisService.list(lambdaQueryWrapper);
|
|
|
- if(!ObjectUtils.isEmpty(pmDemandHisList)){
|
|
|
- Map<String,Integer> map = new HashMap<>();
|
|
|
- map.put("当前信息",0);
|
|
|
+ if (!ObjectUtils.isEmpty(pmDemandHisList)) {
|
|
|
+ Map<String, Integer> map = new HashMap<>();
|
|
|
+ map.put("当前信息", 0);
|
|
|
list.add(map);
|
|
|
for (PmDemandHis pmDemandHis : pmDemandHisList) {
|
|
|
- Map<String,Integer> map2 = new HashMap<>();
|
|
|
- map2.put("第" + pmDemandHis.getReturnOrderNumber() + "回退",pmDemandHis.getReturnOrderNumber());
|
|
|
+ Map<String, Integer> map2 = new HashMap<>();
|
|
|
+ map2.put("第" + pmDemandHis.getReturnOrderNumber() + "回退", pmDemandHis.getReturnOrderNumber());
|
|
|
list.add(map2);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return success(list);
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 查看历史详情
|
|
|
*/
|
|
@@ -113,22 +115,23 @@ public class PmDemandController extends BaseController {
|
|
|
@PreAuthorize("@ss.hasPermi('pm:demand:viewHis')")
|
|
|
@Log(title = ModularConstans.demand, businessType = BusinessType.QUERY)
|
|
|
public AjaxResult viewHis(@RequestBody PmDemandReqVo pmDemandReqVo) {
|
|
|
- if(pmDemandReqVo.getDemandId() == null){
|
|
|
+ if (pmDemandReqVo.getDemandId() == null) {
|
|
|
return AjaxResult.error("demandId不能为空");
|
|
|
}
|
|
|
- if(ObjectUtils.isEmpty(pmDemandReqVo.getDetailType())){
|
|
|
+ if (ObjectUtils.isEmpty(pmDemandReqVo.getDetailType())) {
|
|
|
return AjaxResult.error("详情的类型不能为空");
|
|
|
}
|
|
|
- if(ObjectUtils.isEmpty(pmDemandReqVo.getReturnOrderNumber())){
|
|
|
+ if (ObjectUtils.isEmpty(pmDemandReqVo.getReturnOrderNumber())) {
|
|
|
return AjaxResult.error("回退序号不能为空");
|
|
|
}
|
|
|
- if(0 == pmDemandReqVo.getReturnOrderNumber()){
|
|
|
- return success(pmDemandService.selectPmDemandByDemandId(pmDemandReqVo.getDemandId(),pmDemandReqVo.getDetailType()));
|
|
|
+ if (0 == pmDemandReqVo.getReturnOrderNumber()) {
|
|
|
+ return success(pmDemandService.selectPmDemandByDemandId(pmDemandReqVo.getDemandId(), pmDemandReqVo.getDetailType()));
|
|
|
} else {
|
|
|
- return success(pmDemandHisService.selectPmDemandHisByDemandId(pmDemandReqVo.getDemandId(),pmDemandReqVo.getDetailType(),pmDemandReqVo.getReturnOrderNumber()));
|
|
|
+ return success(pmDemandHisService.selectPmDemandHisByDemandId(pmDemandReqVo.getDemandId(), pmDemandReqVo.getDetailType(), pmDemandReqVo.getReturnOrderNumber()));
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 需求建档
|
|
|
*/
|
|
@@ -173,7 +176,7 @@ public class PmDemandController extends BaseController {
|
|
|
@PreAuthorize("@ss.hasPermi('pm:demand:commit')")
|
|
|
@Log(title = ModularConstans.demand, businessType = BusinessType.UPDATE)
|
|
|
public AjaxResult commit(@RequestBody PmDemandReqVo pmDemandReqVo, HttpServletRequest request) {
|
|
|
- if(pmDemandReqVo.getDemandId() == null){
|
|
|
+ if (pmDemandReqVo.getDemandId() == null) {
|
|
|
return AjaxResult.error("demandId不能为空");
|
|
|
}
|
|
|
|
|
@@ -190,7 +193,7 @@ public class PmDemandController extends BaseController {
|
|
|
@PreAuthorize("@ss.hasPermi('pm:demand:viewFlowChart')")
|
|
|
@Log(title = ModularConstans.demand, businessType = BusinessType.QUERY)
|
|
|
public AjaxResult viewFlowChart(@RequestBody PmDemandReqVo pmRequestVo) {
|
|
|
- if(pmRequestVo.getDemandId() == null){
|
|
|
+ if (pmRequestVo.getDemandId() == null) {
|
|
|
return AjaxResult.error("demandId不能为空");
|
|
|
}
|
|
|
return success(pmDemandService.viewFlowChart(pmRequestVo.getDemandId()));
|
|
@@ -206,7 +209,12 @@ public class PmDemandController extends BaseController {
|
|
|
@Log(title = ModularConstans.demandExamine, businessType = BusinessType.QUERY)
|
|
|
public AjaxResult examineList(@RequestBody PmDemandReqVo pmDemandReqVo) {
|
|
|
pmDemandReqVo.setIsAdmin(SysUser.isAdmin(getUserId()));
|
|
|
- pmDemandReqVo.setDeptId(getDeptId());
|
|
|
+ //前端没有选择部门id,就默认登录人的id
|
|
|
+ if (!ObjectUtils.isEmpty(pmDemandReqVo.getDeptId())) {
|
|
|
+ pmDemandReqVo.setDeptId(pmDemandReqVo.getDeptId());
|
|
|
+ } else {
|
|
|
+ pmDemandReqVo.setDeptId(getDeptId());
|
|
|
+ }
|
|
|
pmDemandReqVo.setUserId(getUserId());
|
|
|
IPage<PmDemandResVo> page = pmDemandService.selectPmDemandList(pmDemandReqVo, 1);
|
|
|
return success(page);
|
|
@@ -217,10 +225,10 @@ public class PmDemandController extends BaseController {
|
|
|
@PreAuthorize("@ss.hasPermi('pm:examine:reviewTo')")
|
|
|
@Log(title = ModularConstans.demandExamine, businessType = BusinessType.UPDATE)
|
|
|
public AjaxResult reviewTo(@RequestBody PmDemandReqVo pmDemandReqVo, HttpServletRequest request) {
|
|
|
- if(pmDemandReqVo.getDemandId() == null){
|
|
|
+ if (pmDemandReqVo.getDemandId() == null) {
|
|
|
return AjaxResult.error("demandId不能为空");
|
|
|
}
|
|
|
- if(pmDemandReqVo.getSysFileRefs() == null || pmDemandReqVo.getSysFileRefs().size() == 0){
|
|
|
+ if (pmDemandReqVo.getSysFileRefs() == null || pmDemandReqVo.getSysFileRefs().size() == 0) {
|
|
|
return AjaxResult.error("上传附件不能为空");
|
|
|
}
|
|
|
LoginUser loginUser = tokenService.getLoginUser(request);
|
|
@@ -233,10 +241,10 @@ public class PmDemandController extends BaseController {
|
|
|
@PreAuthorize("@ss.hasPermi('pm:examine:reviewReturn')")
|
|
|
@Log(title = ModularConstans.demandExamine, businessType = BusinessType.UPDATE)
|
|
|
public AjaxResult reviewReturn(@RequestBody PmDemandReqVo pmDemandReqVo, HttpServletRequest request) {
|
|
|
- if(pmDemandReqVo.getDemandId() == null){
|
|
|
+ if (pmDemandReqVo.getDemandId() == null) {
|
|
|
return AjaxResult.error("demandId不能为空");
|
|
|
}
|
|
|
- if(StringUtils.isEmpty(pmDemandReqVo.getRefuseReason())){
|
|
|
+ if (StringUtils.isEmpty(pmDemandReqVo.getRefuseReason())) {
|
|
|
return AjaxResult.error("退回原因不能为空");
|
|
|
}
|
|
|
LoginUser loginUser = tokenService.getLoginUser(request);
|