代办优化

This commit is contained in:
sxu 2025-01-22 15:03:52 +08:00
parent 6391be0117
commit dc217d8ac4
6 changed files with 24 additions and 5 deletions

View File

@ -72,4 +72,7 @@ public class ToDoBean extends BaseEntity {
@ApiModelProperty(value = "出租方公司名称") @ApiModelProperty(value = "出租方公司名称")
private String sellerCompanyName; private String sellerCompanyName;
@ApiModelProperty(value = "待办通知公司id")
private Long noticeCompanyId;
} }

View File

@ -25,7 +25,7 @@ public class ToDoServiceImpl implements ToDoService {
@Override @Override
public List<ToDoBean> getToDoList(ToDoBean bean) { public List<ToDoBean> getToDoList(ToDoBean bean) {
bean.setBuyerCompanyId(Math.toIntExact(SecurityUtils.getLoginUser().getSysUser().getCompanyId())); bean.setNoticeCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId());
return toDoMapper.getToDoList(bean); return toDoMapper.getToDoList(bean);
} }

View File

@ -124,6 +124,7 @@ public class OrderServiceImpl implements OrderService {
DevInfoVo devInfoVo = devInfoMapper.selectDevInfoByMaId(Long.valueOf(orderDetailDtos.get(0).getMaId())); DevInfoVo devInfoVo = devInfoMapper.selectDevInfoByMaId(Long.valueOf(orderDetailDtos.get(0).getMaId()));
tmTask.setSellerCompanyId(Long.valueOf(devInfoVo.getCompanyId())); tmTask.setSellerCompanyId(Long.valueOf(devInfoVo.getCompanyId()));
} }
tmTask.setNoticeCompanyId(tmTask.getSellerCompanyId());
tmTaskMapper.insertSelective(tmTask); tmTaskMapper.insertSelective(tmTask);
} }
return j; return j;
@ -275,12 +276,21 @@ public class OrderServiceImpl implements OrderService {
String userName = SecurityUtils.getLoginUser().getUsername(); String userName = SecurityUtils.getLoginUser().getUsername();
Integer i = orderMapper.updateOrderStatus(orderInfoDto.getOrderId(), orderInfoDto.getMaIds(), orderInfoDto.getOrderStatus(), userName); Integer i = orderMapper.updateOrderStatus(orderInfoDto.getOrderId(), orderInfoDto.getMaIds(), orderInfoDto.getOrderStatus(), userName);
if (!CollectionUtils.isEmpty(dtos)) { if (!CollectionUtils.isEmpty(dtos)) {
OptionalInt minOrderStatus = dtos.stream().mapToInt(person -> Integer.parseInt(person.getOrderStatus())).min(); OptionalInt minOrderStatus = dtos.stream().mapToInt(o -> Integer.parseInt(o.getOrderStatus())).min();
if (minOrderStatus.isPresent()) { if (minOrderStatus.isPresent()) {
TmTask tmTask = new TmTask(); TmTask tmTask = new TmTask();
tmTask.setTaskType(TmTaskTypeEnum.TM_TASK_ORDER.getTaskTypeId()); tmTask.setTaskType(TmTaskTypeEnum.TM_TASK_ORDER.getTaskTypeId());
tmTask.setTaskStatus(minOrderStatus.getAsInt()); tmTask.setTaskStatus(minOrderStatus.getAsInt());
tmTask.setCode(dtos.get(0).getOrderCode()); tmTask.setCode(dtos.get(0).getOrderCode());
if (orderInfoDto.getOrderStatus().equals(OrderStatusEnum.ORDER_PENDING_SHIPMENT.getStatus().toString()) ||
orderInfoDto.getOrderStatus().equals(OrderStatusEnum.ORDER_TERMINATED.getStatus().toString())) {
tmTask.setNoticeCompanyId(tmTask.getBuyerCompanyId());
} else if (orderInfoDto.getOrderStatus().equals(OrderStatusEnum.ORDER_RECEIVE.getStatus().toString()) ||
orderInfoDto.getOrderStatus().equals(OrderStatusEnum.ORDER_AWAITING_RECEIPT.getStatus().toString()) ||
orderInfoDto.getOrderStatus().equals(OrderStatusEnum.ORDER_UNDER_LEASE.getStatus().toString()) ||
orderInfoDto.getOrderStatus().equals(OrderStatusEnum.ORDER_REPAIRED.getStatus().toString())) {
tmTask.setNoticeCompanyId(tmTask.getSellerCompanyId());
}
tmTaskMapper.updateTaskStatus(tmTask); tmTaskMapper.updateTaskStatus(tmTask);
} }
} }

View File

@ -52,6 +52,9 @@ public class TmTask extends BaseEntity implements Serializable {
@ApiModelProperty(value = "出租方公司id") @ApiModelProperty(value = "出租方公司id")
private Long sellerCompanyId; private Long sellerCompanyId;
@ApiModelProperty(value = "待办通知公司id")
private Long noticeCompanyId;
@ApiModelProperty(value = "关键字") @ApiModelProperty(value = "关键字")
private String keyWord; private String keyWord;

View File

@ -23,8 +23,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHERE WHERE
tt.`status` = '1' and tt.task_status &lt; 20 tt.`status` = '1' and tt.task_status &lt; 20
and tt.task_type in (2) and tt.task_type in (2)
<if test="buyerCompanyId != null"> <if test="noticeCompanyId != null">
and tt.buyer_company_id=#{buyerCompanyId} || tt.seller_company_id=#{buyerCompanyId} and tt.notice_company_id=#{noticeCompanyId}
</if> </if>
<if test="taskTypeId != null and taskTypeId != ''"> <if test="taskTypeId != null and taskTypeId != ''">
and tt.task_type=#{taskTypeId} and tt.task_type=#{taskTypeId}

View File

@ -46,7 +46,7 @@
update update
tm_task tm_task
set set
task_status = #{taskStatus}, update_time = NOW() task_status = #{taskStatus}, notice_company_id = #{noticeCompanyId}, update_time = NOW()
where where
task_type = #{taskType} and code = #{code} task_type = #{taskType} and code = #{code}
</update> </update>
@ -80,6 +80,9 @@
<if test="sellerCompanyId != null"> <if test="sellerCompanyId != null">
seller_company_id, seller_company_id,
</if> </if>
<if test="noticeCompanyId != null">
notice_company_id,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="taskType != null"> <if test="taskType != null">