|
|
@@ -11,6 +11,7 @@ import org.apache.poi.ss.usermodel.Sheet;
|
|
|
import org.apache.poi.ss.usermodel.Workbook;
|
|
|
import org.apache.shiro.SecurityUtils;
|
|
|
import org.jeecg.common.api.vo.Result;
|
|
|
+import org.jeecg.common.constant.CommonConstant;
|
|
|
import org.jeecg.common.system.vo.LoginUser;
|
|
|
import org.jeecg.common.util.StringUtils;
|
|
|
import org.jeecg.common.util.businessAccountUtils;
|
|
|
@@ -54,6 +55,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|
|
import javax.annotation.Resource;
|
|
|
import java.io.IOException;
|
|
|
import java.math.BigDecimal;
|
|
|
+import java.math.RoundingMode;
|
|
|
import java.text.DecimalFormat;
|
|
|
import java.util.*;
|
|
|
import java.util.regex.Matcher;
|
|
|
@@ -152,7 +154,17 @@ public class HlgPaymentServiceImpl extends ServiceImpl<HlgPaymentMapper, HlgPaym
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public Result<HlgPayment> payment(HlgPayment hlgPayment) {
|
|
|
Result<HlgPayment> result = new Result<HlgPayment>();
|
|
|
-
|
|
|
+ HlgPayment hlgPaymentEntity = getById(hlgPayment.getId());
|
|
|
+ //付款单是否已删除
|
|
|
+ if (CommonConstant.DEL_FLAG_1.toString().equals(hlgPaymentEntity.getDelFlag())) {
|
|
|
+ result.error500("该付款单已删除,请刷新后重试!");
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ //付款单状态不是待付款
|
|
|
+ if (hlgPaymentEntity.getStatus() != 0) {
|
|
|
+ result.error500("该付款单状态已变更,请刷新后重试!");
|
|
|
+ return result;
|
|
|
+ }
|
|
|
/**
|
|
|
* 1、
|
|
|
* 状态为复核通过
|
|
|
@@ -281,8 +293,8 @@ public class HlgPaymentServiceImpl extends ServiceImpl<HlgPaymentMapper, HlgPaym
|
|
|
}
|
|
|
|
|
|
//四舍五入,保留俩位小数
|
|
|
- DecimalFormat df = new DecimalFormat("#.00");
|
|
|
- String totalPaymenStr = df.format(totalPayment);
|
|
|
+ BigDecimal bg = BigDecimal.valueOf(totalPayment).setScale(2, RoundingMode.HALF_UP);
|
|
|
+ String totalPaymenStr = bg.toString();
|
|
|
|
|
|
//服务商信息
|
|
|
HlgSubcontractor hlgSubcontractor = hlgSubcontractorService.getById(hlgPayment.getSubcontractorId());
|
|
|
@@ -373,8 +385,14 @@ public class HlgPaymentServiceImpl extends ServiceImpl<HlgPaymentMapper, HlgPaym
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public Result<HlgPayment> deleteByLogic(HlgPayment hlgPayment) {
|
|
|
Result<HlgPayment> result = new Result<HlgPayment>();
|
|
|
- baseMapper.deleteByLogic(hlgPayment);
|
|
|
- result.success("删除成功");
|
|
|
+ if (hlgPayment.getStatus() == 0 || hlgPayment.getStatus() == 2) {
|
|
|
+ baseMapper.deleteByLogic(hlgPayment);
|
|
|
+ //同步逻辑删除付款明细
|
|
|
+ hlgPaymentDetailService.deleteByLogic(hlgPayment);
|
|
|
+ result.success("删除成功");
|
|
|
+ } else {
|
|
|
+ result.error500("删除失败");
|
|
|
+ }
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
@@ -458,8 +476,8 @@ public class HlgPaymentServiceImpl extends ServiceImpl<HlgPaymentMapper, HlgPaym
|
|
|
}
|
|
|
|
|
|
//四舍五入,保留俩位小数
|
|
|
- DecimalFormat df = new DecimalFormat("#.00");
|
|
|
- String totalPaymenStr = df.format(totalPayment);
|
|
|
+ BigDecimal bg = BigDecimal.valueOf(totalPayment).setScale(2, RoundingMode.HALF_UP);
|
|
|
+ String totalPaymenStr = bg.toString();
|
|
|
|
|
|
//服务商信息
|
|
|
HlgSubcontractor hlgSubcontractor = hlgSubcontractorService.getById(hlgPayment.getSubcontractorId());
|
|
|
@@ -683,7 +701,7 @@ public class HlgPaymentServiceImpl extends ServiceImpl<HlgPaymentMapper, HlgPaym
|
|
|
HlgUser hlgUser = hlgUserMapper.getUserByIdcardNumber(idcardNumber);
|
|
|
if (hlgUser == null) {
|
|
|
//获取当前平台id
|
|
|
- HlgCompany hlgCompany=hlgCompanyService.getById(hlgPayment.getCompanyId());
|
|
|
+ HlgCompany hlgCompany = hlgCompanyService.getById(hlgPayment.getCompanyId());
|
|
|
HlgPlatform hlgPlatform = hlgPlatformMapper.selectById(hlgCompany.getPlatformId());
|
|
|
HlgUser hlgUser1 = new HlgUser();
|
|
|
hlgUser1.setPlatformId(hlgPlatform.getId());
|
|
|
@@ -743,7 +761,7 @@ public class HlgPaymentServiceImpl extends ServiceImpl<HlgPaymentMapper, HlgPaym
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if(resultlist.size()>0){
|
|
|
+ if (resultlist.size() > 0) {
|
|
|
return resultlist;
|
|
|
}
|
|
|
//定义导入付款总金额
|
|
|
@@ -795,6 +813,12 @@ public class HlgPaymentServiceImpl extends ServiceImpl<HlgPaymentMapper, HlgPaym
|
|
|
Result<HlgPaymentDetail> result = new Result<>();
|
|
|
//旧实体
|
|
|
HlgPaymentDetail hlgPaymentDetailO = hlgPaymentDetailService.getById(hlgPaymentDetailN.getId());
|
|
|
+ //该付款明细是否满足补发条件
|
|
|
+ if (hlgPaymentDetailO.getStatus() != 3) {
|
|
|
+ result.error500("该付款明细不满足补发条件!");
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
//更新的身份证号是否存在
|
|
|
QueryWrapper<HlgUser> queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.eq("idcard_number", hlgPaymentDetailN.getIdcardNumber());
|
|
|
@@ -867,8 +891,8 @@ public class HlgPaymentServiceImpl extends ServiceImpl<HlgPaymentMapper, HlgPaym
|
|
|
}
|
|
|
|
|
|
//四舍五入,保留俩位小数
|
|
|
- DecimalFormat df = new DecimalFormat("#.00");
|
|
|
- String totalPaymenStr = df.format(totalPayment);
|
|
|
+ BigDecimal bg = BigDecimal.valueOf(totalPayment).setScale(2, RoundingMode.HALF_UP);
|
|
|
+ String totalPaymenStr = bg.toString();
|
|
|
|
|
|
//服务商信息
|
|
|
HlgSubcontractor hlgSubcontractor = hlgSubcontractorService.getById(hlgPayment.getSubcontractorId());
|