|
@@ -9,15 +9,14 @@ import com.bz.smart_city.commom.util.MessageSend.SMSClient;
|
|
|
import com.bz.smart_city.commom.util.MessageSend.SendReq;
|
|
|
import com.bz.smart_city.commom.util.UserUtil;
|
|
|
import com.bz.smart_city.dao.pay.BaseClosingAccountInfoMapper;
|
|
|
+import com.bz.smart_city.dao.pay.PayFeeMapper;
|
|
|
import com.bz.smart_city.dao.pay.PayMessagesendrecordMapper;
|
|
|
import com.bz.smart_city.dao.pay.PayMessagetemplateMapper;
|
|
|
import com.bz.smart_city.dto.LoginUser;
|
|
|
-import com.bz.smart_city.dto.pay.BaseClosingAccountInfoDto;
|
|
|
-import com.bz.smart_city.dto.pay.PayDebtMessageDto;
|
|
|
-import com.bz.smart_city.dto.pay.PayMessageTemplateDto;
|
|
|
-import com.bz.smart_city.dto.pay.PayMessagesendrecordDto;
|
|
|
+import com.bz.smart_city.dto.pay.*;
|
|
|
import com.bz.smart_city.entity.ProgramItem;
|
|
|
import com.bz.smart_city.entity.pay.PayBaseAccount;
|
|
|
+import com.bz.smart_city.entity.pay.PayControlRule;
|
|
|
import com.bz.smart_city.quartz.entity.QuartzEntity;
|
|
|
import com.bz.smart_city.quartz.job.MessageSendJob;
|
|
|
import com.bz.smart_city.quartz.service.JobAndTriggerService;
|
|
@@ -25,6 +24,7 @@ import com.bz.smart_city.service.pay.PayMessagesendrecordService;
|
|
|
import com.bz.smart_city.service.pay.PayMessagetemplateService;
|
|
|
import com.github.pagehelper.Page;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
+import io.swagger.annotations.ApiModelProperty;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.InitializingBean;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -65,6 +65,9 @@ public class PayMessagesendrecordServiceImp implements PayMessagesendrecordServi
|
|
|
@Resource
|
|
|
BaseClosingAccountInfoMapper baseClosingAccountInfoMapper;
|
|
|
|
|
|
+ @Resource
|
|
|
+ PayFeeMapper payFeeMapper;
|
|
|
+
|
|
|
|
|
|
public void insert(PayMessagesendrecordDto payMessagesendrecordDto) {
|
|
|
|
|
@@ -500,4 +503,100 @@ public class PayMessagesendrecordServiceImp implements PayMessagesendrecordServi
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+ public Pagination<PayDebtPushMessageDto> findPayDebtPushMessages(String condition , Integer searchType,
|
|
|
+ BigDecimal beginDebtFee, BigDecimal endDebtFee,
|
|
|
+ int pageNum, int pageSize){
|
|
|
+ LoginUser loginUser = UserUtil.getCurrentUser();
|
|
|
+
|
|
|
+ Integer siteId=null;
|
|
|
+ Integer customerId=null;
|
|
|
+ List<ProgramItem> programItems=null;
|
|
|
+ if( loginUser !=null){
|
|
|
+ //站点权限
|
|
|
+ siteId=loginUser.getSiteId();
|
|
|
+ //客户权限
|
|
|
+ customerId=loginUser.getCustomerId();
|
|
|
+ //数据权限
|
|
|
+ programItems=UserUtil.getCurrentSiteProgramItems(loginUser);
|
|
|
+ }
|
|
|
+
|
|
|
+ List<Integer> types =new ArrayList<>();
|
|
|
+ types.add(2); //欠费金额
|
|
|
+ types.add(3); //预存金额
|
|
|
+ types.add(4); //用水余额
|
|
|
+ types.add(7); //预存与欠费差额
|
|
|
+ List<PayControlRule> payControlRules = payFeeMapper.getValveRulesByType(0,types,siteId,customerId);
|
|
|
+
|
|
|
+ //分页
|
|
|
+ PageHelper.startPage(pageNum,pageSize);
|
|
|
+ //获取数据
|
|
|
+ List<PayDebtPushMessageDto> list = payFeeMapper.findPayDebtPushMessages( condition, searchType,
|
|
|
+ beginDebtFee, endDebtFee, customerId,siteId, payControlRules, programItems);
|
|
|
+
|
|
|
+ return new Pagination<>(list);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ public void findPayDebtPushMessagesExport(String condition , Integer searchType,
|
|
|
+ BigDecimal beginDebtFee, BigDecimal endDebtFee ,HttpServletResponse httpServletResponse){
|
|
|
+ LoginUser loginUser = UserUtil.getCurrentUser();
|
|
|
+
|
|
|
+ Integer siteId=null;
|
|
|
+ Integer customerId=null;
|
|
|
+ List<ProgramItem> programItems=null;
|
|
|
+ if( loginUser !=null){
|
|
|
+ //站点权限
|
|
|
+ siteId=loginUser.getSiteId();
|
|
|
+ //客户权限
|
|
|
+ customerId=loginUser.getCustomerId();
|
|
|
+ //数据权限
|
|
|
+ programItems=UserUtil.getCurrentSiteProgramItems(loginUser);
|
|
|
+ }
|
|
|
+
|
|
|
+ List<Integer> types =new ArrayList<>();
|
|
|
+ types.add(2); //欠费金额
|
|
|
+ types.add(3); //预存金额
|
|
|
+ types.add(4); //用水余额
|
|
|
+ types.add(7); //预存与欠费差额
|
|
|
+ List<PayControlRule> payControlRules = payFeeMapper.getValveRulesByType(0,types,siteId,customerId);
|
|
|
+
|
|
|
+ //获取数据
|
|
|
+ List<PayDebtPushMessageDto> list = payFeeMapper.findPayDebtPushMessages( condition, searchType,
|
|
|
+ beginDebtFee, endDebtFee, customerId,siteId, payControlRules, programItems);
|
|
|
+
|
|
|
+ String title = "客户催缴信息";
|
|
|
+
|
|
|
+ DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
+ String[] rowsName = new String[]{"序号", "客户编号", "客户名称", "手机号", "当前读数", "欠费金额(元)",
|
|
|
+ "预存金额(元)", "用水余额(元)", "欠费天数", "累积催缴","最近一次催缴时间"};
|
|
|
+
|
|
|
+ List<Object[]> dataList = newArrayList();
|
|
|
+ Object[] objs;
|
|
|
+ int i = 0;
|
|
|
+ for(PayDebtPushMessageDto payDebtPushMessageDto :list){
|
|
|
+ objs = new Object[rowsName.length];
|
|
|
+ objs[0] = ++i;
|
|
|
+ objs[1]=payDebtPushMessageDto.getAccountnumber();
|
|
|
+ objs[2]=payDebtPushMessageDto.getAccountname();
|
|
|
+ objs[3]=payDebtPushMessageDto.getMobilephone();
|
|
|
+ objs[4]=payDebtPushMessageDto.getReading();
|
|
|
+ objs[5]=payDebtPushMessageDto.getDebt();
|
|
|
+ objs[6]=payDebtPushMessageDto.getRemaining();
|
|
|
+ objs[7]=payDebtPushMessageDto.getBalance();
|
|
|
+ objs[8]=payDebtPushMessageDto.getDays();
|
|
|
+ objs[10]=payDebtPushMessageDto.getSendNum();
|
|
|
+ if(payDebtPushMessageDto.getLastSendTime() != null){
|
|
|
+ objs[11]=df.format(payDebtPushMessageDto.getLastSendTime());
|
|
|
+ }
|
|
|
+ dataList.add(objs);
|
|
|
+ }
|
|
|
+ ExcelUtil excelUtil = new ExcelUtil(title, rowsName, dataList);
|
|
|
+ try {
|
|
|
+ excelUtil.export(httpServletResponse);
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new ServiceException(-900, "导出异常");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
}
|