|
@@ -3,11 +3,10 @@ package com.gree.mall.manager.logic.settle.repair;
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.gree.mall.manager.bean.admin.AdminUserCom;
|
|
|
-import com.gree.mall.manager.bean.settle.repair.DailyImportSummaryItemVO;
|
|
|
-import com.gree.mall.manager.bean.settle.repair.DailyImportSummaryVO;
|
|
|
-import com.gree.mall.manager.bean.settle.repair.DailyTotalCostBean;
|
|
|
+import com.gree.mall.manager.bean.settle.repair.*;
|
|
|
import com.gree.mall.manager.commonmapper.CommonMapper;
|
|
|
import com.gree.mall.manager.commonmapper.DailyMapper;
|
|
|
import com.gree.mall.manager.constant.Constant;
|
|
@@ -54,6 +53,7 @@ public class DailyImportSummaryLogic {
|
|
|
private final SettleDailyWithholdService settleDailyWithholdService;
|
|
|
private final SettleDailyResidualInsuranceService settleDailyResidualInsuranceService;
|
|
|
private final SettleDailyRemaineBuckleService settleDailyRemaineBuckleService;
|
|
|
+ private final SettleDailyIncrDecrCostService settleDailyIncrDecrCostService;
|
|
|
|
|
|
|
|
|
public IPage<DailyImportSummaryVO> page(ZfireParamBean zfireParamBean) {
|
|
@@ -189,6 +189,8 @@ public class DailyImportSummaryLogic {
|
|
|
bean.setCreateTime(new Date());
|
|
|
bean.setWebsitName(row.get(46));
|
|
|
bean.setWebsitNumber(row.get(44));
|
|
|
+ bean.setCompanyWechatId(adminUser.getAdminCompanyWechat().getCompanyWechatId());
|
|
|
+ bean.setCompanyWechatName(adminUser.getAdminCompanyWechat().getCompanyName());
|
|
|
if (StringUtils.isNotBlank(row.get(51))) {
|
|
|
bean.setSettlementTime(new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss").parse(row.get(51)));
|
|
|
}
|
|
@@ -214,7 +216,7 @@ public class DailyImportSummaryLogic {
|
|
|
}
|
|
|
if (("reduce").equals(type)) {
|
|
|
settleDailyReduceCostService.saveBatch(reduceList);
|
|
|
- dailyMapper.bindWorkerNumber2(batchNo);
|
|
|
+ dailyMapper.bindWorkerNumber2(adminUser.getAdminCompanyWechat().getCompanyWechatId(), batchNo);
|
|
|
//判断是否有匹配失败的师傅编号的
|
|
|
List<SettleDailyReduceCost> list = settleDailyReduceCostService.lambdaQuery()
|
|
|
.eq(SettleDailyReduceCost::getWorkerNumber, "")
|
|
@@ -226,7 +228,7 @@ public class DailyImportSummaryLogic {
|
|
|
//判断是否存在导入重复的工单号
|
|
|
} else {
|
|
|
settleDailyImportSummaryItemService.saveBatch(summaryItemList);
|
|
|
- dailyMapper.bindWorkerNumber(batchNo);
|
|
|
+ dailyMapper.bindWorkerNumber(adminUser.getAdminCompanyWechat().getCompanyWechatId(), batchNo);
|
|
|
//判断是否有匹配失败的师傅编号的
|
|
|
List<SettleDailyImportSummaryItem> list = settleDailyImportSummaryItemService.lambdaQuery()
|
|
|
.eq(SettleDailyImportSummaryItem::getWorkerNumber, "")
|
|
@@ -236,7 +238,7 @@ public class DailyImportSummaryLogic {
|
|
|
if (list.size() > 0)
|
|
|
throw new RemoteServiceException("姓名:" + list.get(0).getRepairName() + ",派工序号:" + list.get(0).getDispatchOrderNo() + "找不到对应的师傅编号");
|
|
|
//判断是否存在导入重复的工单号
|
|
|
- List<String> errList = dailyMapper.queryDistinctOrderNo();
|
|
|
+ List<String> errList = dailyMapper.queryDistinctOrderNo(adminUser.getAdminCompanyWechat().getCompanyWechatId());
|
|
|
if (!CollectionUtils.isEmpty(errList)) {
|
|
|
errorData = errorData.append(StringUtils.join(errList, ","));
|
|
|
}
|
|
@@ -298,7 +300,7 @@ public class DailyImportSummaryLogic {
|
|
|
}
|
|
|
settleDailyIssueSummaryRecordService.lambdaUpdate().eq(SettleDailyIssueSummaryRecord::getSummaryBatchNo, summaryBatchNo).remove();
|
|
|
//查询统计数据
|
|
|
- List<DailyTotalCostBean> costBeans = dailyMapper.queryDailyTotalCost(importBatchNo, DailyConstant.SUMMARY_STATUS_CAN_DO, DailyConstant.SUMMARY_STATUS_ARRAY);
|
|
|
+ List<DailyTotalCostBean> costBeans = dailyMapper.queryDailyTotalCost(adminUser.getAdminCompanyWechat().getCompanyWechatId(), importBatchNo, DailyConstant.SUMMARY_STATUS_CAN_DO, DailyConstant.SUMMARY_STATUS_ARRAY);
|
|
|
|
|
|
String nowMonth = DateUtil.format(new Date(), "yyyyMM");
|
|
|
List<SettleDailyIssueSummaryRecord> issueList = new ArrayList<>();
|
|
@@ -370,6 +372,8 @@ public class DailyImportSummaryLogic {
|
|
|
issue.setWithholdCost(BigDecimal.valueOf(0));
|
|
|
issue.setIssueCost(totalFee);
|
|
|
issue.setInstall(install);
|
|
|
+ issue.setCompanyWechatId(adminUser.getAdminCompanyWechat().getCompanyWechatId());
|
|
|
+ issue.setCompanyWechatName(adminUser.getAdminCompanyWechat().getCompanyName());
|
|
|
|
|
|
if (install == null || !install) {
|
|
|
//暂扣金额
|
|
@@ -402,6 +406,8 @@ public class DailyImportSummaryLogic {
|
|
|
importSummaryItem.setSummaryStatus(DailyConstant.SUMMARY_STATUS_HAS);
|
|
|
importSummaryItem.setSummaryBatchNo(summaryBatchNo);
|
|
|
importSummaryItem.setMonth(nowMonth);
|
|
|
+ importSummaryItem.setCompanyWechatId(adminUser.getAdminCompanyWechat().getCompanyWechatId());
|
|
|
+ importSummaryItem.setCompanyWechatName(adminUser.getAdminCompanyWechat().getCompanyName());
|
|
|
if (issueSummaryRecord.getServiceNumber().equals(importSummaryItem.getWorkerNumber())
|
|
|
&& issueSummaryRecord.getSummaryNumber().equals(importSummaryItem.getSummaryNumber())) {
|
|
|
importSummaryItem.setIssueSalaryId(issueSummaryRecord.getId());
|
|
@@ -436,6 +442,8 @@ public class DailyImportSummaryLogic {
|
|
|
insurance.setCreateTime(new Date());
|
|
|
insurance.setCreateBy(opName);
|
|
|
insurance.setSummaryBatchNo(summaryBatchNo);
|
|
|
+ insurance.setCompanyWechatId(adminUser.getAdminCompanyWechat().getCompanyWechatId());
|
|
|
+ insurance.setCompanyWechatName(adminUser.getAdminCompanyWechat().getCompanyName());
|
|
|
insurance.insert();
|
|
|
|
|
|
for (SettleDailyWithhold withhold : withholds) {
|
|
@@ -499,7 +507,7 @@ public class DailyImportSummaryLogic {
|
|
|
/**
|
|
|
* 处理历史费用
|
|
|
*
|
|
|
- * @param issue 汇总数据
|
|
|
+ * @param issue 汇总数据
|
|
|
* @param adminUser
|
|
|
*/
|
|
|
@Transactional
|
|
@@ -690,17 +698,17 @@ public class DailyImportSummaryLogic {
|
|
|
|
|
|
Integer count = settleDailyImportSummaryItemService.lambdaQuery()
|
|
|
.eq(SettleDailyImportSummaryItem::getCompanyWechatId, adminUser.getCompanyWechatId())
|
|
|
- .in(SettleDailyImportSummaryItem::getId,ids)
|
|
|
- .eq(SettleDailyImportSummaryItem::getSummaryStatus,DailyConstant.SUMMARY_STATUS_HAS)
|
|
|
+ .in(SettleDailyImportSummaryItem::getId, ids)
|
|
|
+ .eq(SettleDailyImportSummaryItem::getSummaryStatus, DailyConstant.SUMMARY_STATUS_HAS)
|
|
|
.count();
|
|
|
- if(count > 0){
|
|
|
+ if (count > 0) {
|
|
|
throw new RemoteServiceException("存在已汇总的数据,无法删除");
|
|
|
}
|
|
|
|
|
|
settleDailyImportSummaryItemService.lambdaUpdate()
|
|
|
.eq(SettleDailyImportSummaryItem::getCompanyWechatId, adminUser.getCompanyWechatId())
|
|
|
- .in(SettleDailyImportSummaryItem::getId,ids)
|
|
|
- .in(SettleDailyImportSummaryItem::getSummaryStatus,DailyConstant.SUMMARY_STATUS_CAN_DEL)
|
|
|
+ .in(SettleDailyImportSummaryItem::getId, ids)
|
|
|
+ .in(SettleDailyImportSummaryItem::getSummaryStatus, DailyConstant.SUMMARY_STATUS_CAN_DEL)
|
|
|
.remove();
|
|
|
}
|
|
|
|
|
@@ -712,9 +720,9 @@ public class DailyImportSummaryLogic {
|
|
|
}
|
|
|
|
|
|
settleDailyImportSummaryItemService.lambdaUpdate()
|
|
|
- .set(SettleDailyImportSummaryItem::getSummaryStatus,DailyConstant.SUMMARY_STATUS_WAIT)
|
|
|
- .in(SettleDailyImportSummaryItem::getSummaryStatus,DailyConstant.SUMMARY_STATUS_CAN_DO)
|
|
|
- .in(SettleDailyImportSummaryItem::getId,ids)
|
|
|
+ .set(SettleDailyImportSummaryItem::getSummaryStatus, DailyConstant.SUMMARY_STATUS_WAIT)
|
|
|
+ .in(SettleDailyImportSummaryItem::getSummaryStatus, DailyConstant.SUMMARY_STATUS_CAN_DO)
|
|
|
+ .in(SettleDailyImportSummaryItem::getId, ids)
|
|
|
.update();
|
|
|
}
|
|
|
|
|
@@ -726,9 +734,266 @@ public class DailyImportSummaryLogic {
|
|
|
}
|
|
|
|
|
|
settleDailyImportSummaryItemService.lambdaUpdate()
|
|
|
- .set(SettleDailyImportSummaryItem::getSummaryStatus,DailyConstant.SUMMARY_STATUS_NOT)
|
|
|
- .eq(SettleDailyImportSummaryItem::getSummaryStatus,DailyConstant.SUMMARY_STATUS_WAIT)
|
|
|
- .in(SettleDailyImportSummaryItem::getId,ids)
|
|
|
+ .set(SettleDailyImportSummaryItem::getSummaryStatus, DailyConstant.SUMMARY_STATUS_NOT)
|
|
|
+ .eq(SettleDailyImportSummaryItem::getSummaryStatus, DailyConstant.SUMMARY_STATUS_WAIT)
|
|
|
+ .in(SettleDailyImportSummaryItem::getId, ids)
|
|
|
.update();
|
|
|
}
|
|
|
+
|
|
|
+ public IPage<DailyIncrDecrCostCountVO> reduceCountPage(ZfireParamBean zfireParamBean) {
|
|
|
+ AdminUserCom adminUser = commonLogic.getAdminUser();
|
|
|
+ FieldUtils.supplyParam(zfireParamBean, DailyIncrDecrCostCountVO.class, adminUser);
|
|
|
+
|
|
|
+ return commonMapper.reduceCountList(new Page(zfireParamBean.getPageNum(), zfireParamBean.getPageSize()), zfireParamBean);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Transactional
|
|
|
+ public void reduceCountDel(String importBatchNo) {
|
|
|
+ AdminUserCom adminUser = commonLogic.getAdminUser();
|
|
|
+
|
|
|
+ if (adminUser.getType() == 2) {
|
|
|
+ throw new RemoteServiceException("平台账号禁止操作");
|
|
|
+ }
|
|
|
+
|
|
|
+ Integer count = settleDailyIncrDecrCostService.lambdaQuery()
|
|
|
+ .eq(SettleDailyIncrDecrCost::getCompanyWechatId, adminUser.getAdminCompanyWechat().getCompanyWechatId())
|
|
|
+ .eq(SettleDailyIncrDecrCost::getImportBatchNo, importBatchNo)
|
|
|
+ .eq(SettleDailyIncrDecrCost::getDoStatus, DailyConstant.DO_STATUS_HAS)
|
|
|
+ .count();
|
|
|
+ if (count > 0) {
|
|
|
+ throw new RemoteServiceException("该批次已执行,无法删除。");
|
|
|
+ }
|
|
|
+ settleDailyIncrDecrCostService.lambdaUpdate()
|
|
|
+ .eq(SettleDailyIncrDecrCost::getCompanyWechatId, adminUser.getAdminCompanyWechat().getCompanyWechatId())
|
|
|
+ .eq(SettleDailyIncrDecrCost::getImportBatchNo, importBatchNo)
|
|
|
+ .eq(SettleDailyIncrDecrCost::getDoStatus, DailyConstant.DO_STATUS_NOT)
|
|
|
+ .remove();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 批量执行 -增减费用数据
|
|
|
+ */
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public void reduceCountDo(String importBatchNo) {
|
|
|
+ AdminUserCom adminUser = commonLogic.getAdminUser();
|
|
|
+
|
|
|
+ if (adminUser.getType() == 2) {
|
|
|
+ throw new RemoteServiceException("平台账号禁止操作");
|
|
|
+ }
|
|
|
+
|
|
|
+ String opName = adminUser.getNickName();
|
|
|
+ String doBatchNo = commonLogic.generateNo("JZ", "reduceBatchNo", 13);
|
|
|
+ String nowMonth = DateUtil.format(new Date(), "yyyyMM");
|
|
|
+ List<DailyIncrDecrCostCountBean> beans = dailyMapper.queryIncrDecrByBatch(adminUser.getAdminCompanyWechat().getCompanyWechatId(), importBatchNo, DailyConstant.DO_STATUS_NOT);
|
|
|
+ if (beans.size() == 0) {
|
|
|
+ throw new RemoteServiceException("没有可扣减的数据");
|
|
|
+ }
|
|
|
+ List<SettleDailyIssueSummaryRecord> records = new ArrayList<>();
|
|
|
+ List<String> serviceNumberList = new ArrayList<>();
|
|
|
+ List<String> websiteNumberList = new ArrayList<>();
|
|
|
+ for (DailyIncrDecrCostCountBean bean : beans) {
|
|
|
+ SettleDailyIssueSummaryRecord issueRecord = settleDailyIssueSummaryRecordService
|
|
|
+ .getOne(Wrappers.<SettleDailyIssueSummaryRecord>lambdaQuery()
|
|
|
+ .eq(SettleDailyIssueSummaryRecord::getCompanyWechatId, adminUser.getAdminCompanyWechat().getCompanyWechatId())
|
|
|
+ .eq(SettleDailyIssueSummaryRecord::getStatus, DailyConstant.ISSUE_STATUS_NOT)
|
|
|
+ .eq(SettleDailyIssueSummaryRecord::getServiceNumber, bean.getServiceNumber())
|
|
|
+ .eq(SettleDailyIssueSummaryRecord::getWebsitNumber, bean.getWebsitNumber())
|
|
|
+ .orderByDesc(SettleDailyIssueSummaryRecord::getIssueCost)
|
|
|
+ .last("limit 1"));
|
|
|
+ if (issueRecord != null) {
|
|
|
+ BigDecimal incrDecrCost = new BigDecimal(0);
|
|
|
+ if (issueRecord.getIncrDecrCost() != null) {
|
|
|
+ incrDecrCost = incrDecrCost.add(issueRecord.getIncrDecrCost());
|
|
|
+ }
|
|
|
+ incrDecrCost = incrDecrCost.add(bean.getTotalAmount());
|
|
|
+ BigDecimal issueCost = issueRecord.getIssueCost().add(incrDecrCost);
|
|
|
+ issueRecord.setIncrDecrCost(incrDecrCost);
|
|
|
+ issueRecord.setIssueCost(issueCost);
|
|
|
+ issueRecord.setUpdateBy(opName);
|
|
|
+ issueRecord.setUpdateTime(new Date());
|
|
|
+ if (issueCost.doubleValue() < 0) {
|
|
|
+ //设置为0
|
|
|
+ issueCost = BigDecimal.valueOf(0);
|
|
|
+ issueRecord.setIssueCost(issueCost);
|
|
|
+ BigDecimal extra = BigDecimal.valueOf(0).subtract(issueCost);
|
|
|
+ saveRemaineBuckle(extra, DictCodeEnum.INCR_DECR_DAILY.toString(), bean.getServiceNumber(),
|
|
|
+ Constant.DAILY_PREFIX + issueRecord.getSummaryNumber(), bean.getWebsitName(), bean.getWebsitNumber(), opName);
|
|
|
+ }
|
|
|
+ records.add(issueRecord);
|
|
|
+ serviceNumberList.add(bean.getServiceNumber());
|
|
|
+ websiteNumberList.add(bean.getWebsitNumber());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (records.size() == 0) {
|
|
|
+ throw new RemoteServiceException("暂无可扣回费用");
|
|
|
+ }
|
|
|
+ settleDailyIssueSummaryRecordService.updateBatchById(records);
|
|
|
+ //修改增减费用执行记录
|
|
|
+ settleDailyIncrDecrCostService.lambdaUpdate()
|
|
|
+ .set(SettleDailyIncrDecrCost::getDoTime, new Date())
|
|
|
+ .set(SettleDailyIncrDecrCost::getDoBy, opName)
|
|
|
+ .set(SettleDailyIncrDecrCost::getDoStatus, DailyConstant.DO_STATUS_HAS)
|
|
|
+ .set(SettleDailyIncrDecrCost::getUpdateBy, opName)
|
|
|
+ .set(SettleDailyIncrDecrCost::getUpdateTime, new Date())
|
|
|
+ .set(SettleDailyIncrDecrCost::getDoBatchNo, doBatchNo)
|
|
|
+ .set(SettleDailyIncrDecrCost::getReduceMonth, nowMonth)
|
|
|
+ .eq(SettleDailyIncrDecrCost::getCompanyWechatId, adminUser.getAdminCompanyWechat().getCompanyWechatId())
|
|
|
+ .eq(SettleDailyIncrDecrCost::getImportBatchNo, importBatchNo)
|
|
|
+ .eq(SettleDailyIncrDecrCost::getDoStatus, DailyConstant.DO_STATUS_NOT)
|
|
|
+ .in(SettleDailyIncrDecrCost::getWebsitNumber, websiteNumberList)
|
|
|
+ .in(SettleDailyIncrDecrCost::getServiceNumber, serviceNumberList)
|
|
|
+ .update();
|
|
|
+ }
|
|
|
+
|
|
|
+ public void saveRemaineBuckle(BigDecimal buckle, String type, String workerNumber,
|
|
|
+ String summaryBatchNo, String websiteName, String websiteNumber, String opName) {
|
|
|
+ AdminUserCom adminUser = commonLogic.getAdminUser();
|
|
|
+
|
|
|
+ if (adminUser.getType() == 2) {
|
|
|
+ throw new RemoteServiceException("平台账号禁止操作");
|
|
|
+ }
|
|
|
+
|
|
|
+ SettleDailyRemaineBuckle bean = new SettleDailyRemaineBuckle();
|
|
|
+ bean.setCostType(type);
|
|
|
+ bean.setBuckleAmount(buckle);
|
|
|
+ bean.setIsBuckle(false);
|
|
|
+ bean.setWorkerNumber(workerNumber);
|
|
|
+ bean.setSummaryBatchNo(summaryBatchNo);
|
|
|
+ bean.setCreateBy(opName);
|
|
|
+ bean.setCreateTime(new Date());
|
|
|
+ bean.setWebsitName(websiteName);
|
|
|
+ bean.setWebsitNumber(websiteNumber);
|
|
|
+ bean.setCompanyWechatId(adminUser.getAdminCompanyWechat().getCompanyWechatId());
|
|
|
+ bean.setCompanyWechatName(adminUser.getAdminCompanyWechat().getCompanyName());
|
|
|
+ bean.insert();
|
|
|
+ }
|
|
|
+
|
|
|
+ public void reduceBatchDo(List<Integer> ids) {
|
|
|
+ AdminUserCom adminUser = commonLogic.getAdminUser();
|
|
|
+
|
|
|
+ if (adminUser.getType() == 2) {
|
|
|
+ throw new RemoteServiceException("平台账号禁止操作");
|
|
|
+ }
|
|
|
+
|
|
|
+ Integer count = settleDailyIncrDecrCostService.lambdaQuery()
|
|
|
+ .eq(SettleDailyIncrDecrCost::getCompanyWechatId, adminUser.getAdminCompanyWechat().getCompanyWechatId())
|
|
|
+ .in(SettleDailyIncrDecrCost::getId, ids)
|
|
|
+ .eq(SettleDailyIncrDecrCost::getDoStatus, DailyConstant.DO_STATUS_HAS)
|
|
|
+ .count();
|
|
|
+ if (count > 0) {
|
|
|
+ throw new RemoteServiceException("存在已执行的数据,请重新选择.");
|
|
|
+ }
|
|
|
+
|
|
|
+ String opName = adminUser.getNickName();
|
|
|
+ settleDailyIncrDecrCostService.lambdaUpdate()
|
|
|
+ .set(SettleDailyIncrDecrCost::getDoStatus, DailyConstant.DO_STATUS_HAS)
|
|
|
+ .set(SettleDailyIncrDecrCost::getDoTime, new Date())
|
|
|
+ .set(SettleDailyIncrDecrCost::getDoBy, opName)
|
|
|
+ .eq(SettleDailyIncrDecrCost::getCompanyWechatId, adminUser.getAdminCompanyWechat().getCompanyWechatId())
|
|
|
+ .in(SettleDailyIncrDecrCost::getId, ids)
|
|
|
+ .eq(SettleDailyIncrDecrCost::getDoStatus, DailyConstant.DO_STATUS_NOT).update();
|
|
|
+ }
|
|
|
+
|
|
|
+ @Transactional
|
|
|
+ public void reduceBatchDel(List<Integer> ids) {
|
|
|
+ AdminUserCom adminUser = commonLogic.getAdminUser();
|
|
|
+
|
|
|
+ if (adminUser.getType() == 2) {
|
|
|
+ throw new RemoteServiceException("平台账号禁止操作");
|
|
|
+ }
|
|
|
+
|
|
|
+ Integer count = settleDailyIncrDecrCostService.lambdaQuery()
|
|
|
+ .eq(SettleDailyIncrDecrCost::getCompanyWechatId, adminUser.getAdminCompanyWechat().getCompanyWechatId())
|
|
|
+ .in(SettleDailyIncrDecrCost::getId, ids)
|
|
|
+ .eq(SettleDailyIncrDecrCost::getDoStatus, DailyConstant.DO_STATUS_HAS)
|
|
|
+ .count();
|
|
|
+ if (count > 0) {
|
|
|
+ throw new RemoteServiceException("存在已执行的数据,请重新选择.");
|
|
|
+ }
|
|
|
+ settleDailyIncrDecrCostService.lambdaUpdate()
|
|
|
+ .eq(SettleDailyIncrDecrCost::getCompanyWechatId, adminUser.getAdminCompanyWechat().getCompanyWechatId())
|
|
|
+ .in(SettleDailyIncrDecrCost::getId, ids)
|
|
|
+ .eq(SettleDailyIncrDecrCost::getDoStatus, DailyConstant.DO_STATUS_NOT).remove();
|
|
|
+ }
|
|
|
+
|
|
|
+ @Transactional
|
|
|
+ public void reduceUpdate(SettleDailyIncrDecrCost cost) {
|
|
|
+ AdminUserCom adminUser = commonLogic.getAdminUser();
|
|
|
+
|
|
|
+ if (adminUser.getType() == 2) {
|
|
|
+ throw new RemoteServiceException("平台账号禁止操作");
|
|
|
+ }
|
|
|
+
|
|
|
+ SettleDailyIncrDecrCost queryCost = settleDailyIncrDecrCostService.getById(cost.getId());
|
|
|
+ if (queryCost == null) {
|
|
|
+ throw new RemoteServiceException("当前数据不存在.");
|
|
|
+ }
|
|
|
+ if (queryCost.getDoStatus() != null && queryCost.getDoStatus() == 1) {
|
|
|
+ throw new RemoteServiceException("已经执行无法编编辑.");
|
|
|
+ }
|
|
|
+ queryCost.setCostAmount(cost.getCostAmount());
|
|
|
+ queryCost.updateById();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 导入增减费用数据
|
|
|
+ *
|
|
|
+ * @param importBatchNo
|
|
|
+ * @param datas
|
|
|
+ * @param request
|
|
|
+ * @return
|
|
|
+ * @throws Exception
|
|
|
+ */
|
|
|
+ @Transactional
|
|
|
+ public void importIncrDecrCost(String importBatchNo, List<Object> datas, HttpServletRequest request) throws Exception {
|
|
|
+ AdminUserCom adminUser = commonLogic.getAdminUser();
|
|
|
+
|
|
|
+ if (adminUser.getType() == 2) {
|
|
|
+ throw new RemoteServiceException("平台账号禁止操作");
|
|
|
+ }
|
|
|
+ String opName = adminUser.getNickName();
|
|
|
+ log.info("【导入增减费用】:{}", DateUtils.formatDate(new Date()));
|
|
|
+ List<SettleDailyIncrDecrCost> incrDecrCostList = new ArrayList<>();
|
|
|
+ //传入批次号删除数据
|
|
|
+ if (importBatchNo != null) {
|
|
|
+ settleDailyIncrDecrCostService.lambdaUpdate()
|
|
|
+ .eq(SettleDailyIncrDecrCost::getImportBatchNo, importBatchNo)
|
|
|
+ .remove();
|
|
|
+ }
|
|
|
+
|
|
|
+ String batchNo = commonLogic.generateNo("JM", "IncrDecr", 11);
|
|
|
+ for (int i = 0; i < datas.size(); i++) {
|
|
|
+ List<String> row = (List<String>) datas.get(i);
|
|
|
+ SettleDailyIncrDecrCost bean = new SettleDailyIncrDecrCost();
|
|
|
+ bean.setImportBatchNo(batchNo);
|
|
|
+ bean.setServiceName(row.get(1));
|
|
|
+ bean.setServiceNumber(row.get(2));
|
|
|
+ bean.setWebsitNumber(row.get(3));
|
|
|
+ bean.setWebsitName(row.get(4));
|
|
|
+ bean.setSummaryNumber(row.get(5));
|
|
|
+ bean.setSummaryName(row.get(6));
|
|
|
+ bean.setIdCard(row.get(7));
|
|
|
+ bean.setMobile(row.get(8));
|
|
|
+ bean.setCostType(row.get(9));
|
|
|
+ if (null != row.get(10)) {
|
|
|
+ bean.setCostAmount(new BigDecimal(row.get(10)));
|
|
|
+ }
|
|
|
+ bean.setRemark(row.get(11));
|
|
|
+ bean.setReduceMonth(row.get(12));
|
|
|
+ bean.setDoStatus(DailyConstant.DO_STATUS_NOT);
|
|
|
+ bean.setImportBy(opName);
|
|
|
+ bean.setImportTime(new Date());
|
|
|
+ bean.setCompanyWechatId(adminUser.getAdminCompanyWechat().getCompanyWechatId());
|
|
|
+ bean.setCompanyWechatName(adminUser.getAdminCompanyWechat().getCompanyName());
|
|
|
+ incrDecrCostList.add(bean);
|
|
|
+ }
|
|
|
+ settleDailyIncrDecrCostService.saveBatch(incrDecrCostList);
|
|
|
+ }
|
|
|
+
|
|
|
+ public IPage<DailyIncrDecrCostVO> incrDecrCostList(ZfireParamBean zfireParamBean) {
|
|
|
+ AdminUserCom adminUser = commonLogic.getAdminUser();
|
|
|
+ FieldUtils.supplyParam(zfireParamBean, DailyIncrDecrCostVO.class, adminUser);
|
|
|
+
|
|
|
+ return commonMapper.repairSettleDailyincrDecrCostList(new Page(zfireParamBean.getPageNum(), zfireParamBean.getPageSize()), zfireParamBean);
|
|
|
+ }
|
|
|
}
|