Commit ecbfc658 by HlQ

[add] 合同管理添加合同不同阶段的收款时间字段

[chg] 钉钉消息体样式优化
1 parent d22db446
...@@ -50,8 +50,8 @@ public class TaskRunner { ...@@ -50,8 +50,8 @@ public class TaskRunner {
JSONObject msg = new JSONObject(); JSONObject msg = new JSONObject();
JSONObject content = new JSONObject(); JSONObject content = new JSONObject();
content.set("title", "请查看您未完成的工单~_~"); content.set("title", "请查看您未完成的工单~_~");
content.set("markdown", "请查看您未完成的工单" + content.set("markdown", "#### 请查看您未完成的工单" +
" \n 发送时间:" + DateUtil.now()); " \n #### 发送时间:" + DateUtil.now());
content.set("btn_orientation", "1"); content.set("btn_orientation", "1");
JSONArray jsonArray = new JSONArray(); JSONArray jsonArray = new JSONArray();
......
package vion.dto; package vion.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import java.math.BigDecimal; import java.math.BigDecimal;
...@@ -29,24 +29,6 @@ public class ContractDTO extends BaseDTO { ...@@ -29,24 +29,6 @@ public class ContractDTO extends BaseDTO {
private Integer type; private Integer type;
/** /**
* 合同签订日期
*/
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date signDate;
/**
* 合同维保开始日期
*/
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date maintainSdate;
/**
* 合同维保结束日期
*/
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date maintainEdate;
/**
* 合同进度:1-签订 2-发货 3-货到 4-安装 5-验收 6-质保 * 合同进度:1-签订 2-发货 3-货到 4-安装 5-验收 6-质保
*/ */
private Integer status; private Integer status;
...@@ -92,36 +74,10 @@ public class ContractDTO extends BaseDTO { ...@@ -92,36 +74,10 @@ public class ContractDTO extends BaseDTO {
*/ */
private String remark; private String remark;
/**
* 记录创建者
*/
private Long createUser;
/**
* 记录最后一次修改者
*/
private Long modifyUser;
/**
* 创建时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createTime;
/**
* 修改时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date modifyTime;
private MultipartFile[] files; private MultipartFile[] files;
/** /**
* 合同质保周期(月)
*/
private Integer warrantyPeriod;
/**
* 终验日期 * 终验日期
*/ */
private Date finalDate; private Date finalDate;
...@@ -131,4 +87,10 @@ public class ContractDTO extends BaseDTO { ...@@ -131,4 +87,10 @@ public class ContractDTO extends BaseDTO {
*/ */
private Long storeId; private Long storeId;
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date signDateStart;
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date signDateEnd;
} }
\ No newline at end of file \ No newline at end of file
package vion.dto; package vion.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date;
@Getter @Getter
@Setter @Setter
...@@ -27,25 +25,4 @@ public class ContractPaymentDTO { ...@@ -27,25 +25,4 @@ public class ContractPaymentDTO {
*/ */
private BigDecimal paymentRatio; private BigDecimal paymentRatio;
/**
* 创建者
*/
private Integer createUser;
/**
* 记录最后一次修改者
*/
private Integer modifyUser;
/**
* 创建时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createTime;
/**
* 修改时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date modifyTime;
} }
\ No newline at end of file \ No newline at end of file
...@@ -158,50 +158,104 @@ public class Contract { ...@@ -158,50 +158,104 @@ public class Contract {
private BigDecimal invoiceAmount; private BigDecimal invoiceAmount;
/** /**
* 录入时间
*/
@TableField(value = "entry_time")
private Date entryTime;
/**
* 合同签订付款比例 * 合同签订付款比例
*/ */
@TableField(exist = false) @TableField(exist = false)
private BigDecimal signRatio; private BigDecimal signRatio;
/** /**
* 合同签订付款日期
*/
@TableField(exist = false)
private Date signDate1;
/**
* 合同到货付款比例 * 合同到货付款比例
*/ */
@TableField(exist = false) @TableField(exist = false)
private BigDecimal arriveRatio; private BigDecimal arriveRatio;
/** /**
* 合同到货付款日期
*/
@TableField(exist = false)
private Date arriveDate;
/**
* 合同系统验收付款比例 * 合同系统验收付款比例
*/ */
@TableField(exist = false) @TableField(exist = false)
private BigDecimal systemCheckRatio; private BigDecimal systemCheckRatio;
/** /**
* 合同系统验收付款日期
*/
@TableField(exist = false)
private Date systemCheckDate;
/**
* 合同项目验收付款比例 * 合同项目验收付款比例
*/ */
@TableField(exist = false) @TableField(exist = false)
private BigDecimal projectCheckRatio; private BigDecimal projectCheckRatio;
/** /**
* 合同项目验收付款日期
*/
@TableField(exist = false)
private Date projectCheckDate;
/**
* 合同质保付款比例 * 合同质保付款比例
*/ */
@TableField(exist = false) @TableField(exist = false)
private BigDecimal warrantyRatio; private BigDecimal warrantyRatio;
/** /**
* 合同质保付款日期
*/
@TableField(exist = false)
private Date warrantyDate;
/**
* 合同维保付款比例1 * 合同维保付款比例1
*/ */
@TableField(exist = false) @TableField(exist = false)
private BigDecimal maintainRatio1; private BigDecimal maintainRatio1;
/** /**
* 合同维保付款日期1
*/
@TableField(exist = false)
private Date maintainDate1;
/**
* 合同维保付款比例2 * 合同维保付款比例2
*/ */
@TableField(exist = false) @TableField(exist = false)
private BigDecimal maintainRatio2; private BigDecimal maintainRatio2;
/** /**
* 合同维保付款日期2
*/
@TableField(exist = false)
private Date maintainDate2;
/**
* 合同维保付款比例2 * 合同维保付款比例2
*/ */
@TableField(exist = false) @TableField(exist = false)
private BigDecimal maintainRatio3; private BigDecimal maintainRatio3;
/**
* 合同维保付款日期2
*/
@TableField(exist = false)
private Date maintainDate3;
} }
\ No newline at end of file \ No newline at end of file
...@@ -30,7 +30,7 @@ public class ContractPayment { ...@@ -30,7 +30,7 @@ public class ContractPayment {
private Long contractId; private Long contractId;
/** /**
* 付款方式:1-签订 2-发货 3-货到 4-安装 5-验收 6-质保 * 付款方式:1-签订 2-到货 3-系统验收 4-项目验收 5-质保 6-第一笔维保款 7-第二笔维保款 8-第三笔维保款
*/ */
@TableField(value = "payment_type") @TableField(value = "payment_type")
private Integer paymentType; private Integer paymentType;
...@@ -42,6 +42,12 @@ public class ContractPayment { ...@@ -42,6 +42,12 @@ public class ContractPayment {
private BigDecimal paymentRatio; private BigDecimal paymentRatio;
/** /**
* 收款日期
*/
@TableField(value = "payment_date")
private Date paymentDate;
/**
* 创建者 * 创建者
*/ */
@TableField(value = "create_user") @TableField(value = "create_user")
......
...@@ -8,6 +8,7 @@ import cn.hutool.core.io.FileUtil; ...@@ -8,6 +8,7 @@ import cn.hutool.core.io.FileUtil;
import cn.hutool.core.lang.Assert; import cn.hutool.core.lang.Assert;
import cn.hutool.core.lang.Opt; import cn.hutool.core.lang.Opt;
import cn.hutool.core.map.MapUtil; import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.util.ObjUtil; import cn.hutool.core.util.ObjUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.SecureUtil; import cn.hutool.crypto.SecureUtil;
...@@ -59,7 +60,8 @@ public class ContractServiceImpl extends MPJBaseServiceImpl<ContractMapper, Cont ...@@ -59,7 +60,8 @@ public class ContractServiceImpl extends MPJBaseServiceImpl<ContractMapper, Cont
public Page<ContractVO> list(ContractDTO dto) { public Page<ContractVO> list(ContractDTO dto) {
Contract contract = converter.convert(dto, new Contract()); Contract contract = converter.convert(dto, new Contract());
Page<Contract> contractList = this.lambdaQuery(contract) Page<Contract> contractList = this.lambdaQuery(contract)
.orderByDesc(Contract::getModifyTime) .between(ArrayUtil.isAllNotNull(dto.getSignDateStart(), dto.getSignDateEnd()), Contract::getSignDate, dto.getSignDateStart(), dto.getSignDateEnd())
.orderByDesc(Contract::getEntryTime)
.page(Page.of(dto.getPageNum(), dto.getPageSize())); .page(Page.of(dto.getPageNum(), dto.getPageSize()));
List<ContractVO> contractVOList = converter.convert(contractList.getRecords(), ContractVO.class); List<ContractVO> contractVOList = converter.convert(contractList.getRecords(), ContractVO.class);
// 查出合同关联的项目名 // 查出合同关联的项目名
...@@ -77,9 +79,9 @@ public class ContractServiceImpl extends MPJBaseServiceImpl<ContractMapper, Cont ...@@ -77,9 +79,9 @@ public class ContractServiceImpl extends MPJBaseServiceImpl<ContractMapper, Cont
.orElse(ListUtil.of(0L)); .orElse(ListUtil.of(0L));
Page<Contract> contractList = this.lambdaQuery(contract) Page<Contract> contractList = this.lambdaQuery(contract)
.select(Contract::getId, Contract::getName, Contract::getContractNo, Contract::getType, Contract::getSignDate, Contract::getWarrantyPeriod, Contract::getFinalDate, Contract::getStatus, Contract::getSaleName, Contract::getCustomerName) .select(Contract::getId, Contract::getName, Contract::getContractNo, Contract::getType, Contract::getSignDate, Contract::getWarrantyPeriod, Contract::getFinalDate, Contract::getStatus, Contract::getSaleName, Contract::getCustomerName, Contract::getMaintainSdate, Contract::getMaintainEdate)
.in(CollUtil.isNotEmpty(ids), Contract::getId, ids) .in(CollUtil.isNotEmpty(ids), Contract::getId, ids)
.orderByDesc(Contract::getModifyTime) .orderByDesc(Contract::getEntryTime)
.page(Page.of(dto.getPageNum(), dto.getPageSize())); .page(Page.of(dto.getPageNum(), dto.getPageSize()));
List<ContractVO> contractVOList = converter.convert(contractList.getRecords(), ContractVO.class); List<ContractVO> contractVOList = converter.convert(contractList.getRecords(), ContractVO.class);
// 查出合同关联的项目名 // 查出合同关联的项目名
......
...@@ -9,6 +9,7 @@ import cn.hutool.core.lang.Opt; ...@@ -9,6 +9,7 @@ import cn.hutool.core.lang.Opt;
import cn.hutool.core.map.MapUtil; import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.DesensitizedUtil; import cn.hutool.core.util.DesensitizedUtil;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.SecureUtil; import cn.hutool.crypto.SecureUtil;
import cn.hutool.json.JSONArray; import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject; import cn.hutool.json.JSONObject;
...@@ -92,6 +93,7 @@ public class TaskServiceImpl extends MPJBaseServiceImpl<TaskMapper, Task> implem ...@@ -92,6 +93,7 @@ public class TaskServiceImpl extends MPJBaseServiceImpl<TaskMapper, Task> implem
.leftJoin(ServiceOrder.class, ServiceOrder::getTaskId, Task::getId) .leftJoin(ServiceOrder.class, ServiceOrder::getTaskId, Task::getId)
.between(data.getStartdate() != null && data.getEnddate() != null, Task::getRepairTime, data.getStartdate(), data.getEnddate()) .between(data.getStartdate() != null && data.getEnddate() != null, Task::getRepairTime, data.getStartdate(), data.getEnddate())
.lt(data.getCurDate() != null, Task::getExpDate, data.getCurDate()); .lt(data.getCurDate() != null, Task::getExpDate, data.getCurDate());
// todo 优化
if (taskIdSet.size() == 1 && CollUtil.get(taskIdSet, 0).equals(-99L)) { if (taskIdSet.size() == 1 && CollUtil.get(taskIdSet, 0).equals(-99L)) {
// 不是管理员,并且第一次处理工单,但当前处理人是他 // 不是管理员,并且第一次处理工单,但当前处理人是他
} else if (taskIdSet.size() == 1 && CollUtil.get(taskIdSet, 0).equals(0L)) { } else if (taskIdSet.size() == 1 && CollUtil.get(taskIdSet, 0).equals(0L)) {
...@@ -261,12 +263,14 @@ public class TaskServiceImpl extends MPJBaseServiceImpl<TaskMapper, Task> implem ...@@ -261,12 +263,14 @@ public class TaskServiceImpl extends MPJBaseServiceImpl<TaskMapper, Task> implem
JSONObject msg = new JSONObject(); JSONObject msg = new JSONObject();
JSONObject content = new JSONObject(); JSONObject content = new JSONObject();
content.set("title", "您有一条新工单请及时处理哦~_~"); content.set("title", "您有一条新工单请及时处理哦~_~");
content.set("markdown", "门店信息: " + storeName + "[FullOfVitality]" + String markdown = StrUtil.format("#### 门店信息: **{}** [FullOfVitality]" +
" \n 报修人:" + task.getRepairPeople() + " \n #### 报修人:{}" +
" \n 联系方式:" + task.getRepairPhone() + " \n #### 联系方式:{}" +
" \n 当前工单状态:" + orderStatusMap.get(task.getStatus()) + " \n #### 当前工单状态:{}" +
" \n 故障描述:" + task.getFaultDescription() + " \n #### 故障描述:{}" +
" \n 发送时间:" + DateUtil.now()); " \n #### 发送时间:{}",
storeName, task.getRepairPeople(), task.getRepairPhone(), orderStatusMap.get(task.getStatus()), task.getFaultDescription(), DateUtil.now());
content.set("markdown", markdown);
content.set("btn_orientation", "1"); content.set("btn_orientation", "1");
JSONArray jsonArray = new JSONArray(); JSONArray jsonArray = new JSONArray();
......
...@@ -129,11 +129,13 @@ public class TaskTempServiceImpl extends MPJBaseServiceImpl<TaskTempMapper, Task ...@@ -129,11 +129,13 @@ public class TaskTempServiceImpl extends MPJBaseServiceImpl<TaskTempMapper, Task
JSONObject msg = new JSONObject(); JSONObject msg = new JSONObject();
JSONObject content = new JSONObject(); JSONObject content = new JSONObject();
content.set("title", "客户提交工单,请及时处理哦~_~"); content.set("title", "客户提交工单,请及时处理哦~_~");
content.set("markdown", "门店信息: " + taskTemp.getStoreName() + String markdown = StrUtil.format("#### 门店信息: **{}**" +
" \n 客户姓名:" + taskTemp.getRepairPeople() + " \n #### 客户姓名:{}" +
" \n 联系方式:" + taskTemp.getRepairPhone() + " \n #### 联系方式:{}" +
" \n 故障描述:" + taskTemp.getFaultDescription() + " \n #### 故障描述:{}" +
" \n 发送时间:" + DateUtil.now()); " \n #### 发送时间:{}",
taskTemp.getStoreName(), taskTemp.getRepairPeople(), taskTemp.getRepairPhone(), taskTemp.getFaultDescription(), DateUtil.now());
content.set("markdown", markdown);
content.set("btn_orientation", "1"); content.set("btn_orientation", "1");
JSONArray jsonArray = new JSONArray(); JSONArray jsonArray = new JSONArray();
......
...@@ -123,6 +123,7 @@ public class ContractVO { ...@@ -123,6 +123,7 @@ public class ContractVO {
/** /**
* 终验日期 * 终验日期
*/ */
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date finalDate; private Date finalDate;
/** /**
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!