Ver código fonte

约检确认增加前台备注

xy 1 semana atrás
pai
commit
ad9b4484a0

+ 7 - 0
build-prod/updata.sql

@@ -54,4 +54,11 @@ COMMENT ON COLUMN "PRESSURE2_PIPE_TASK_ORDER_ITEM_REPORT"."RECYCLE_EXPIRE_DATE"
 ALTER TABLE "PRESSURE2_ORDER_REPORT" ADD COLUMN "ACCEPT_ORDER_NO" VARCHAR(50);
 COMMENT ON COLUMN "PRESSURE2_ORDER_REPORT"."ACCEPT_ORDER_NO" IS '受理单/服务单编号';
 
+ALTER TABLE "PRESSURE_APPOINTMENT_CONFIRM_ORDER" ADD COLUMN "ANNOTATOR_DATE" DATETIME(6);
+ALTER TABLE "PRESSURE_APPOINTMENT_CONFIRM_ORDER" ADD COLUMN "ANNOTATOR_ID" VARCHAR(64);
+ALTER TABLE "PRESSURE_APPOINTMENT_CONFIRM_ORDER" ADD COLUMN "ANNOTATOR_NAME" VARCHAR(64);
+COMMENT ON COLUMN "PRESSURE_APPOINTMENT_CONFIRM_ORDER"."ANNOTATOR_DATE" IS '备注日期时间';
+COMMENT ON COLUMN "PRESSURE_APPOINTMENT_CONFIRM_ORDER"."ANNOTATOR_ID" IS '备注人ID';
+COMMENT ON COLUMN "PRESSURE_APPOINTMENT_CONFIRM_ORDER"."ANNOTATOR_NAME" IS '备注人名称';        
+        
 --已加

+ 7 - 0
tz-module-pressure2/tz-module-pressure2-biz/src/main/java/cn/start/tz/module/pressure2/controller/admin/appointmentconfirmorder/AppointmentConfirmOrderController.java

@@ -149,4 +149,11 @@ public class AppointmentConfirmOrderController {
         return success(true);
     }
 
+    @PutMapping("/update-remark")
+    @Operation(summary = "更新约检确认单备注")
+    public CommonResult<Boolean> updateRemark(@Valid @RequestBody AppointmentRemarkUpdateVO updateVO) {
+        appointmentConfirmOrderService.updateRemark(updateVO.getId(), updateVO.getRemark());
+        return success(true);
+    }
+
 }

+ 16 - 0
tz-module-pressure2/tz-module-pressure2-biz/src/main/java/cn/start/tz/module/pressure2/controller/admin/appointmentconfirmorder/vo/AppointmentConfirmOrderRespVO.java

@@ -267,4 +267,20 @@ public class AppointmentConfirmOrderRespVO {
      * 企业类型
      */
     private String enterpriseType;
+
+    /**
+     * 备注日期时间
+     */
+    private LocalDateTime annotatorDate;
+
+    /**
+     * 备注人id
+     */
+    private String annotatorId;
+
+    /**
+     * 备注人名称
+     */
+    private String annotatorName;
+
 }

+ 29 - 0
tz-module-pressure2/tz-module-pressure2-biz/src/main/java/cn/start/tz/module/pressure2/controller/admin/appointmentconfirmorder/vo/AppointmentRemarkUpdateVO.java

@@ -0,0 +1,29 @@
+package cn.start.tz.module.pressure2.controller.admin.appointmentconfirmorder.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotBlank;
+import lombok.Data;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+/**
+ * 约检确认单备注更新 Request VO
+ *
+ * @author 特种管理员
+ */
+@Schema(description = "管理后台 - 约检确认单备注更新 Request VO")
+@Data
+public class AppointmentRemarkUpdateVO implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 1L;
+
+    @Schema(description = "约检确认单ID", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotBlank(message = "约检确认单ID不能为空")
+    private String id;
+
+    @Schema(description = "备注内容", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotBlank(message = "备注内容不能为空")
+    private String remark;
+}

+ 16 - 0
tz-module-pressure2/tz-module-pressure2-biz/src/main/java/cn/start/tz/module/pressure2/dal/dataobject/appointmentconfirmorder/AppointmentConfirmOrderDO.java

@@ -9,6 +9,7 @@ import lombok.*;
 
 import java.math.BigDecimal;
 import java.time.LocalDate;
+import java.time.LocalDateTime;
 
 /**
  * 约检确认 DO
@@ -95,6 +96,21 @@ public class AppointmentConfirmOrderDO extends BaseDO {
      */
     private String remark;
 
+    /**
+     * 备注日期时间
+     */
+    private LocalDateTime annotatorDate;
+
+    /**
+     * 备注人id
+     */
+    private String annotatorId;
+
+    /**
+     * 备注人名称
+     */
+    private String annotatorName;
+
     private String reason;
     /**
      * 邮箱

+ 7 - 0
tz-module-pressure2/tz-module-pressure2-biz/src/main/java/cn/start/tz/module/pressure2/service/appointmentconfirmorder/AppointmentConfirmOrderService.java

@@ -80,4 +80,11 @@ public interface AppointmentConfirmOrderService {
 
     void refuseCheckApp(@Valid AppAppointmentRefuseVO appointmentRefuseVO);
 
+    /**
+     * 更新约检确认单备注
+     *
+     * @param id     约检确认单ID
+     * @param remark 备注内容
+     */
+    void updateRemark(String id, String remark);
 }

+ 27 - 0
tz-module-pressure2/tz-module-pressure2-biz/src/main/java/cn/start/tz/module/pressure2/service/appointmentconfirmorder/AppointmentConfirmOrderServiceImpl.java

@@ -100,6 +100,7 @@ import java.util.stream.Collectors;
 import static cn.start.tz.framework.common.exception.util.ServiceExceptionUtil.exception;
 import static cn.start.tz.framework.common.util.servlet.ServletUtils.getClientIP;
 import static cn.start.tz.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
+import static cn.start.tz.framework.security.core.util.SecurityFrameworkUtils.getLoginUserNickname;
 
 
 /**
@@ -1247,4 +1248,30 @@ public class AppointmentConfirmOrderServiceImpl implements AppointmentConfirmOrd
         refuseVO.setRejectionSource(3);
         refuseCheck(refuseVO);
     }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void updateRemark(String id, String remark) {
+        // 校验约检确认单存在
+        AppointmentConfirmOrderDO order = appointmentConfirmOrderMapper.selectById(id);
+        if (order == null) {
+            throw new ServiceException(404, "约检确认单不存在");
+        }
+
+        // 记录备注人和备注时间
+        String annotatorId = getLoginUserId() != null ? getLoginUserId().toString() : null;
+        String annotatorName = getLoginUserNickname();
+        LocalDateTime annotatorDate = LocalDateTime.now();
+
+        // 更新约检确认单的备注、备注人、备注时间
+        AppointmentConfirmOrderDO updateObj = new AppointmentConfirmOrderDO();
+        updateObj.setId(id);
+        updateObj.setRemark(remark);
+        updateObj.setAnnotatorId(annotatorId);
+        updateObj.setAnnotatorName(annotatorName);
+        updateObj.setAnnotatorDate(annotatorDate);
+        appointmentConfirmOrderMapper.updateById(updateObj);
+
+        log.info("更新约检确认单备注完成,约检单ID: {},备注人: {}", id, annotatorName);
+    }
 }

+ 3 - 2
tz-module-pressure2/tz-module-pressure2-biz/src/main/resources/mapper/appointmentconfirmorder/AppointmentConfirmOrderMapper.xml

@@ -48,7 +48,8 @@
                tmp.use_unit_address, tmp.use_unit_zipcode, tmp.use_unit_contact, tmp.use_unit_phone,
                tmp.fee_nature, tmp.fee_date, tmp.recipient, tmp.recipient_phone, tmp.dept_phone,
                tmp.recipient_email, tmp.payer_contact_name, tmp.payer_contact, tmp.payer_mail,
-               tmp.equip_main_type, tmp.scheduling_id, tmp.scheduling_time
+               tmp.equip_main_type, tmp.scheduling_id, tmp.scheduling_time,
+               tmp.ANNOTATOR_DATE,tmp.ANNOTATOR_ID,tmp.ANNOTATOR_NAME
         FROM (
             SELECT aco.id, aco.appointment_no, aco.unit_code, aco.unit_name, aco.unit_address,
                    aco.check_type, aco.equip_type, aco.equip_num_boiler AS equip_num, aco.equip_street, aco.equip_district,
@@ -60,7 +61,7 @@
                    aco.use_unit_address, aco.use_unit_zipcode, aco.use_unit_contact, aco.use_unit_phone,
                    aco.fee_nature, aco.fee_date, aco.recipient, aco.recipient_phone, aco.dept_phone,
                    aco.recipient_email, aco.payer_contact_name, aco.payer_contact, aco.payer_mail,
-                   aco.equip_main_type, aco.scheduling_id,
+                   aco.equip_main_type, aco.scheduling_id,aco.ANNOTATOR_DATE,aco.ANNOTATOR_ID,aco.ANNOTATOR_NAME,
                    COALESCE(ebs.create_time, eps.create_time) AS scheduling_time
             FROM pressure_appointment_confirm_order aco
             LEFT JOIN pressure2_boiler_appointment_confirm_order_item baci ON baci.order_id = aco.id AND baci.deleted = 0