|
@@ -5,18 +5,18 @@ import com.bz.smart_city.commom.model.AjaxMessage;
|
|
|
import com.bz.smart_city.commom.model.Pagination;
|
|
|
import com.bz.smart_city.commom.model.ResultStatus;
|
|
|
import com.bz.smart_city.commom.util.*;
|
|
|
-import com.bz.smart_city.dao.CustomerMapper;
|
|
|
import com.bz.smart_city.dao.SiteMapper;
|
|
|
import com.bz.smart_city.dao.pay.*;
|
|
|
import com.bz.smart_city.dao.pay.archives.PayBaseCustomerandmeterrelaMapper;
|
|
|
-import com.bz.smart_city.dto.CustomerDto;
|
|
|
import com.bz.smart_city.dto.LoginUser;
|
|
|
import com.bz.smart_city.dto.pay.*;
|
|
|
import com.bz.smart_city.dto.pay.DeviceReplaceRecordDto;
|
|
|
+import com.bz.smart_city.dto.pay.payfee.PayValveStateInfo;
|
|
|
import com.bz.smart_city.entity.ProgramItem;
|
|
|
import com.bz.smart_city.entity.pay.*;
|
|
|
import com.bz.smart_city.entity.pay.archives.PayBaseCustomerandmeterrela;
|
|
|
import com.bz.smart_city.service.pay.AmountWaterUsedAmountService;
|
|
|
+import com.bz.smart_city.service.pay.PayFeeService;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -66,7 +66,7 @@ public class AmountWaterUsedAmountServiceImpl implements AmountWaterUsedAmountSe
|
|
|
@Resource
|
|
|
private PayTransactiondetailsMapper payTransactiondetailsMapper;
|
|
|
@Autowired
|
|
|
- private PayFeeServiceImp payFeeServiceImp;
|
|
|
+ private PayFeeService payFeeService;
|
|
|
@Resource
|
|
|
private PaySysDictMapper paySysDictMapper;
|
|
|
@Resource
|
|
@@ -162,7 +162,7 @@ public class AmountWaterUsedAmountServiceImpl implements AmountWaterUsedAmountSe
|
|
|
ajaxMessage.setMsg(-725,"水量审核条数为0");
|
|
|
return ajaxMessage;
|
|
|
}
|
|
|
- List<String> idList =new ArrayList<>();
|
|
|
+ List<BigInteger> idList =new ArrayList<>();
|
|
|
if(review ==1){
|
|
|
year = baseClosingAccountInfoDto.getYear();
|
|
|
month = baseClosingAccountInfoDto.getMonth();
|
|
@@ -171,8 +171,12 @@ public class AmountWaterUsedAmountServiceImpl implements AmountWaterUsedAmountSe
|
|
|
idList = amountWaterUsedAmountMapper.getIds(condition,loginUser.getCustomerId(),null,null,null,null,
|
|
|
1,amountMin,amountMax,year,month,programItems,loginUser.getSiteId());
|
|
|
}else{
|
|
|
- if(ids!=null)
|
|
|
- idList = Arrays.asList(ids.split(","));
|
|
|
+ if(ids!=null) {
|
|
|
+ String[] idArr = ids.split(",");
|
|
|
+ for(String id : idArr){
|
|
|
+ idList.add(new BigInteger(id));
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if(idList.size()>0) {
|
|
@@ -211,7 +215,32 @@ public class AmountWaterUsedAmountServiceImpl implements AmountWaterUsedAmountSe
|
|
|
(defultNum>0?(",审核失败数:"+defultNum):""));
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ if(idList.size()>0){
|
|
|
+ List<PayControlRule> payControlRules = payFeeMapper.getValveRulesByType(2);
|
|
|
+ for(int i=0;2000*i<idList.size();i++){
|
|
|
+ if(2000*i+2000<idList.size()){
|
|
|
+ List<PayValveStateInfo> PayValveStateInfos = payFeeMapper.getDeviceValveStateByAmount(idList.subList(2000*i,2000*i+2000));
|
|
|
+ for(PayValveStateInfo payValveStateInfo :PayValveStateInfos){
|
|
|
+ for(PayControlRule payControlRule :payControlRules){
|
|
|
+ if(payValveStateInfo.getDebt() != null && payControlRule.checkCondition(payValveStateInfo.getDebt())){
|
|
|
+ payValveStateInfo.setOperation(payControlRule.getAction());
|
|
|
+ payFeeService.sendValveCommond(payValveStateInfo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ List<PayValveStateInfo> PayValveStateInfos = payFeeMapper.getDeviceValveStateByAmount(idList.subList(2000*i,idList.size()));
|
|
|
+ for(PayValveStateInfo payValveStateInfo :PayValveStateInfos){
|
|
|
+ for(PayControlRule payControlRule :payControlRules){
|
|
|
+ if(payValveStateInfo.getDebt() != null && payControlRule.checkCondition(payValveStateInfo.getDebt())){
|
|
|
+ payValveStateInfo.setOperation(payControlRule.getAction());
|
|
|
+ payFeeService.sendValveCommond(payValveStateInfo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
return ajaxMessage;
|
|
|
}
|
|
|
|
|
@@ -229,7 +258,7 @@ public class AmountWaterUsedAmountServiceImpl implements AmountWaterUsedAmountSe
|
|
|
month = baseClosingAccountInfoDto.getMonth();
|
|
|
//List<ProgramItem> programItems = UserUtil.getAllSiteProgramItems(loginUser);
|
|
|
List<ProgramItem> programItems= UserUtil.getCurrentSiteProgramItems(loginUser);
|
|
|
- List<String> idList = amountWaterUsedAmountMapper.getIds(condition, loginUser.getCustomerId(), null, null, null, null,
|
|
|
+ List<BigInteger> idList = amountWaterUsedAmountMapper.getIds(condition, loginUser.getCustomerId(), null, null, null, null,
|
|
|
1, amountMin, amountMax, year, month, programItems, loginUser.getSiteId());
|
|
|
result = idList.size();
|
|
|
}
|
|
@@ -246,11 +275,11 @@ public class AmountWaterUsedAmountServiceImpl implements AmountWaterUsedAmountSe
|
|
|
* @param id 主键
|
|
|
*/
|
|
|
@Transactional
|
|
|
- public AjaxMessage reviewWaterUsedAmount(String id,Integer year,Integer month,LoginUser loginUser ){
|
|
|
+ public AjaxMessage reviewWaterUsedAmount(BigInteger id,Integer year,Integer month,LoginUser loginUser ){
|
|
|
|
|
|
try {
|
|
|
AjaxMessage ajaxMessage = new AjaxMessage(ResultStatus.OK);
|
|
|
- AmountWaterUsedAmount amountWaterUsedAmount = amountWaterUsedAmountMapper.get(new BigInteger(id),loginUser.getCustomerId(),loginUser.getSiteId());
|
|
|
+ AmountWaterUsedAmount amountWaterUsedAmount = amountWaterUsedAmountMapper.get(id,loginUser.getCustomerId(),loginUser.getSiteId());
|
|
|
if (amountWaterUsedAmount != null && amountWaterUsedAmount.getState() == 1) {
|
|
|
BigDecimal amount = amountWaterUsedAmount.getPayamount();
|
|
|
Integer yearAmount = amountWaterUsedAmount.getYear();
|
|
@@ -549,7 +578,7 @@ public class AmountWaterUsedAmountServiceImpl implements AmountWaterUsedAmountSe
|
|
|
payReceivable.setUpdateBy(BigInteger.valueOf(userId));
|
|
|
payFeeMapper.updatePayReceivable(payReceivable);
|
|
|
//生成并保存实收
|
|
|
- PayPayReceived payPayReceived = payFeeServiceImp.getReceived(payReceivable, year, month, localDateTime, payway, payseriesno, receivedamount, feetypeMap, siteId, customerId, userId);
|
|
|
+ PayPayReceived payPayReceived = payFeeService.getReceived(payReceivable, year, month, localDateTime, payway, payseriesno, receivedamount, feetypeMap, siteId, customerId, userId);
|
|
|
//生成交易明细
|
|
|
PayTransactiondetails payTransactiondetails = this.getPayTransactiondetails(5, localDateTime, amountWaterUsedAmount, payseriesno, month, year, receivedamount, siteId, customerId, userId);
|
|
|
payTransactiondetails.setReceivedId(payPayReceived.getId());
|
|
@@ -635,12 +664,12 @@ public class AmountWaterUsedAmountServiceImpl implements AmountWaterUsedAmountSe
|
|
|
//水量审核
|
|
|
class reviewAllById implements Callable<Integer> {
|
|
|
|
|
|
- private String id;
|
|
|
+ private BigInteger id;
|
|
|
|
|
|
private Integer year;
|
|
|
private Integer month;
|
|
|
private LoginUser loginuser;
|
|
|
- public reviewAllById(String id,Integer year,Integer month,LoginUser loginuser){
|
|
|
+ public reviewAllById(BigInteger id,Integer year,Integer month,LoginUser loginuser){
|
|
|
this.id=id;
|
|
|
this.year =year;
|
|
|
this.month = month;
|