Commit 897f8b25 authored by hezhuozhi's avatar hezhuozhi

修改还款问题

parent 0f7dc1d0
......@@ -21,7 +21,7 @@
and repay_state = #{repayState}
</if>
</where>
order by rec_date DESC
order by rec_date DESC,sequence_nbr DESC
</select>
<select id="getPrivilegeCompanyByOrgCode"
......
......@@ -188,7 +188,7 @@ public class RepaymentServiceImpl extends BaseService<RepaymentDto, Repayment, R
taskNameBuilder.append("日");
taskNameBuilder.append("之前需要对");
taskNameBuilder.append(repayment.getCompanyName());
taskNameBuilder.append("区域公司进行还款,");
taskNameBuilder.append("进行还款,");
taskNameBuilder.append("金额为");
taskNameBuilder.append(repayment.getRent());
taskNameBuilder.append("元");
......@@ -245,7 +245,7 @@ public class RepaymentServiceImpl extends BaseService<RepaymentDto, Repayment, R
try {
saveBatch(repaymentList);
} catch (Exception exception) {
throw new BadRequest("有重复数据请检查");
throw new BadRequest("有重复数据请检查,区域公司、期次、还款日期、放款批次唯一");
}
} catch (Exception e) {
log.error(e.getMessage(), e);
......@@ -295,19 +295,19 @@ public class RepaymentServiceImpl extends BaseService<RepaymentDto, Repayment, R
private void checkMoney(String rent, String interest, String principal) {
// 定义要匹配的正则表达式
String regex = "^([1-9]\\d{0,9}|0)([.]?|(\\.\\d{1,2})?)$";
String regex = "^([0-9]\\d{0,9}|0)([.]?|(\\.\\d{1,2})?)$";
Pattern pattern = Pattern.compile(regex);
Matcher rentMatcher = pattern.matcher(rent);
if (!rentMatcher.find()) {
throw new BadRequest("租金金额格式不对");
throw new BadRequest("租金金额格式不对,小数点后最多保留2位");
}
Matcher interestMatcher = pattern.matcher(interest);
if (!interestMatcher.find()) {
throw new BadRequest("利息金额格式不对");
throw new BadRequest("利息金额格式不对,小数点后最多保留2位");
}
Matcher principalMatcher = pattern.matcher(principal);
if (!principalMatcher.find()) {
throw new BadRequest("本金金额格式不对");
throw new BadRequest("本金金额格式不对,小数点后最多保留2位");
}
}
......@@ -356,6 +356,10 @@ public class RepaymentServiceImpl extends BaseService<RepaymentDto, Repayment, R
model.setCompanyName(privilegeCompany.getCompanyName());
}
Repayment repayment = BeanUtil.copyProperties(model, Repayment.class);
this.saveOrUpdate(repayment);
try {
this.saveOrUpdate(repayment);
}catch (Exception exception) {
throw new BadRequest("有重复数据请检查,区域公司、期次、还款日期、放款批次唯一");
}
}
}
......@@ -97,10 +97,12 @@ public class ToDoTasksServiceImpl extends BaseService<ToDoTasksDto,ToDoTasks,ToD
doTask.setCompleteTime(new Date());
toDoTasksMapper.updateById(doTask);
emqKeeper.getMqttClient().publish("TASK_MESSAGE" ,JSON.toJSONString(doTasks).getBytes(), 2 ,false);
UserMessage userMessage= new UserMessage( doTask.getType(), doTask.getBusinessId(), doTask.getAmosUserId(), new Date(), doTask.getTaskName()+"已完成."+meg, doTask.getAmosOrgCode());
UserMessage userMessage= new UserMessage( doTask.getType(), doTask.getBusinessId(), doTask.getAmosUserId(), new Date(), doTask.getTaskName()+",此消息已确认."+meg, doTask.getAmosOrgCode());
userMessageMapper.insert(userMessage);
emqKeeper.getMqttClient().publish("MY_MESSAGE" ,JSON.toJSONString(userMessage).getBytes(), 2 ,false);
}
}else {
log.error("没有查询到待办,不进行更新和发送消息");
}
}catch (Exception e){
e.printStackTrace();
......@@ -117,7 +119,7 @@ public class ToDoTasksServiceImpl extends BaseService<ToDoTasksDto,ToDoTasks,ToD
toDoTasks.setSequenceNbr(sequence.nextId());
toDoTasksMapper.insert(toDoTasks);
emqKeeper.getMqttClient().publish("TASK_MESSAGE" ,JSON.toJSONString(toDoTasks).getBytes(), 2 ,false);
UserMessage userMessage= new UserMessage( toDoTasks.getType(), toDoTasks.getBusinessId(), toDoTasks.getAmosUserId(), new Date(), toDoTasks.getTaskName()+"待完成", toDoTasks.getAmosOrgCode());
UserMessage userMessage= new UserMessage( toDoTasks.getType(), toDoTasks.getBusinessId(), toDoTasks.getAmosUserId(), new Date(), toDoTasks.getTaskName(), toDoTasks.getAmosOrgCode());
userMessageMapper.insert(userMessage);
emqKeeper.getMqttClient().publish("MY_MESSAGE" ,JSON.toJSONString(userMessage).getBytes(), 2 ,false);
}
......
......@@ -32,16 +32,16 @@ public class RepaymentExcelVO implements Serializable {
@Excel(name = "还款日期", width = 30, orderNum = "3")
private LocalDate repayDate;
@ApiModelProperty(value = "租金")
@Excel(name = "租金", width = 30, orderNum = "4")
@ApiModelProperty(value = "租金(元)")
@Excel(name = "租金(元)", width = 30, orderNum = "4")
private Double rent;
@ApiModelProperty(value = "利息")
@Excel(name = "利息", width = 30, orderNum = "5")
@ApiModelProperty(value = "利息(元)")
@Excel(name = "利息(元)", width = 30, orderNum = "5")
private Double interest;
@ApiModelProperty(value = "本金")
@Excel(name = "本金", width = 30, orderNum = "6")
@ApiModelProperty(value = "本金(元)")
@Excel(name = "本金(元)", width = 30, orderNum = "6")
private Double principal;
@ApiModelProperty(value = "放款批次")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment