|
@@ -476,33 +476,7 @@ public class ReportServiceImpl implements ReportService {
|
|
public String payMoney(ReportDTO reportDTO, Long companyId, Long adminId) throws Exception {
|
|
public String payMoney(ReportDTO reportDTO, Long companyId, Long adminId) throws Exception {
|
|
Date now = new Date();
|
|
Date now = new Date();
|
|
List<ReportDTO> list = reportDTO.getList();
|
|
List<ReportDTO> list = reportDTO.getList();
|
|
- if (list.size() > 0) {
|
|
|
|
- ReportDTO tmp = list.get(0);
|
|
|
|
- Wrapper wrapper = new EntityWrapper();
|
|
|
|
- wrapper.eq("contract_no", tmp.getContractNo());
|
|
|
|
- List<PayDO> payDOS = payMapper.selectList(wrapper);
|
|
|
|
- if (payDOS.size() > 0) {
|
|
|
|
- PayDO payDO = payDOS.get(0);
|
|
|
|
- payDO.setAlreadyPay(payDO.getAlreadyPay() + reportDTO.getPayMoney());
|
|
|
|
- payDO.setNotPay(payDO.getNotPay() - reportDTO.getPayMoney());
|
|
|
|
- if (payMapper.updateById(payDO) > 0) {
|
|
|
|
- } else {
|
|
|
|
- throw new AdminServiceException(ExceptionDefinition.ADMIN_UNKNOWN_EXCEPTION);
|
|
|
|
- }
|
|
|
|
- PayDetailDO payDetailDO = new PayDetailDO();
|
|
|
|
- payDetailDO.setPayNo(payDO.getPayNo());
|
|
|
|
- payDetailDO.setPayMoney(reportDTO.getPayMoney());
|
|
|
|
- payDetailDO.setPayImg(reportDTO.getPayImg());
|
|
|
|
- payDetailDO.setPayDate(sdf.parse(reportDTO.getPayDateStr()));
|
|
|
|
- payDetailDO.setGmtUpdate(now);
|
|
|
|
- payDetailDO.setGmtCreate(now);
|
|
|
|
- payDetailDO.setCompanyId(companyId);
|
|
|
|
- payDetailDO.setAdminId(adminId);
|
|
|
|
- payDetailMapper.insert(payDetailDO);
|
|
|
|
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
Float money = reportDTO.getPayMoney();
|
|
Float money = reportDTO.getPayMoney();
|
|
for (int i = 0; i < list.size(); i++) {
|
|
for (int i = 0; i < list.size(); i++) {
|
|
ReportDTO tmp = list.get(i);
|
|
ReportDTO tmp = list.get(i);
|
|
@@ -529,7 +503,7 @@ public class ReportServiceImpl implements ReportService {
|
|
if (buyReportMapper.updateById(buyReportDO) > 0) {
|
|
if (buyReportMapper.updateById(buyReportDO) > 0) {
|
|
List<TradeDO> tradeDOList = tradeMapper.selectList(new EntityWrapper<TradeDO>().eq("trade_contract_no", buyReportDO.getContractNo()));
|
|
List<TradeDO> tradeDOList = tradeMapper.selectList(new EntityWrapper<TradeDO>().eq("trade_contract_no", buyReportDO.getContractNo()));
|
|
if (CollectionUtils.isNotEmpty(tradeDOList)) {
|
|
if (CollectionUtils.isNotEmpty(tradeDOList)) {
|
|
- Map<String, Object> map = new HashMap<>();
|
|
|
|
|
|
+// Map<String, Object> map = new HashMap<>();
|
|
// map.put("value", buyReportDO.getContractNo());
|
|
// map.put("value", buyReportDO.getContractNo());
|
|
// map.put("valueOne", buyReportDO.getMoney());
|
|
// map.put("valueOne", buyReportDO.getMoney());
|
|
// map.put("page", "pages/user/task");
|
|
// map.put("page", "pages/user/task");
|
|
@@ -538,30 +512,15 @@ public class ReportServiceImpl implements ReportService {
|
|
// map.put("header", "您好,您的合同已打款,请注意查收!");
|
|
// map.put("header", "您好,您的合同已打款,请注意查收!");
|
|
// map.put("remark", "点击进入小程序完成任务");
|
|
// map.put("remark", "点击进入小程序完成任务");
|
|
// sendUtils.sendMessageForDeliver(map);
|
|
// sendUtils.sendMessageForDeliver(map);
|
|
- map = new HashMap<>();
|
|
|
|
- map.put("value", reportDTO.getPayMoney());
|
|
|
|
- map.put("valueOne", sdf.format(new Date()));
|
|
|
|
- map.put("url", reportDTO.getPayImg());
|
|
|
|
- map.put("templateId", "3NM7ujI5vuJSdYlHJAPcYiacrg2YvuyT1Y7BZf9qeNc");
|
|
|
|
- map.put("userId", 21);
|
|
|
|
- map.put("header", "您有新的收款,请及时查收");
|
|
|
|
- map.put("remark", "点击查看凭证");
|
|
|
|
- sendUtils.sendMessageForPay(map);
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
} else {
|
|
} else {
|
|
throw new AdminServiceException(ExceptionDefinition.ADMIN_UNKNOWN_EXCEPTION);
|
|
throw new AdminServiceException(ExceptionDefinition.ADMIN_UNKNOWN_EXCEPTION);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
- return "ok";
|
|
|
|
- }
|
|
|
|
- @Override
|
|
|
|
- @Transactional(rollbackFor = Exception.class)
|
|
|
|
- public String payMoneySale(ReportDTO reportDTO, Long companyId, Long adminId) throws Exception {
|
|
|
|
- Date now = new Date();
|
|
|
|
- List<ReportDTO> list = reportDTO.getList();
|
|
|
|
if (list.size() > 0) {
|
|
if (list.size() > 0) {
|
|
|
|
+
|
|
ReportDTO tmp = list.get(0);
|
|
ReportDTO tmp = list.get(0);
|
|
Wrapper wrapper = new EntityWrapper();
|
|
Wrapper wrapper = new EntityWrapper();
|
|
wrapper.eq("contract_no", tmp.getContractNo());
|
|
wrapper.eq("contract_no", tmp.getContractNo());
|
|
@@ -584,10 +543,27 @@ public class ReportServiceImpl implements ReportService {
|
|
payDetailDO.setCompanyId(companyId);
|
|
payDetailDO.setCompanyId(companyId);
|
|
payDetailDO.setAdminId(adminId);
|
|
payDetailDO.setAdminId(adminId);
|
|
payDetailMapper.insert(payDetailDO);
|
|
payDetailMapper.insert(payDetailDO);
|
|
-
|
|
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
|
+ map.put("value", reportDTO.getPayMoney());
|
|
|
|
+ map.put("valueOne", sdf.format(new Date()));
|
|
|
|
+ map.put("url", reportDTO.getPayImg());
|
|
|
|
+ map.put("templateId", "3NM7ujI5vuJSdYlHJAPcYiacrg2YvuyT1Y7BZf9qeNc");
|
|
|
|
+ map.put("userId", 21);
|
|
|
|
+ map.put("header", "您有新的收款,请及时查收");
|
|
|
|
+ map.put("remark", "点击查看凭证");
|
|
|
|
+ sendUtils.sendMessageForPay(map);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ return "ok";
|
|
|
|
+ }
|
|
|
|
+ @Override
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
|
+ public String payMoneySale(ReportDTO reportDTO, Long companyId, Long adminId) throws Exception {
|
|
|
|
+ Date now = new Date();
|
|
|
|
+ List<ReportDTO> list = reportDTO.getList();
|
|
|
|
+
|
|
Float money = reportDTO.getPayMoney();
|
|
Float money = reportDTO.getPayMoney();
|
|
for (int i = 0; i < list.size(); i++) {
|
|
for (int i = 0; i < list.size(); i++) {
|
|
ReportDTO tmp = list.get(i);
|
|
ReportDTO tmp = list.get(i);
|
|
@@ -614,7 +590,7 @@ public class ReportServiceImpl implements ReportService {
|
|
if (saleReportMapper.updateById(saleReportDO) > 0) {
|
|
if (saleReportMapper.updateById(saleReportDO) > 0) {
|
|
List<TradeDO> tradeDOList = tradeMapper.selectList(new EntityWrapper<TradeDO>().eq("trade_contract_no", saleReportDO.getContractNo()));
|
|
List<TradeDO> tradeDOList = tradeMapper.selectList(new EntityWrapper<TradeDO>().eq("trade_contract_no", saleReportDO.getContractNo()));
|
|
if (CollectionUtils.isNotEmpty(tradeDOList)) {
|
|
if (CollectionUtils.isNotEmpty(tradeDOList)) {
|
|
- Map<String, Object> map = new HashMap<>();
|
|
|
|
|
|
+// Map<String, Object> map = new HashMap<>();
|
|
// map.put("value", saleReportDO.getContractNo());
|
|
// map.put("value", saleReportDO.getContractNo());
|
|
// map.put("valueOne", saleReportDO.getMoney());
|
|
// map.put("valueOne", saleReportDO.getMoney());
|
|
// map.put("page", "pages/user/task");
|
|
// map.put("page", "pages/user/task");
|
|
@@ -623,22 +599,48 @@ public class ReportServiceImpl implements ReportService {
|
|
// map.put("header", "您好,您的合同已打款,请注意查收!");
|
|
// map.put("header", "您好,您的合同已打款,请注意查收!");
|
|
// map.put("remark", "点击进入小程序完成任务");
|
|
// map.put("remark", "点击进入小程序完成任务");
|
|
// sendUtils.sendMessageForDeliver(map);
|
|
// sendUtils.sendMessageForDeliver(map);
|
|
- map = new HashMap<>();
|
|
|
|
- map.put("value", reportDTO.getPayMoney());
|
|
|
|
- map.put("valueOne", sdf.format(new Date()));
|
|
|
|
- map.put("url", reportDTO.getPayImg());
|
|
|
|
- map.put("templateId", "3NM7ujI5vuJSdYlHJAPcYiacrg2YvuyT1Y7BZf9qeNc");
|
|
|
|
- map.put("userId", 21);
|
|
|
|
- map.put("header", "您有新的收款,请及时查收");
|
|
|
|
- map.put("remark", "点击查看凭证");
|
|
|
|
- sendUtils.sendMessageForPay(map);
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
} else {
|
|
} else {
|
|
throw new AdminServiceException(ExceptionDefinition.ADMIN_UNKNOWN_EXCEPTION);
|
|
throw new AdminServiceException(ExceptionDefinition.ADMIN_UNKNOWN_EXCEPTION);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ if (list.size() > 0) {
|
|
|
|
+ ReportDTO tmp = list.get(0);
|
|
|
|
+ Wrapper wrapper = new EntityWrapper();
|
|
|
|
+ wrapper.eq("contract_no", tmp.getContractNo());
|
|
|
|
+ List<PayDO> payDOS = payMapper.selectList(wrapper);
|
|
|
|
+ if (payDOS.size() > 0) {
|
|
|
|
+ PayDO payDO = payDOS.get(0);
|
|
|
|
+ payDO.setAlreadyPay(payDO.getAlreadyPay() + reportDTO.getPayMoney());
|
|
|
|
+ payDO.setNotPay(payDO.getNotPay() - reportDTO.getPayMoney());
|
|
|
|
+ if (payMapper.updateById(payDO) > 0) {
|
|
|
|
+ } else {
|
|
|
|
+ throw new AdminServiceException(ExceptionDefinition.ADMIN_UNKNOWN_EXCEPTION);
|
|
|
|
+ }
|
|
|
|
+ PayDetailDO payDetailDO = new PayDetailDO();
|
|
|
|
+ payDetailDO.setPayNo(payDO.getPayNo());
|
|
|
|
+ payDetailDO.setPayMoney(reportDTO.getPayMoney());
|
|
|
|
+ payDetailDO.setPayImg(reportDTO.getPayImg());
|
|
|
|
+ payDetailDO.setPayDate(sdf.parse(reportDTO.getPayDateStr()));
|
|
|
|
+ payDetailDO.setGmtUpdate(now);
|
|
|
|
+ payDetailDO.setGmtCreate(now);
|
|
|
|
+ payDetailDO.setCompanyId(companyId);
|
|
|
|
+ payDetailDO.setAdminId(adminId);
|
|
|
|
+ payDetailMapper.insert(payDetailDO);
|
|
|
|
+ }
|
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
|
+ map = new HashMap<>();
|
|
|
|
+ map.put("value", reportDTO.getPayMoney());
|
|
|
|
+ map.put("valueOne", sdf.format(new Date()));
|
|
|
|
+ map.put("url", reportDTO.getPayImg());
|
|
|
|
+ map.put("templateId", "3NM7ujI5vuJSdYlHJAPcYiacrg2YvuyT1Y7BZf9qeNc");
|
|
|
|
+ map.put("userId", 21);
|
|
|
|
+ map.put("header", "您有新的收款,请及时查收");
|
|
|
|
+ map.put("remark", "点击查看凭证");
|
|
|
|
+ sendUtils.sendMessageForPay(map);
|
|
|
|
+ }
|
|
return "ok";
|
|
return "ok";
|
|
}
|
|
}
|
|
@Override
|
|
@Override
|