查询工作组成员是否收费通知接口
This commit is contained in:
+6
-14
@@ -2,10 +2,6 @@ package com.jero.project.common;
|
||||
|
||||
public class PayProjectCommon {
|
||||
|
||||
/**
|
||||
* 打包(1:是,0:否)
|
||||
*/
|
||||
public final static Integer PACKAGING1 = 1;
|
||||
/**
|
||||
* 打包(1:是,0:否)
|
||||
*/
|
||||
@@ -48,20 +44,16 @@ public class PayProjectCommon {
|
||||
public final static Integer MAIL2 = 2;
|
||||
|
||||
/**
|
||||
* 普通项目
|
||||
* 来款方式(1:无,2:合同,3:收费通知)
|
||||
*/
|
||||
public final static String PROJECT_TYPE1 = "1";
|
||||
public final static Integer CHARGE_WAY1 = 1;
|
||||
/**
|
||||
* 工作组项目
|
||||
* 来款方式(1:无,2:合同,3:收费通知)
|
||||
*/
|
||||
public final static String PROJECT_TYPE2 = "2";
|
||||
public final static Integer CHARGE_WAY2 = 2;
|
||||
/**
|
||||
*
|
||||
* 来款方式(1:无,2:合同,3:收费通知)
|
||||
*/
|
||||
public final static String PROJECT_TYPE3 = "3";
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public final static String PROJECT_TYPE4 = "4";
|
||||
public final static Integer CHARGE_WAY3 = 3;
|
||||
|
||||
}
|
||||
|
||||
+80
-6
@@ -4,18 +4,13 @@ import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.service.ProjectDetailService;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.common.util.PasswordUtil;
|
||||
import com.jero.common.util.ValidUtil;
|
||||
import com.jero.company.common.PayCompanyManagementCommon;
|
||||
import com.jero.company.entity.PayCompanyManagement;
|
||||
import com.jero.company.entity.PayContactsManagement;
|
||||
import com.jero.company.service.IPayCompanyManagementService;
|
||||
@@ -25,7 +20,6 @@ import com.jero.project.entity.PayWorkingGroup;
|
||||
import com.jero.project.entity.PayWorkingGroupSubItem;
|
||||
import com.jero.project.service.IPayWorkingGroupService;
|
||||
import com.jero.project.service.IPayWorkingGroupSubItemService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.project.vo.SetChargeInput;
|
||||
@@ -114,6 +108,23 @@ public class PayWorkingGroupSubItemController extends JeroController<PayWorkingG
|
||||
if(!StringUtils.isBlank(msg)){
|
||||
return Result.error(msg.toString());
|
||||
}
|
||||
if(payWorkingGroupSubItem.getChargeWay() == PayProjectCommon.CHARGE_WAY2){
|
||||
if(Objects.isNull(payWorkingGroupSubItem.getReceivableAmount())){
|
||||
return Result.error("应收金额不能为空");
|
||||
}
|
||||
if(StringUtils.isBlank(payWorkingGroupSubItem.getContractNum())){
|
||||
return Result.error("合同号不能为空");
|
||||
}
|
||||
}
|
||||
if(payWorkingGroupSubItem.getChargeWay() == PayProjectCommon.CHARGE_WAY3){
|
||||
if(Objects.isNull(payWorkingGroupSubItem.getChargeNoticeNo())){
|
||||
return Result.error("收费通知号不能为空");
|
||||
}
|
||||
if(Objects.isNull(payWorkingGroupSubItem.getReceivableAmount())){
|
||||
return Result.error("应收金额不能为空");
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
// 编辑保存前再次校验来款项目是否存在
|
||||
LambdaQueryWrapper<PayWorkingGroupSubItem> queryWrapper = new LambdaQueryWrapper<>();
|
||||
@@ -155,6 +166,22 @@ public class PayWorkingGroupSubItemController extends JeroController<PayWorkingG
|
||||
if(!StringUtils.isBlank(msg)){
|
||||
return Result.error(msg.toString());
|
||||
}
|
||||
if(payWorkingGroupSubItem.getChargeWay() == PayProjectCommon.CHARGE_WAY2){
|
||||
if(Objects.isNull(payWorkingGroupSubItem.getReceivableAmount())){
|
||||
return Result.error("应收金额不能为空");
|
||||
}
|
||||
if(StringUtils.isBlank(payWorkingGroupSubItem.getContractNum())){
|
||||
return Result.error("合同号不能为空");
|
||||
}
|
||||
}
|
||||
if(payWorkingGroupSubItem.getChargeWay() == PayProjectCommon.CHARGE_WAY3){
|
||||
if(Objects.isNull(payWorkingGroupSubItem.getChargeNoticeNo())){
|
||||
return Result.error("收费通知号不能为空");
|
||||
}
|
||||
if(Objects.isNull(payWorkingGroupSubItem.getReceivableAmount())){
|
||||
return Result.error("应收金额不能为空");
|
||||
}
|
||||
}
|
||||
try {
|
||||
// 编辑保存前再次校验来款项目是否存在
|
||||
LambdaQueryWrapper<PayWorkingGroupSubItem> queryWrapper = new LambdaQueryWrapper<>();
|
||||
@@ -267,6 +294,37 @@ public class PayWorkingGroupSubItemController extends JeroController<PayWorkingG
|
||||
this.payWorkingGroupSubItemService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
/**
|
||||
* 查询工作组成员是否收费通知
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value="工作组成员-查询工作组成员是否收费通知", notes="工作组成员-查询工作组成员是否收费通知")
|
||||
@GetMapping(value = "/getCharge")
|
||||
public Result<?> getCharge(@RequestParam(name = "ids") String ids) {
|
||||
if(StringUtils.isBlank(ids)){
|
||||
return Result.error("id不能为空!");
|
||||
}
|
||||
String[] s = ids.split(",");
|
||||
for (String s1 : s) {
|
||||
if(StringUtils.isBlank(s1)){
|
||||
return Result.error("id不能为空!");
|
||||
}
|
||||
}
|
||||
LambdaQueryWrapper<PayWorkingGroupSubItem> query = new LambdaQueryWrapper<>();
|
||||
query.in(PayWorkingGroupSubItem::getId,Arrays.asList(ids.split(",")));
|
||||
List<PayWorkingGroupSubItem> list = payWorkingGroupSubItemService.list();
|
||||
if(!CollectionUtils.isEmpty(list)){
|
||||
List<PayWorkingGroupSubItem> listNew = list.stream().filter(p->Objects.equals(p.getChargeWay(),PayProjectCommon.CHARGE_WAY3)).collect(Collectors.toList());
|
||||
if(CollectionUtils.isEmpty(listNew)){
|
||||
return Result.error("存在来款方式不是收费通知的选项!");
|
||||
}
|
||||
}else{
|
||||
return Result.error("请选择项目!");
|
||||
}
|
||||
return Result.OK("设置收费通知成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置收费通知
|
||||
@@ -402,6 +460,22 @@ public class PayWorkingGroupSubItemController extends JeroController<PayWorkingG
|
||||
list.forEach(p->{
|
||||
p.setWorkingGroupId(workGroupId);
|
||||
int count = list.indexOf(p);
|
||||
if(Objects.equals(p.getChargeWay(),PayProjectCommon.CHARGE_WAY2)){
|
||||
if(Objects.isNull(p.getReceivableAmount())){
|
||||
msg.append("第 ").append(count + 3).append(" 行:应收金额不能为空,请修改。</br>");
|
||||
}
|
||||
if(StringUtils.isBlank(p.getContractNum())){
|
||||
msg.append("第 ").append(count + 3).append(" 行:合同号不能为空,请修改。</br>");
|
||||
}
|
||||
}
|
||||
if(Objects.equals(p.getChargeWay(),PayProjectCommon.CHARGE_WAY3)){
|
||||
if(Objects.isNull(p.getChargeNoticeNo())){
|
||||
msg.append("第 ").append(count + 3).append(" 行:收费通知号不能为空,请修改。</br>");
|
||||
}
|
||||
if(Objects.isNull(p.getReceivableAmount())){
|
||||
msg.append("第 ").append(count + 3).append(" 行:应收金额不能为空,请修改。</br>");
|
||||
}
|
||||
}
|
||||
// 校验企业名称
|
||||
List<PayCompanyManagement> listCompany = new ArrayList<>();
|
||||
if(StringUtils.isBlank(p.getChargeCompanyTemporaryName())){
|
||||
|
||||
Reference in New Issue
Block a user