Showing
17 changed files
with
206 additions
and
4 deletions
| @@ -971,6 +971,7 @@ CREATE TABLE `tbl_recapitalize` ( | @@ -971,6 +971,7 @@ CREATE TABLE `tbl_recapitalize` ( | ||
| 971 | `returned_amount` decimal(15,4) DEFAULT NULL COMMENT '回笼金额', | 971 | `returned_amount` decimal(15,4) DEFAULT NULL COMMENT '回笼金额', |
| 972 | `dept_id` varchar(32) DEFAULT NULL COMMENT '办事处ID', | 972 | `dept_id` varchar(32) DEFAULT NULL COMMENT '办事处ID', |
| 973 | `factory_type` varchar(50) DEFAULT NULL COMMENT '厂别', | 973 | `factory_type` varchar(50) DEFAULT NULL COMMENT '厂别', |
| 974 | + `type` varchar(50) DEFAULT NULL COMMENT '贸易类型:外贸: OUTSIDE 内贸:INSIDE', | ||
| 974 | `create_by_id` varchar(32) NOT NULL COMMENT '创建人ID', | 975 | `create_by_id` varchar(32) NOT NULL COMMENT '创建人ID', |
| 975 | `create_by` varchar(20) NOT NULL COMMENT '创建人', | 976 | `create_by` varchar(20) NOT NULL COMMENT '创建人', |
| 976 | `update_by_id` varchar(32) NOT NULL COMMENT '更新人ID', | 977 | `update_by_id` varchar(32) NOT NULL COMMENT '更新人ID', |
| @@ -74,6 +74,12 @@ public class GetRecapitalizeBo extends BaseBo<Recapitalize> { | @@ -74,6 +74,12 @@ public class GetRecapitalizeBo extends BaseBo<Recapitalize> { | ||
| 74 | @ApiModelProperty("厂别名称") | 74 | @ApiModelProperty("厂别名称") |
| 75 | private String factoryTypeName; | 75 | private String factoryTypeName; |
| 76 | 76 | ||
| 77 | + /** | ||
| 78 | + * 贸易类型:外贸: OUTSIDE 内贸:INSIDE | ||
| 79 | + */ | ||
| 80 | + @ApiModelProperty("贸易类型") | ||
| 81 | + private String type; | ||
| 82 | + | ||
| 77 | public GetRecapitalizeBo() { | 83 | public GetRecapitalizeBo() { |
| 78 | 84 | ||
| 79 | } | 85 | } |
| @@ -74,6 +74,12 @@ public class QueryRecapitalizeBo extends BaseBo<Recapitalize> { | @@ -74,6 +74,12 @@ public class QueryRecapitalizeBo extends BaseBo<Recapitalize> { | ||
| 74 | @ApiModelProperty("厂别名称") | 74 | @ApiModelProperty("厂别名称") |
| 75 | private String factoryTypeName; | 75 | private String factoryTypeName; |
| 76 | 76 | ||
| 77 | + /** | ||
| 78 | + * 贸易类型:外贸: OUTSIDE 内贸:INSIDE | ||
| 79 | + */ | ||
| 80 | + @ApiModelProperty("贸易类型") | ||
| 81 | + private String type; | ||
| 82 | + | ||
| 77 | public QueryRecapitalizeBo() { | 83 | public QueryRecapitalizeBo() { |
| 78 | 84 | ||
| 79 | } | 85 | } |
| @@ -138,10 +138,12 @@ public class RecapitalizeController extends DefaultBaseController { | @@ -138,10 +138,12 @@ public class RecapitalizeController extends DefaultBaseController { | ||
| 138 | @HasPermission({"account-manage:recoup-funds:import"}) | 138 | @HasPermission({"account-manage:recoup-funds:import"}) |
| 139 | @PostMapping("/import") | 139 | @PostMapping("/import") |
| 140 | public InvokeResult<Void> importExcel(@NotBlank(message = "ID不能为空") String id, | 140 | public InvokeResult<Void> importExcel(@NotBlank(message = "ID不能为空") String id, |
| 141 | - @NotNull(message = "请上传文件") MultipartFile file) { | 141 | + @NotNull(message = "请上传文件") MultipartFile file, |
| 142 | + @NotBlank(message = "贸易类型不能为空") String type) { | ||
| 142 | 143 | ||
| 143 | RecapitalizeImportListener listener = new RecapitalizeImportListener(); | 144 | RecapitalizeImportListener listener = new RecapitalizeImportListener(); |
| 144 | listener.setTaskId(id); | 145 | listener.setTaskId(id); |
| 146 | + listener.setType(type); | ||
| 145 | ExcelUtil.read(file, RecapitalizeImportModel.class, listener).sheet().doRead(); | 147 | ExcelUtil.read(file, RecapitalizeImportModel.class, listener).sheet().doRead(); |
| 146 | 148 | ||
| 147 | return InvokeResultBuilder.success(); | 149 | return InvokeResultBuilder.success(); |
| @@ -67,6 +67,11 @@ public class Recapitalize extends BaseEntity implements BaseDto { | @@ -67,6 +67,11 @@ public class Recapitalize extends BaseEntity implements BaseDto { | ||
| 67 | private String factoryType; | 67 | private String factoryType; |
| 68 | 68 | ||
| 69 | /** | 69 | /** |
| 70 | + * 贸易类型:外贸: OUTSIDE 内贸:INSIDE | ||
| 71 | + */ | ||
| 72 | + private String type; | ||
| 73 | + | ||
| 74 | + /** | ||
| 70 | * 厂别名称 | 75 | * 厂别名称 |
| 71 | */ | 76 | */ |
| 72 | @TableField(exist = false) | 77 | @TableField(exist = false) |
| @@ -22,11 +22,18 @@ import java.util.List; | @@ -22,11 +22,18 @@ import java.util.List; | ||
| 22 | 22 | ||
| 23 | @Slf4j | 23 | @Slf4j |
| 24 | public class RecapitalizeImportListener extends ExcelImportListener<RecapitalizeImportModel> { | 24 | public class RecapitalizeImportListener extends ExcelImportListener<RecapitalizeImportModel> { |
| 25 | + //用于接收贸易类型 | ||
| 26 | + private String type; | ||
| 27 | + | ||
| 28 | + public void setType(String type) { | ||
| 29 | + this.type = type; | ||
| 30 | + } | ||
| 25 | 31 | ||
| 26 | @Override | 32 | @Override |
| 27 | protected void doInvoke(RecapitalizeImportModel data, AnalysisContext context) { | 33 | protected void doInvoke(RecapitalizeImportModel data, AnalysisContext context) { |
| 28 | CustomerService customerService = ApplicationUtil.getBean(CustomerService.class); | 34 | CustomerService customerService = ApplicationUtil.getBean(CustomerService.class); |
| 29 | SysDeptService sysDeptService = ApplicationUtil.getBean(SysDeptService.class); | 35 | SysDeptService sysDeptService = ApplicationUtil.getBean(SysDeptService.class); |
| 36 | + data.setType(this.type); | ||
| 30 | if (StringUtil.isBlank(data.getRecapitalizeDateStr())) { | 37 | if (StringUtil.isBlank(data.getRecapitalizeDateStr())) { |
| 31 | throw new DefaultClientException( | 38 | throw new DefaultClientException( |
| 32 | "第" + context.readRowHolder().getRowIndex() + "行“资金回笼日期”不能为空"); | 39 | "第" + context.readRowHolder().getRowIndex() + "行“资金回笼日期”不能为空"); |
| @@ -89,7 +96,7 @@ public class RecapitalizeImportListener extends ExcelImportListener<Recapitalize | @@ -89,7 +96,7 @@ public class RecapitalizeImportListener extends ExcelImportListener<Recapitalize | ||
| 89 | } else { | 96 | } else { |
| 90 | if (deptByName.size() > 1) { | 97 | if (deptByName.size() > 1) { |
| 91 | throw new DefaultClientException( | 98 | throw new DefaultClientException( |
| 92 | - "第" + context.readRowHolder().getRowIndex() + "行“办事处”存在多个同名区域"); | 99 | + "第" + context.readRowHolder().getRowIndex() + "行“办事处”存在多个同名办事处"); |
| 93 | } else { | 100 | } else { |
| 94 | SysDept sysDept = deptByName.get(0); | 101 | SysDept sysDept = deptByName.get(0); |
| 95 | data.setDeptId(sysDept.getId()); | 102 | data.setDeptId(sysDept.getId()); |
| @@ -125,6 +132,7 @@ public class RecapitalizeImportListener extends ExcelImportListener<Recapitalize | @@ -125,6 +132,7 @@ public class RecapitalizeImportListener extends ExcelImportListener<Recapitalize | ||
| 125 | vo.setReturnedAmount(data.getReturnedAmount()); | 132 | vo.setReturnedAmount(data.getReturnedAmount()); |
| 126 | vo.setDeptId(data.getDeptId()); | 133 | vo.setDeptId(data.getDeptId()); |
| 127 | vo.setFactoryType(data.getFactoryType()); | 134 | vo.setFactoryType(data.getFactoryType()); |
| 135 | + vo.setType(data.getType()); | ||
| 128 | recapitalizeService.create(vo); | 136 | recapitalizeService.create(vo); |
| 129 | this.setSuccessProcess(i); | 137 | this.setSuccessProcess(i); |
| 130 | } | 138 | } |
| @@ -80,4 +80,10 @@ public class RecapitalizeImportModel implements ExcelModel { | @@ -80,4 +80,10 @@ public class RecapitalizeImportModel implements ExcelModel { | ||
| 80 | @ExcelIgnore | 80 | @ExcelIgnore |
| 81 | private String factoryType; | 81 | private String factoryType; |
| 82 | 82 | ||
| 83 | + /** | ||
| 84 | + * 贸易类型 | ||
| 85 | + */ | ||
| 86 | + @ExcelIgnore | ||
| 87 | + private String type; | ||
| 88 | + | ||
| 83 | } | 89 | } |
| @@ -3,6 +3,8 @@ package com.lframework.xingyun.sc.impl.ledger; | @@ -3,6 +3,8 @@ package com.lframework.xingyun.sc.impl.ledger; | ||
| 3 | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | 3 | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| 4 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | 4 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| 5 | import com.github.pagehelper.PageInfo; | 5 | import com.github.pagehelper.PageInfo; |
| 6 | +import com.lframework.starter.common.utils.CollectionUtil; | ||
| 7 | +import com.lframework.starter.common.utils.StringUtil; | ||
| 6 | import com.lframework.starter.web.core.impl.BaseMpServiceImpl; | 8 | import com.lframework.starter.web.core.impl.BaseMpServiceImpl; |
| 7 | import com.lframework.starter.web.core.utils.PageResultUtil; | 9 | import com.lframework.starter.web.core.utils.PageResultUtil; |
| 8 | import com.lframework.starter.web.core.utils.OpLogUtil; | 10 | import com.lframework.starter.web.core.utils.OpLogUtil; |
| @@ -15,19 +17,38 @@ import com.lframework.starter.web.inner.components.oplog.OtherOpLogType; | @@ -15,19 +17,38 @@ import com.lframework.starter.web.inner.components.oplog.OtherOpLogType; | ||
| 15 | import com.lframework.starter.web.core.components.resp.PageResult; | 17 | import com.lframework.starter.web.core.components.resp.PageResult; |
| 16 | import com.lframework.starter.common.utils.ObjectUtil; | 18 | import com.lframework.starter.common.utils.ObjectUtil; |
| 17 | import com.lframework.starter.common.utils.Assert; | 19 | import com.lframework.starter.common.utils.Assert; |
| 20 | +import com.lframework.xingyun.basedata.entity.CustomerShort; | ||
| 21 | +import com.lframework.xingyun.basedata.service.customer.CustomerShortService; | ||
| 22 | +import com.lframework.xingyun.basedata.vo.customer.QueryCustomerShortVo; | ||
| 23 | +import com.lframework.xingyun.sc.entity.CustomerCredit; | ||
| 18 | import com.lframework.xingyun.sc.entity.Recapitalize; | 24 | import com.lframework.xingyun.sc.entity.Recapitalize; |
| 25 | +import com.lframework.xingyun.sc.entity.ReceiptLedgerInfo; | ||
| 19 | import com.lframework.xingyun.sc.mappers.RecapitalizeMapper; | 26 | import com.lframework.xingyun.sc.mappers.RecapitalizeMapper; |
| 27 | +import com.lframework.xingyun.sc.service.customer.CustomerCreditService; | ||
| 20 | import com.lframework.xingyun.sc.service.ledger.RecapitalizeService; | 28 | import com.lframework.xingyun.sc.service.ledger.RecapitalizeService; |
| 29 | +import com.lframework.xingyun.sc.service.ledger.ReceiptLedgerInfoService; | ||
| 21 | import com.lframework.xingyun.sc.vo.ledger.recapitalize.CreateRecapitalizeVo; | 30 | import com.lframework.xingyun.sc.vo.ledger.recapitalize.CreateRecapitalizeVo; |
| 22 | import com.lframework.xingyun.sc.vo.ledger.recapitalize.QueryRecapitalizeVo; | 31 | import com.lframework.xingyun.sc.vo.ledger.recapitalize.QueryRecapitalizeVo; |
| 23 | import com.lframework.xingyun.sc.vo.ledger.recapitalize.UpdateRecapitalizeVo; | 32 | import com.lframework.xingyun.sc.vo.ledger.recapitalize.UpdateRecapitalizeVo; |
| 33 | +import com.lframework.xingyun.sc.vo.ledger.receipt.CreateReceiptLedgerInfoVo; | ||
| 34 | +import com.lframework.xingyun.sc.vo.ledger.receipt.QueryReceiptLedgerInfoVo; | ||
| 35 | +import com.lframework.xingyun.sc.vo.ledger.receipt.UpdateReceiptLedgerInfoVo; | ||
| 24 | import org.springframework.transaction.annotation.Transactional; | 36 | import org.springframework.transaction.annotation.Transactional; |
| 25 | import org.springframework.stereotype.Service; | 37 | import org.springframework.stereotype.Service; |
| 26 | - | 38 | +import javax.annotation.Resource; |
| 39 | +import java.math.BigDecimal; | ||
| 40 | +import java.util.Comparator; | ||
| 27 | import java.util.List; | 41 | import java.util.List; |
| 42 | +import java.util.stream.Collectors; | ||
| 28 | 43 | ||
| 29 | @Service | 44 | @Service |
| 30 | public class RecapitalizeServiceImpl extends BaseMpServiceImpl<RecapitalizeMapper, Recapitalize> implements RecapitalizeService { | 45 | public class RecapitalizeServiceImpl extends BaseMpServiceImpl<RecapitalizeMapper, Recapitalize> implements RecapitalizeService { |
| 46 | + @Resource | ||
| 47 | + private ReceiptLedgerInfoService receiptLedgerInfoService; | ||
| 48 | + @Resource | ||
| 49 | + private CustomerShortService customerShortService; | ||
| 50 | + @Resource | ||
| 51 | + private CustomerCreditService customerCreditService; | ||
| 31 | 52 | ||
| 32 | @Override | 53 | @Override |
| 33 | public PageResult<Recapitalize> query(Integer pageIndex, Integer pageSize, QueryRecapitalizeVo vo) { | 54 | public PageResult<Recapitalize> query(Integer pageIndex, Integer pageSize, QueryRecapitalizeVo vo) { |
| @@ -65,9 +86,71 @@ public class RecapitalizeServiceImpl extends BaseMpServiceImpl<RecapitalizeMappe | @@ -65,9 +86,71 @@ public class RecapitalizeServiceImpl extends BaseMpServiceImpl<RecapitalizeMappe | ||
| 65 | data.setReturnedAmount(vo.getReturnedAmount()); | 86 | data.setReturnedAmount(vo.getReturnedAmount()); |
| 66 | data.setDeptId(vo.getDeptId()); | 87 | data.setDeptId(vo.getDeptId()); |
| 67 | data.setFactoryType(vo.getFactoryType()); | 88 | data.setFactoryType(vo.getFactoryType()); |
| 89 | + data.setType(vo.getType()); | ||
| 68 | 90 | ||
| 69 | getBaseMapper().insert(data); | 91 | getBaseMapper().insert(data); |
| 70 | - //todo fys 需要对台账处理 | 92 | + //订货单位、厂别、办事处、贸易类型匹配台账数据 |
| 93 | + QueryReceiptLedgerInfoVo vo1 = new QueryReceiptLedgerInfoVo(); | ||
| 94 | + vo1.setCustomerId(vo.getOrderingUnit()); | ||
| 95 | + vo1.setFactoryType(vo.getFactoryType()); | ||
| 96 | + vo1.setDeptId(vo.getDeptId()); | ||
| 97 | + vo1.setType(vo.getType()); | ||
| 98 | + List<ReceiptLedgerInfo> query = receiptLedgerInfoService.query(vo1); | ||
| 99 | + if (CollectionUtil.isNotEmpty(query)) { | ||
| 100 | + //不为空代表有欠款-需要平账 | ||
| 101 | + //期初应收款=回笼资金 有多条占用天数多的先平账 | ||
| 102 | + List<ReceiptLedgerInfo> result = query.stream() | ||
| 103 | + // 1. 过滤:startAccountReceivable 等于 returnedAmount | ||
| 104 | + .filter(item -> { | ||
| 105 | + BigDecimal start = item.getStartAccountReceivable(); | ||
| 106 | + return start != null | ||
| 107 | + && vo.getReturnedAmount() != null | ||
| 108 | + && start.compareTo(vo.getReturnedAmount()) == 0; | ||
| 109 | + }) | ||
| 110 | + // 2. 排序:按 shipmentDate 升序(早的在前) | ||
| 111 | + .sorted(Comparator.comparing(ReceiptLedgerInfo::getShipmentDate)) | ||
| 112 | + .collect(Collectors.toList()); | ||
| 113 | + if (CollectionUtil.isNotEmpty(result)) { | ||
| 114 | + //平账 | ||
| 115 | + UpdateReceiptLedgerInfoVo updateVo = new UpdateReceiptLedgerInfoVo(); | ||
| 116 | + updateVo.setReturnedAmount(vo.getReturnedAmount()); | ||
| 117 | + updateVo.setActualReturnedDate(vo.getRecapitalizeDate()); | ||
| 118 | + updateVo.setEndAccountReceivable(BigDecimal.ZERO); | ||
| 119 | + updateVo.setId(result.get(0).getId()); | ||
| 120 | + receiptLedgerInfoService.reconciliation(updateVo); | ||
| 121 | + } else { | ||
| 122 | + throw new DefaultClientException("没有匹配的台账明细数据!"); | ||
| 123 | + } | ||
| 124 | + } else { | ||
| 125 | + //为空保存为存款 | ||
| 126 | + CreateReceiptLedgerInfoVo createVo = new CreateReceiptLedgerInfoVo(); | ||
| 127 | + QueryCustomerShortVo vo2 = new QueryCustomerShortVo(); | ||
| 128 | + vo2.setCustomerId(vo.getOrderingUnit()); | ||
| 129 | + List<CustomerShort> customerShortList = customerShortService.query(vo2); | ||
| 130 | + if (CollectionUtil.isNotEmpty(customerShortList)) { | ||
| 131 | + createVo.setCustomerShortId(customerShortList.get(0).getId()); | ||
| 132 | + } | ||
| 133 | + CustomerCredit customerCredit = customerCreditService.getByCustomerId(vo.getOrderingUnit()); | ||
| 134 | + if (customerCredit != null) { | ||
| 135 | + //额度 | ||
| 136 | + if (StringUtil.isNotEmpty(customerCredit.getCompanyCreditLimit())) { | ||
| 137 | + createVo.setQuota(new BigDecimal(customerCredit.getCompanyCreditLimit())); | ||
| 138 | + } | ||
| 139 | + //结算期限 | ||
| 140 | + if (StringUtil.isNotEmpty(customerCredit.getCompanySettlementPeriod())) { | ||
| 141 | + createVo.setSettleTerm(customerCredit.getCompanySettlementPeriod()); | ||
| 142 | + } | ||
| 143 | + } | ||
| 144 | + createVo.setDeptId(vo.getDeptId()); | ||
| 145 | + createVo.setCustomerId(vo.getOrderingUnit()); | ||
| 146 | + createVo.setFactoryType(vo.getFactoryType()); | ||
| 147 | + createVo.setFactoryType(vo.getFactoryType()); | ||
| 148 | + createVo.setActualReturnedDate(vo.getRecapitalizeDate()); | ||
| 149 | + createVo.setReturnedAmount(vo.getReturnedAmount()); | ||
| 150 | + createVo.setEndAccountReceivable(vo.getReturnedAmount().negate()); | ||
| 151 | + createVo.setDebtStatus("DEPOSIT"); | ||
| 152 | + receiptLedgerInfoService.create(createVo); | ||
| 153 | + } | ||
| 71 | 154 | ||
| 72 | OpLogUtil.setVariable("id", data.getId()); | 155 | OpLogUtil.setVariable("id", data.getId()); |
| 73 | OpLogUtil.setExtra(vo); | 156 | OpLogUtil.setExtra(vo); |
| @@ -151,6 +151,7 @@ public class ReceiptLedgerInfoServiceImpl extends BaseMpServiceImpl<ReceiptLedge | @@ -151,6 +151,7 @@ public class ReceiptLedgerInfoServiceImpl extends BaseMpServiceImpl<ReceiptLedge | ||
| 151 | data.setFourthCoordinateDate(vo.getFourthCoordinateDate()); | 151 | data.setFourthCoordinateDate(vo.getFourthCoordinateDate()); |
| 152 | data.setFifthCoordinateDate(vo.getFifthCoordinateDate()); | 152 | data.setFifthCoordinateDate(vo.getFifthCoordinateDate()); |
| 153 | data.setDescription(vo.getDescription()); | 153 | data.setDescription(vo.getDescription()); |
| 154 | + data.setDebtStatus(vo.getDebtStatus()); | ||
| 154 | getBaseMapper().insert(data); | 155 | getBaseMapper().insert(data); |
| 155 | 156 | ||
| 156 | OpLogUtil.setVariable("id", data.getId()); | 157 | OpLogUtil.setVariable("id", data.getId()); |
| @@ -587,4 +588,24 @@ public class ReceiptLedgerInfoServiceImpl extends BaseMpServiceImpl<ReceiptLedge | @@ -587,4 +588,24 @@ public class ReceiptLedgerInfoServiceImpl extends BaseMpServiceImpl<ReceiptLedge | ||
| 587 | OpLogUtil.setVariable("id", data.getId()); | 588 | OpLogUtil.setVariable("id", data.getId()); |
| 588 | OpLogUtil.setExtra(data.getId()); | 589 | OpLogUtil.setExtra(data.getId()); |
| 589 | } | 590 | } |
| 591 | + | ||
| 592 | + @OpLog(type = OtherOpLogType.class, name = "平账,ID:{}", params = {"#id"}) | ||
| 593 | + @Transactional(rollbackFor = Exception.class) | ||
| 594 | + @Override | ||
| 595 | + public void reconciliation(UpdateReceiptLedgerInfoVo vo) { | ||
| 596 | + ReceiptLedgerInfo data = getBaseMapper().selectById(vo.getId()); | ||
| 597 | + if (ObjectUtil.isNull(data)) { | ||
| 598 | + throw new DefaultClientException("应收款台账明细不存在!"); | ||
| 599 | + } | ||
| 600 | + LambdaUpdateWrapper<ReceiptLedgerInfo> updateWrapper = Wrappers.lambdaUpdate(ReceiptLedgerInfo.class) | ||
| 601 | + .set(ReceiptLedgerInfo::getActualReturnedDate, vo.getActualReturnedDate() == null ? null : vo.getActualReturnedDate()) | ||
| 602 | + .set(ReceiptLedgerInfo::getReturnedAmount, vo.getReturnedAmount() == null ? null : vo.getReturnedAmount()) | ||
| 603 | + .set(ReceiptLedgerInfo::getEndAccountReceivable, vo.getEndAccountReceivable() == null ? null : vo.getEndAccountReceivable()) | ||
| 604 | + .set(ReceiptLedgerInfo::getDebtStatus, "SETTLE_UP") | ||
| 605 | + .eq(ReceiptLedgerInfo::getId, vo.getId()); | ||
| 606 | + | ||
| 607 | + getBaseMapper().update(updateWrapper); | ||
| 608 | + OpLogUtil.setVariable("id", data.getId()); | ||
| 609 | + OpLogUtil.setExtra(vo); | ||
| 610 | + } | ||
| 590 | } | 611 | } |
| @@ -105,4 +105,11 @@ public interface ReceiptLedgerInfoService extends BaseMpService<ReceiptLedgerInf | @@ -105,4 +105,11 @@ public interface ReceiptLedgerInfoService extends BaseMpService<ReceiptLedgerInf | ||
| 105 | * @param debtStatus 清欠状态 | 105 | * @param debtStatus 清欠状态 |
| 106 | */ | 106 | */ |
| 107 | void updateCoordinateDate(String id, LocalDate coordinateDate, String debtStatus); | 107 | void updateCoordinateDate(String id, LocalDate coordinateDate, String debtStatus); |
| 108 | + | ||
| 109 | + /** | ||
| 110 | + * 平账 | ||
| 111 | + * | ||
| 112 | + * @param vo 数据 | ||
| 113 | + */ | ||
| 114 | + void reconciliation(UpdateReceiptLedgerInfoVo vo); | ||
| 108 | } | 115 | } |
| @@ -59,4 +59,10 @@ public class CreateRecapitalizeVo implements BaseVo, Serializable { | @@ -59,4 +59,10 @@ public class CreateRecapitalizeVo implements BaseVo, Serializable { | ||
| 59 | @Length(message = "厂别最多允许50个字符!") | 59 | @Length(message = "厂别最多允许50个字符!") |
| 60 | private String factoryType; | 60 | private String factoryType; |
| 61 | 61 | ||
| 62 | + /** | ||
| 63 | + * 贸易类型:外贸: OUTSIDE 内贸:INSIDE | ||
| 64 | + */ | ||
| 65 | + @ApiModelProperty("贸易类型") | ||
| 66 | + private String type; | ||
| 67 | + | ||
| 62 | } | 68 | } |
| @@ -47,4 +47,10 @@ public class QueryRecapitalizeVo extends PageVo implements BaseVo, Serializable | @@ -47,4 +47,10 @@ public class QueryRecapitalizeVo extends PageVo implements BaseVo, Serializable | ||
| 47 | @ApiModelProperty("厂别") | 47 | @ApiModelProperty("厂别") |
| 48 | private String factoryType; | 48 | private String factoryType; |
| 49 | 49 | ||
| 50 | + /** | ||
| 51 | + * 贸易类型:外贸: OUTSIDE 内贸:INSIDE | ||
| 52 | + */ | ||
| 53 | + @ApiModelProperty("贸易类型") | ||
| 54 | + private String type; | ||
| 55 | + | ||
| 50 | } | 56 | } |
| @@ -215,4 +215,7 @@ public class CreateReceiptLedgerInfoVo implements BaseVo, Serializable { | @@ -215,4 +215,7 @@ public class CreateReceiptLedgerInfoVo implements BaseVo, Serializable { | ||
| 215 | @ApiModelProperty("是否拆分") | 215 | @ApiModelProperty("是否拆分") |
| 216 | private boolean spilt; | 216 | private boolean spilt; |
| 217 | 217 | ||
| 218 | + @ApiModelProperty("欠款状态") | ||
| 219 | + private String debtStatus; | ||
| 220 | + | ||
| 218 | } | 221 | } |
| @@ -81,4 +81,10 @@ public class QueryReceiptLedgerInfoVo extends PageVo implements BaseVo, Serializ | @@ -81,4 +81,10 @@ public class QueryReceiptLedgerInfoVo extends PageVo implements BaseVo, Serializ | ||
| 81 | @ApiModelProperty("年份") | 81 | @ApiModelProperty("年份") |
| 82 | private Integer createYear; | 82 | private Integer createYear; |
| 83 | 83 | ||
| 84 | + /** | ||
| 85 | + * 厂别 | ||
| 86 | + */ | ||
| 87 | + @ApiModelProperty("厂别") | ||
| 88 | + private String factoryType; | ||
| 89 | + | ||
| 84 | } | 90 | } |
| 1 | package com.lframework.xingyun.sc.vo.ledger.receipt; | 1 | package com.lframework.xingyun.sc.vo.ledger.receipt; |
| 2 | 2 | ||
| 3 | +import com.lframework.starter.web.core.components.validation.IsNumberPrecision; | ||
| 3 | import lombok.Data; | 4 | import lombok.Data; |
| 4 | import javax.validation.constraints.NotBlank; | 5 | import javax.validation.constraints.NotBlank; |
| 6 | +import java.math.BigDecimal; | ||
| 5 | import java.time.LocalDate; | 7 | import java.time.LocalDate; |
| 6 | import com.lframework.starter.web.core.vo.BaseVo; | 8 | import com.lframework.starter.web.core.vo.BaseVo; |
| 7 | import javax.validation.constraints.NotNull; | 9 | import javax.validation.constraints.NotNull; |
| @@ -46,4 +48,30 @@ public class UpdateReceiptLedgerInfoVo implements BaseVo, Serializable { | @@ -46,4 +48,30 @@ public class UpdateReceiptLedgerInfoVo implements BaseVo, Serializable { | ||
| 46 | @Length(message = "说明最多允许200个字符!") | 48 | @Length(message = "说明最多允许200个字符!") |
| 47 | private String description; | 49 | private String description; |
| 48 | 50 | ||
| 51 | + /** | ||
| 52 | + * 实际回笼日期 | ||
| 53 | + */ | ||
| 54 | + @ApiModelProperty(value = "实际回笼日期", required = true) | ||
| 55 | + @NotNull(message = "请输入实际回笼日期!") | ||
| 56 | + @TypeMismatch(message = "实际回笼日期格式有误!") | ||
| 57 | + private LocalDate actualReturnedDate; | ||
| 58 | + | ||
| 59 | + /** | ||
| 60 | + * 回笼金额 | ||
| 61 | + */ | ||
| 62 | + @ApiModelProperty(value = "回笼金额", required = true) | ||
| 63 | + @NotNull(message = "请输入回笼金额!") | ||
| 64 | + @TypeMismatch(message = "回笼金额格式有误!") | ||
| 65 | + @IsNumberPrecision(message = "回笼金额最多允许4位小数!", value = 4) | ||
| 66 | + private BigDecimal returnedAmount; | ||
| 67 | + | ||
| 68 | + /** | ||
| 69 | + * 期末应收账款 | ||
| 70 | + */ | ||
| 71 | + @ApiModelProperty(value = "期末应收账款", required = true) | ||
| 72 | + @NotNull(message = "请输入期末应收账款!") | ||
| 73 | + @TypeMismatch(message = "期末应收账款格式有误!") | ||
| 74 | + @IsNumberPrecision(message = "期末应收账款最多允许4位小数!", value = 4) | ||
| 75 | + private BigDecimal endAccountReceivable; | ||
| 76 | + | ||
| 49 | } | 77 | } |
| @@ -11,6 +11,7 @@ | @@ -11,6 +11,7 @@ | ||
| 11 | <result column="dept_id" property="deptId"/> | 11 | <result column="dept_id" property="deptId"/> |
| 12 | <result column="dept_name" property="deptName"/> | 12 | <result column="dept_name" property="deptName"/> |
| 13 | <result column="factory_type" property="factoryType"/> | 13 | <result column="factory_type" property="factoryType"/> |
| 14 | + <result column="type" property="type"/> | ||
| 14 | <result column="create_by_id" property="createById"/> | 15 | <result column="create_by_id" property="createById"/> |
| 15 | <result column="create_by" property="createBy"/> | 16 | <result column="create_by" property="createBy"/> |
| 16 | <result column="update_by_id" property="updateById"/> | 17 | <result column="update_by_id" property="updateById"/> |
| @@ -29,6 +30,7 @@ | @@ -29,6 +30,7 @@ | ||
| 29 | tb.dept_id, | 30 | tb.dept_id, |
| 30 | d.name AS dept_name, | 31 | d.name AS dept_name, |
| 31 | tb.factory_type, | 32 | tb.factory_type, |
| 33 | + tb.type, | ||
| 32 | tb.create_by_id, | 34 | tb.create_by_id, |
| 33 | tb.create_by, | 35 | tb.create_by, |
| 34 | tb.update_by_id, | 36 | tb.update_by_id, |
| @@ -66,6 +68,9 @@ | @@ -66,6 +68,9 @@ | ||
| 66 | <if test="vo.factoryType != null and vo.factoryType != ''"> | 68 | <if test="vo.factoryType != null and vo.factoryType != ''"> |
| 67 | AND tb.factory_type = #{vo.factoryType} | 69 | AND tb.factory_type = #{vo.factoryType} |
| 68 | </if> | 70 | </if> |
| 71 | + <if test="vo.type != null and vo.type != ''"> | ||
| 72 | + AND tb.type = #{vo.type} | ||
| 73 | + </if> | ||
| 69 | </where> | 74 | </where> |
| 70 | ORDER BY tb.create_time DESC | 75 | ORDER BY tb.create_time DESC |
| 71 | </select> | 76 | </select> |
| @@ -101,6 +101,9 @@ | @@ -101,6 +101,9 @@ | ||
| 101 | <if test="vo.type != null and vo.type != ''"> | 101 | <if test="vo.type != null and vo.type != ''"> |
| 102 | AND tb.type = #{vo.type} | 102 | AND tb.type = #{vo.type} |
| 103 | </if> | 103 | </if> |
| 104 | + <if test="vo.factoryType != null and vo.factoryType != ''"> | ||
| 105 | + AND tb.factory_type = #{vo.factoryType} | ||
| 106 | + </if> | ||
| 104 | <if test="vo.customerShortId != null and vo.customerShortId != ''"> | 107 | <if test="vo.customerShortId != null and vo.customerShortId != ''"> |
| 105 | AND tb.customer_short_id = #{vo.customerShortId} | 108 | AND tb.customer_short_id = #{vo.customerShortId} |
| 106 | </if> | 109 | </if> |