Commit 24dc594b by HlQ

[add]

1.添加合同项目互相绑定和解绑接口
2.添加项目日志相关接口
3.添加批量导入任务和任务导出接口
4.用户列表接口添加 userid 字段
[fix] 结算差异联调以及 bug 修改
1 parent 0bb04771
...@@ -2,8 +2,6 @@ package vion.controller; ...@@ -2,8 +2,6 @@ package vion.controller;
import cn.dev33.satoken.annotation.SaCheckPermission; import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.lang.Assert; import cn.hutool.core.lang.Assert;
import cn.hutool.core.lang.Opt;
import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.util.ObjUtil; import cn.hutool.core.util.ObjUtil;
import cn.hutool.json.JSONObject; import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
...@@ -20,7 +18,7 @@ import vion.service.IRContractStoreService; ...@@ -20,7 +18,7 @@ import vion.service.IRContractStoreService;
import vion.vo.ContractVO; import vion.vo.ContractVO;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.Map;
/** /**
* 合同管理 * 合同管理
...@@ -63,44 +61,26 @@ public class ContractController { ...@@ -63,44 +61,26 @@ public class ContractController {
public String updateById(@PathVariable Long id, ContractDTO dto) { public String updateById(@PathVariable Long id, ContractDTO dto) {
return contractService.updateById(id, null, dto); return contractService.updateById(id, null, dto);
} }
@PostMapping("/contract/store") @PostMapping("/contract/store")
@SaCheckPermission(value = "contract:store:edit", orRole = "admin") @SaCheckPermission(value = "contract:store:save", orRole = "admin")
public String saveOrUpdateRContractStore(@RequestBody RContractStoreDTO dto) { public String bindStore(@RequestBody RContractStoreDTO dto) {
Assert.isFalse(ArrayUtil.isAllNotNull(dto.getStoreId(), dto.getContractId()), "合同id和项目id不能同时传值"); Assert.notNull(dto.getContractId(), "合同id不能为空");
if (ObjUtil.isNotNull(dto.getContractId())) { Assert.notNull(dto.getStoreId(), "项目id不能为空");
contractStoreService.lambdaUpdate() RContractStore contractStore = new RContractStore();
.eq(RContractStore::getContractId, dto.getContractId()) contractStore.setContractId(dto.getContractId());
.remove(); contractStore.setStoreId(dto.getStoreId());
Opt.ofEmptyAble(dto.getStoreIds()) return contractStoreService.save(contractStore) ? "绑定成功" : "绑定失败";
.ifPresent(storeIds -> { }
List<RContractStore> contractStoreList = storeIds.stream()
.map(storeId -> { @DeleteMapping("/contract/store")
RContractStore contractStore = new RContractStore(); @SaCheckPermission(value = "contract:store:remove", orRole = "admin")
contractStore.setContractId(dto.getContractId()); public String unbindStore(@RequestBody RContractStoreDTO dto) {
contractStore.setStoreId(storeId); Assert.notNull(dto.getContractId(), "合同id不能为空");
return contractStore; Assert.notNull(dto.getStoreId(), "项目id不能为空");
}).collect(Collectors.toList()); return contractStoreService.lambdaUpdate()
contractStoreService.saveBatch(contractStoreList); .eq(RContractStore::getContractId, dto.getContractId())
}); .eq(RContractStore::getStoreId, dto.getStoreId())
} .remove() ? "解绑成功" : "解绑失败";
if (ObjUtil.isNotNull(dto.getStoreId())) {
contractStoreService.lambdaUpdate()
.eq(RContractStore::getStoreId, dto.getStoreId())
.remove();
Opt.ofEmptyAble(dto.getContractIds())
.ifPresent(contractIds -> {
List<RContractStore> contractStoreList = contractIds.stream()
.map(contractId -> {
RContractStore contractStore = new RContractStore();
contractStore.setContractId(contractId);
contractStore.setStoreId(dto.getStoreId());
return contractStore;
}).collect(Collectors.toList());
contractStoreService.saveBatch(contractStoreList);
});
}
return "成功";
} }
@GetMapping("/contract/store") @GetMapping("/contract/store")
...@@ -120,34 +100,30 @@ public class ContractController { ...@@ -120,34 +100,30 @@ public class ContractController {
@GetMapping("/contract/analyze") @GetMapping("/contract/analyze")
@SaCheckPermission(value = "contract:analyze", orRole = "admin") @SaCheckPermission(value = "contract:analyze", orRole = "admin")
public Object analyze(ContractDTO dto) { public Map<String, Object> analyze(ContractDTO dto) {
return contractService.analyze(dto); return contractService.analyze(dto);
} }
@PostMapping("/contract/dispatch") @PostMapping("/contract/dispatch")
@SaCheckPermission(value = "contract:dispatch", orRole = "admin") @SaCheckPermission(value = "contract:dispatch", orRole = "admin")
// todo 未分配权限
public String dispatch(@RequestBody RContractTeamDTO dto) { public String dispatch(@RequestBody RContractTeamDTO dto) {
return contractService.dispatch(dto); return contractService.dispatch(dto);
} }
@GetMapping("/contract/sale") @GetMapping("/contract/sale")
@SaCheckPermission(value = "contract:sale:list", orRole = "admin") @SaCheckPermission(value = "contract:sale:list", orRole = "admin")
// todo 未分配权限
public Page<RContractUser> getSaleList(RContractUser dto) { public Page<RContractUser> getSaleList(RContractUser dto) {
return contractService.getSaleList(dto); return contractService.getSaleList(dto);
} }
@PostMapping("/contract/assignSale") @PostMapping("/contract/assignSale")
@SaCheckPermission(value = "contract:assignSale", orRole = "admin") @SaCheckPermission(value = "contract:assignSale", orRole = "admin")
// todo 未分配权限
public String assignSale(@RequestBody RContractUser dto) { public String assignSale(@RequestBody RContractUser dto) {
return contractService.assignSale(dto); return contractService.assignSale(dto);
} }
@PostMapping("/contract/unbindSale") @PostMapping("/contract/unbindSale")
@SaCheckPermission(value = "contract:unbindSale", orRole = "admin") @SaCheckPermission(value = "contract:unbindSale", orRole = "admin")
// todo 未分配权限
public String unbindSale(@RequestBody RContractUser dto) { public String unbindSale(@RequestBody RContractUser dto) {
return contractService.unbindSale(dto); return contractService.unbindSale(dto);
} }
...@@ -155,6 +131,7 @@ public class ContractController { ...@@ -155,6 +131,7 @@ public class ContractController {
@PostMapping("/contractSync") @PostMapping("/contractSync")
@SaCheckPermission(value = "contract:sync", orRole = "admin") @SaCheckPermission(value = "contract:sync", orRole = "admin")
public String manualSyncContract() { public String manualSyncContract() {
return contractRunner.contractSync() ? "成功" : "失败"; contractRunner.contractSync();
return "成功";
} }
} }
package vion.controller; package vion.controller;
import cn.dev33.satoken.annotation.SaCheckPermission; import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.lang.Opt;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import vion.dto.SettlementDiffDTO; import vion.dto.SettlementDiffDTO;
import vion.model.FileInfo;
import vion.service.IFileService;
import vion.service.ISettlementDiffService; import vion.service.ISettlementDiffService;
import vion.vo.SettlementDiffVO; import vion.vo.SettlementDiffVO;
...@@ -19,9 +16,8 @@ import vion.vo.SettlementDiffVO; ...@@ -19,9 +16,8 @@ import vion.vo.SettlementDiffVO;
public class SettlementDiffController { public class SettlementDiffController {
private final ISettlementDiffService settlementDiffService; private final ISettlementDiffService settlementDiffService;
private final IFileService fileService;
@GetMapping("/settlementDiff/{no}") @GetMapping("/settlementDiff/list/{no}")
@SaCheckPermission(value = "settlementDiff:list", orRole = "admin") @SaCheckPermission(value = "settlementDiff:list", orRole = "admin")
public Page<SettlementDiffVO> list(@PathVariable String no, SettlementDiffDTO dto) { public Page<SettlementDiffVO> list(@PathVariable String no, SettlementDiffDTO dto) {
return settlementDiffService.list(no, dto); return settlementDiffService.list(no, dto);
...@@ -34,13 +30,13 @@ public class SettlementDiffController { ...@@ -34,13 +30,13 @@ public class SettlementDiffController {
@PostMapping("/settlementDiff") @PostMapping("/settlementDiff")
@SaCheckPermission(value = "settlementDiff:save", orRole = "admin") @SaCheckPermission(value = "settlementDiff:save", orRole = "admin")
public String save(@RequestBody SettlementDiffDTO dto) { public String save(SettlementDiffDTO dto) {
return settlementDiffService.save(dto); return settlementDiffService.save(dto);
} }
@PostMapping("/settlementDiff/{id}") @PostMapping("/settlementDiff/{id}")
@SaCheckPermission(value = "settlementDiff:edit", orRole = "admin") @SaCheckPermission(value = "settlementDiff:edit", orRole = "admin")
public String update(@PathVariable Long id, @RequestBody SettlementDiffDTO dto) { public String update(@PathVariable Long id, SettlementDiffDTO dto) {
dto.setId(id); dto.setId(id);
return settlementDiffService.update(id, dto); return settlementDiffService.update(id, dto);
} }
...@@ -49,12 +45,7 @@ public class SettlementDiffController { ...@@ -49,12 +45,7 @@ public class SettlementDiffController {
@SaCheckPermission(value = "settlementDiff:remove", orRole = "admin") @SaCheckPermission(value = "settlementDiff:remove", orRole = "admin")
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public String delById(@PathVariable Long id) { public String delById(@PathVariable Long id) {
Opt.ofEmptyAble(fileService.lambdaQuery() return settlementDiffService.delById(id);
.eq(FileInfo::getSourceId, id)
.eq(FileInfo::getType, 15)
.list())
.ifPresent(fileService::removeBatchByIds);
return settlementDiffService.removeById(id) ? "删除成功" : "删除失败";
} }
} }
...@@ -92,12 +92,11 @@ public class StoreController { ...@@ -92,12 +92,11 @@ public class StoreController {
@GetMapping("/store/manualCal") @GetMapping("/store/manualCal")
@SaCheckPermission(value = "store:calMaintainStatus", orRole = "admin") @SaCheckPermission(value = "store:calMaintainStatus", orRole = "admin")
// todo 权限未加,前端未调用该接口 // todo 权限未加,前端未使用到该接口
public String manualCalMaintainStatus() { public String manualCalMaintainStatus() {
return storeService.calMaintainStatus(); return storeService.calMaintainStatus();
} }
/*----------------------- todo 以下权限未加 ----------------------*/
@GetMapping("/store/user/{storeId}") @GetMapping("/store/user/{storeId}")
@SaCheckPermission(value = "store:user:list", orRole = "admin") @SaCheckPermission(value = "store:user:list", orRole = "admin")
public List<RStoreUser> getUserList(@PathVariable Long storeId) { public List<RStoreUser> getUserList(@PathVariable Long storeId) {
...@@ -115,8 +114,10 @@ public class StoreController { ...@@ -115,8 +114,10 @@ public class StoreController {
@GetMapping("/store/log/{storeId}") @GetMapping("/store/log/{storeId}")
@SaCheckPermission(value = "store:log:list", orRole = "admin") @SaCheckPermission(value = "store:log:list", orRole = "admin")
public List<StoreLog> getLogList(@PathVariable Long storeId) { public Page<StoreLog> getLogList(@PathVariable Long storeId, StoreLog storeLog) {
return storeLogService.lambdaQuery().eq(StoreLog::getStoreId, storeId).list(); storeLog.setStoreId(storeId);
return storeLogService.lambdaQuery(storeLog)
.page(Page.of(storeLog.getPageNum(), storeLog.getPageSize()));
} }
@PostMapping("/store/log") @PostMapping("/store/log")
...@@ -125,6 +126,19 @@ public class StoreController { ...@@ -125,6 +126,19 @@ public class StoreController {
return storeLogService.save(storeLog) ? "新增成功" : "新增失败"; return storeLogService.save(storeLog) ? "新增成功" : "新增失败";
} }
@DeleteMapping("/store/log/{logId}")
@SaCheckPermission(value = "store:log:delete", orRole = "admin")
public String delLog(@PathVariable Long logId) {
return storeLogService.removeById(logId) ? "删除成功" : "删除失败";
}
@PostMapping("/store/log/{logId}")
@SaCheckPermission(value = "store:log:edit", orRole = "admin")
public String updateLog(@PathVariable Long logId, @RequestBody StoreLog storeLog) {
storeLog.setId(logId);
return storeLogService.updateById(storeLog) ? "更新成功" : "更新失败";
}
@GetMapping("/store/screen") @GetMapping("/store/screen")
@SaCheckPermission(value = "store:screen", orRole = "admin") @SaCheckPermission(value = "store:screen", orRole = "admin")
public List<StoreVO> storeScreen() { public List<StoreVO> storeScreen() {
......
...@@ -76,14 +76,12 @@ public class TaskController { ...@@ -76,14 +76,12 @@ public class TaskController {
@PostMapping("/task/batchIns") @PostMapping("/task/batchIns")
@SaCheckPermission(value = "task:batchIns", orRole = "admin") @SaCheckPermission(value = "task:batchIns", orRole = "admin")
// todo 未加权限
public String batchIns(@RequestBody List<TaskDTO> data) { public String batchIns(@RequestBody List<TaskDTO> data) {
return taskService.batchIns(data); return taskService.batchIns(data);
} }
@GetMapping("/task/export") @GetMapping("/task/export")
@SaCheckPermission(value = "task:export", orRole = "admin") @SaCheckPermission(value = "task:export", orRole = "admin")
// todo 未加权限
public void defaultBuild(TaskDTO data, HttpServletResponse response) { public void defaultBuild(TaskDTO data, HttpServletResponse response) {
UserVO user = (UserVO) StpUtil.getTokenSession().get("curLoginUser"); UserVO user = (UserVO) StpUtil.getTokenSession().get("curLoginUser");
data.setPageSize(9999); data.setPageSize(9999);
......
...@@ -56,7 +56,7 @@ public class UserController { ...@@ -56,7 +56,7 @@ public class UserController {
@GetMapping("/user/onlyName") @GetMapping("/user/onlyName")
@SaCheckPermission(value = "user:listName", orRole = "admin") @SaCheckPermission(value = "user:listName", orRole = "admin")
public List<UserVO> getNameList(UserDTO dto) { public List<UserVO> getNameList(UserDTO dto) {
return converter.convert(userService.list(Wrappers.lambdaQuery(converter.convert(dto, new User())).select(User::getId, User::getUsername, User::getPreWorkOrder)), UserVO.class); return converter.convert(userService.list(Wrappers.lambdaQuery(converter.convert(dto, new User())).select(User::getId, User::getUserid, User::getUsername, User::getPreWorkOrder)), UserVO.class);
} }
@GetMapping("/user") @GetMapping("/user")
......
...@@ -38,7 +38,7 @@ public class ContractRunner { ...@@ -38,7 +38,7 @@ public class ContractRunner {
private final RedisTemplate redisTemplate; private final RedisTemplate redisTemplate;
@Scheduled(cron = "0 0 * * * *") @Scheduled(cron = "0 0 * * * *")
public Boolean contractSync() { public void contractSync() {
log.info("【开始】从crm系统同步合同信息"); log.info("【开始】从crm系统同步合同信息");
Map<String, Contract> no2ContactMap = contractService.list().stream().collect(Collectors.toMap(Contract::getContractNo, Function.identity())); Map<String, Contract> no2ContactMap = contractService.list().stream().collect(Collectors.toMap(Contract::getContractNo, Function.identity()));
Map<String, Integer> contractTypeMap = dictionaryService.lambdaQuery().eq(Dictionary::getType, "contract_type").list() Map<String, Integer> contractTypeMap = dictionaryService.lambdaQuery().eq(Dictionary::getType, "contract_type").list()
...@@ -105,17 +105,19 @@ public class ContractRunner { ...@@ -105,17 +105,19 @@ public class ContractRunner {
} }
} catch (SQLException e) { } catch (SQLException e) {
log.error("合同信息同步失败:", e); log.error("合同信息同步失败:", e);
return false; return;
} }
if (CollUtil.isEmpty(insOrUpdContractList)) { if (CollUtil.isEmpty(insOrUpdContractList)) {
log.info("没有需要插入或更新的合同"); log.info("没有需要插入或更新的合同");
return true; return;
} }
insOrUpdContractList.forEach(v -> { insOrUpdContractList.forEach(v -> {
if (no2ContactMap.containsKey(v.getContractNo())) { if (no2ContactMap.containsKey(v.getContractNo())) {
v.setId(no2ContactMap.get(v.getContractNo()).getId()); v.setId(no2ContactMap.get(v.getContractNo()).getId());
// 已有合同不更新状态
v.setStatus(null);
} }
}); });
contractService.saveOrUpdateBatch(insOrUpdContractList, 500); contractService.saveOrUpdateBatch(insOrUpdContractList, 500);
...@@ -213,7 +215,6 @@ public class ContractRunner { ...@@ -213,7 +215,6 @@ public class ContractRunner {
log.info("【结束】从crm系统同步合同信息"); log.info("【结束】从crm系统同步合同信息");
redisTemplate.opsForValue().set("contract:sync:time", DateUtil.formatDateTime(insOrUpdContractList.get(0).getOriginalModTime())); redisTemplate.opsForValue().set("contract:sync:time", DateUtil.formatDateTime(insOrUpdContractList.get(0).getOriginalModTime()));
return true;
} }
@Scheduled(cron = "0 0 1 * * ?") @Scheduled(cron = "0 0 1 * * ?")
......
package vion.dto; package vion.dto;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
...@@ -10,6 +11,8 @@ import lombok.Setter; ...@@ -10,6 +11,8 @@ import lombok.Setter;
@Getter @Getter
@Setter @Setter
public class BaseDTO { public class BaseDTO {
private Integer pageNum = 1; @JsonIgnore
private Integer pageSize = 10; private transient Integer pageNum = 1;
@JsonIgnore
private transient Integer pageSize = 10;
} }
package vion.model; package vion.model;
import com.baomidou.mybatisplus.annotation.*; import com.baomidou.mybatisplus.annotation.*;
import io.github.linpeilie.annotations.AutoMapper; import io.github.linpeilie.annotations.*;
import io.github.linpeilie.annotations.AutoMappers;
import lombok.Data; import lombok.Data;
import vion.dto.ContractDTO; import vion.dto.ContractDTO;
import vion.vo.ContractVO; import vion.vo.ContractVO;
...@@ -70,12 +69,14 @@ public class Contract { ...@@ -70,12 +69,14 @@ public class Contract {
* 合同总金额 * 合同总金额
*/ */
@TableField(value = "total_amount") @TableField(value = "total_amount")
@ReverseAutoMapping(targetClass = ContractDTO.class, ignore = true)
private BigDecimal totalAmount; private BigDecimal totalAmount;
/** /**
* 合同已收金额 * 合同已收金额
*/ */
@TableField(value = "paid_amount") @TableField(value = "paid_amount")
@ReverseAutoMapping(targetClass = ContractDTO.class, ignore = true)
private BigDecimal paidAmount; private BigDecimal paidAmount;
/** /**
...@@ -83,12 +84,14 @@ public class Contract { ...@@ -83,12 +84,14 @@ public class Contract {
* 根据【合同进度】,由系统判断出应该收到的金额 * 根据【合同进度】,由系统判断出应该收到的金额
*/ */
@TableField(value = "receivable_amount") @TableField(value = "receivable_amount")
@ReverseAutoMapping(targetClass = ContractDTO.class, ignore = true)
private BigDecimal receivableAmount; private BigDecimal receivableAmount;
/** /**
* 合同未收金额:total-paid * 合同未收金额:total-paid
*/ */
@TableField(value = "outstanding_amount") @TableField(value = "outstanding_amount")
@ReverseAutoMapping(targetClass = ContractDTO.class, ignore = true)
private BigDecimal outstandingAmount; private BigDecimal outstandingAmount;
/** /**
......
...@@ -33,7 +33,7 @@ public class RContractUser extends BaseDTO { ...@@ -33,7 +33,7 @@ public class RContractUser extends BaseDTO {
* 用户id,用钉钉的userid * 用户id,用钉钉的userid
*/ */
@TableField(value = "user_id") @TableField(value = "user_id")
private Integer userId; private String userId;
/** /**
* 用户名 * 用户名
......
...@@ -3,6 +3,8 @@ package vion.model; ...@@ -3,6 +3,8 @@ package vion.model;
import com.baomidou.mybatisplus.annotation.*; import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import vion.dto.BaseDTO;
import java.util.Date; import java.util.Date;
...@@ -11,7 +13,7 @@ import java.util.Date; ...@@ -11,7 +13,7 @@ import java.util.Date;
*/ */
@Data @Data
@TableName(value = "tbl_store_log") @TableName(value = "tbl_store_log")
public class StoreLog { public class StoreLog extends BaseDTO {
@TableId(value = "id", type = IdType.AUTO) @TableId(value = "id", type = IdType.AUTO)
private Long id; private Long id;
...@@ -25,6 +27,7 @@ public class StoreLog { ...@@ -25,6 +27,7 @@ public class StoreLog {
* 日志日期 * 日志日期
*/ */
@TableField(value = "log_date") @TableField(value = "log_date")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date logDate; private Date logDate;
......
...@@ -11,6 +11,8 @@ import vion.model.Contract; ...@@ -11,6 +11,8 @@ import vion.model.Contract;
import vion.model.RContractUser; import vion.model.RContractUser;
import vion.vo.ContractVO; import vion.vo.ContractVO;
import java.util.Map;
/** /**
* @author HlQ * @author HlQ
* @date 2023/11/29 * @date 2023/11/29
...@@ -29,7 +31,7 @@ public interface IContractService extends MPJBaseService<Contract>{ ...@@ -29,7 +31,7 @@ public interface IContractService extends MPJBaseService<Contract>{
JSONObject calAmount(ContractDTO dto); JSONObject calAmount(ContractDTO dto);
Object analyze(ContractDTO dto); Map<String, Object> analyze(ContractDTO dto);
String dispatch(@RequestBody RContractTeamDTO dto); String dispatch(@RequestBody RContractTeamDTO dto);
......
...@@ -2,6 +2,7 @@ package vion.service; ...@@ -2,6 +2,7 @@ package vion.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.yulichang.base.MPJBaseService; import com.github.yulichang.base.MPJBaseService;
import org.springframework.web.bind.annotation.PathVariable;
import vion.dto.SettlementDiffDTO; import vion.dto.SettlementDiffDTO;
import vion.model.SettlementDiff; import vion.model.SettlementDiff;
import vion.vo.SettlementDiffVO; import vion.vo.SettlementDiffVO;
...@@ -20,4 +21,6 @@ public interface ISettlementDiffService extends MPJBaseService<SettlementDiff> { ...@@ -20,4 +21,6 @@ public interface ISettlementDiffService extends MPJBaseService<SettlementDiff> {
String update(Long id, SettlementDiffDTO dto); String update(Long id, SettlementDiffDTO dto);
String delById(@PathVariable Long id);
} }
...@@ -53,7 +53,7 @@ public class ContractPaymentServiceImpl extends MPJBaseServiceImpl<ContractPayme ...@@ -53,7 +53,7 @@ public class ContractPaymentServiceImpl extends MPJBaseServiceImpl<ContractPayme
BigDecimal curAmount = NumberUtil.mul(totalAmount, sumRatio); BigDecimal curAmount = NumberUtil.mul(totalAmount, sumRatio);
BigDecimal paidAmount = ObjUtil.isNull(dto.getPaidAmount()) ? existContract.getPaidAmount() : dto.getPaidAmount(); BigDecimal paidAmount = ObjUtil.isNull(dto.getPaidAmount()) ? existContract.getPaidAmount() : dto.getPaidAmount();
BigDecimal recAmount = NumberUtil.add(NumberUtil.sub(curAmount, paidAmount), diffAmount2); BigDecimal recAmount = NumberUtil.add(NumberUtil.sub(curAmount, paidAmount), diffAmount2);
BigDecimal outsideAmount = NumberUtil.add(NumberUtil.sub(totalAmount, paidAmount), NumberUtil.add(diffAmount1, diffAmount2)); BigDecimal outsideAmount = NumberUtil.sub(totalAmount, paidAmount);
dto.setReceivableAmount(recAmount); dto.setReceivableAmount(recAmount);
dto.setOutstandingAmount(outsideAmount); dto.setOutstandingAmount(outsideAmount);
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!