Browse Source

update 乐器维修修改

周箭河 4 years ago
parent
commit
19f9319d65

+ 60 - 46
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentRepair.java

@@ -9,8 +9,8 @@ import java.util.Date;
 public class StudentRepair {
     private Integer id;
     /**
-    * 维修单号
-    */
+     * 维修单号
+     */
     @ApiModelProperty(value = "维修单号", required = false)
     private String transNo;
 
@@ -21,6 +21,12 @@ public class StudentRepair {
     private Long studentInstrumentId;
 
     /**
+     * 学员乐器id
+     */
+    @ApiModelProperty(value = "乐保状态0-无 1-有", required = false)
+    private Integer maintenanceStatus = 0;
+
+    /**
      * 维修单名称
      */
     @ApiModelProperty(value = "维修单名称", required = false)
@@ -33,8 +39,8 @@ public class StudentRepair {
     private BigDecimal exemptionAmount = BigDecimal.ZERO;
 
     /**
-    * 分部id
-    */
+     * 分部id
+     */
     @ApiModelProperty(value = "分部id", required = false)
     private Integer organId;
 
@@ -46,32 +52,32 @@ public class StudentRepair {
 
 
     /**
-    * 分部名称
-    */
+     * 分部名称
+     */
     @ApiModelProperty(value = "分部名称", required = false)
     private String organName;
 
     /**
-    * 学生id
-    */
+     * 学生id
+     */
     @ApiModelProperty(value = "学生id", required = true)
     private Integer studentId;
 
     /**
-    * 学生姓名
-    */
+     * 学生姓名
+     */
     @ApiModelProperty(value = "学生姓名", required = false)
     private String studentName;
 
     /**
-    * 学生学校
-    */
+     * 学生学校
+     */
     @ApiModelProperty(value = "学生学校", required = false)
     private String studentSchool;
 
     /**
-    * 技师id
-    */
+     * 技师id
+     */
     @ApiModelProperty(value = "技师id", required = false)
     private Integer employeeId;
 
@@ -94,26 +100,26 @@ public class StudentRepair {
     private String employeeAddress;
 
     /**
-    * 乐器类型id
-    */
+     * 乐器类型id
+     */
     @ApiModelProperty(value = "乐器类型id", required = false)
     private Integer subjectId;
 
     /**
-    * 乐器类型名称
-    */
+     * 乐器类型名称
+     */
     @ApiModelProperty(value = "乐器类型名称", required = false)
     private String subjectName;
 
     /**
-    * 维修类型 0-线下 1-线上
-    */
+     * 维修类型 0-线下 1-线上
+     */
     @ApiModelProperty(value = "维修类型 0-线下 1-线上", required = false)
     private Integer type;
 
     /**
-    * 乐器编号
-    */
+     * 乐器编号
+     */
     @ApiModelProperty(value = "乐器编号", required = false)
     private String instrumentNo;
 
@@ -124,62 +130,62 @@ public class StudentRepair {
     private String feeList;
 
     /**
-    * 问题描述及解决方法
-    */
+     * 问题描述及解决方法
+     */
     @ApiModelProperty(value = "问题描述及解决方法", required = false)
     private String description;
 
     /**
-    * 维修金额
-    */
+     * 维修金额
+     */
     @ApiModelProperty(value = "维修金额", required = false)
     private BigDecimal amount;
 
     /**
-    * 维修完成时间
-    */
+     * 维修完成时间
+     */
     @ApiModelProperty(value = "维修完成时间", required = false)
     private Date finishTime;
 
     /**
-    * 乐器取回方式 0-自取 1-快递
-    */
+     * 乐器取回方式 0-自取 1-快递
+     */
     @ApiModelProperty(value = "乐器取回方式 0-自取 1-快递", required = false)
     private Integer sendType;
 
     /**
-    * 联系人
-    */
+     * 联系人
+     */
     @ApiModelProperty(value = "联系人", required = false)
     private String contactName;
 
     /**
-    * 联系方式
-    */
+     * 联系方式
+     */
     @ApiModelProperty(value = "联系方式", required = false)
     private String contactMobile;
 
     /**
-    * 快递地址
-    */
+     * 快递地址
+     */
     @ApiModelProperty(value = "快递地址", required = false)
     private String address;
 
     /**
-    * 所选商品
-    */
+     * 所选商品
+     */
     @ApiModelProperty(value = "商品", required = false)
     private String goodsJson;
 
     /**
-    * 支付状态 0-未支付 1-支付中 2-已支付
-    */
+     * 支付状态 0-未支付 1-支付中 2-已支付
+     */
     @ApiModelProperty(value = "支付状态 0-未支付 1-支付中 2-已支付", required = false)
     private Integer payStatus;
 
     /**
-    * 维修状态 0维修中,1已完成
-    */
+     * 维修状态 0维修中,1已完成
+     */
     @ApiModelProperty(value = "维修状态 0维修中,1已完成", required = false)
     private Integer repairStatus;
 
@@ -190,14 +196,14 @@ public class StudentRepair {
     private Boolean isUseBalancePayment;
 
     /**
-    * 送修时间
-    */
+     * 送修时间
+     */
     @ApiModelProperty(value = "送修时间", required = true)
     private Date createTime;
 
     /**
-    * 更新时间
-    */
+     * 更新时间
+     */
     @ApiModelProperty(value = "更新时间", required = false)
     private Date updateTime;
 
@@ -469,4 +475,12 @@ public class StudentRepair {
     public void setExemptionAmount(BigDecimal exemptionAmount) {
         this.exemptionAmount = exemptionAmount;
     }
+
+    public Integer getMaintenanceStatus() {
+        return maintenanceStatus;
+    }
+
+    public void setMaintenanceStatus(Integer maintenanceStatus) {
+        this.maintenanceStatus = maintenanceStatus;
+    }
 }

+ 9 - 5
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRepairServiceImpl.java

@@ -379,15 +379,19 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
             throw new BizException("邮寄信息必填");
         }
         Date date = new Date();
+        StudentInstrument studentInstrument = null;
+        if (repairInfo.getStudentInstrumentId() != null) {
+            studentInstrument = studentInstrumentService.get(repairInfo.getStudentInstrumentId());
+        }
+
         if (repairInfo.getExemptionAmount().compareTo(BigDecimal.ZERO) > 0) {
-            if (repairInfo.getStudentInstrumentId() != null) {
-                throw new BizException("学生乐器id不存在,请核查");
-            }
-            StudentInstrument studentInstrument = studentInstrumentService.get(repairInfo.getStudentInstrumentId());
-            if (studentInstrument == null || studentInstrument.getEndTime() == null || studentInstrument.getEndTime().compareTo(date) <=0) {
+            if (studentInstrument == null || studentInstrument.getEndTime() == null || studentInstrument.getEndTime().compareTo(date) <= 0) {
                 throw new BizException("乐保不存在,不能使用特权减免,请核查");
             }
         }
+        if (studentInstrument != null && studentInstrument.getEndTime() != null && studentInstrument.getEndTime().compareTo(date) > 0) {
+            repairInfo.setMaintenanceStatus(1);
+        }
         SysUser student = sysUserFeignService.queryUserById(repairInfo.getStudentId());
         repairInfo.setOrganId(student.getOrganId());
 

+ 4 - 3
mec-biz/src/main/resources/config/mybatis/StudentRepairMapper.xml

@@ -5,6 +5,7 @@
         <result column="id_" jdbcType="INTEGER" property="id"/>
         <result column="music_group_id_" jdbcType="VARCHAR" property="musicGroupId"/>
         <result column="student_instrument_id_" property="studentInstrumentId"/>
+        <result column="maintenance_status_" property="maintenanceStatus"/>
         <result column="repair_name_" property="repairName"/>
         <result column="exemption_amount_" property="exemptionAmount"/>
         <result column="trans_no_" jdbcType="VARCHAR" property="transNo"/>
@@ -47,8 +48,8 @@
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.StudentRepair" useGeneratedKeys="true" keyColumn="id"
             keyProperty="id">
         <!--@mbg.generated-->
-        insert into student_repair (id_,music_group_id_, trans_no_, organ_id_,student_instrument_id_,repair_name_,exemption_amount_,
-        student_id_, student_name_, student_school_,
+        insert into student_repair (id_,music_group_id_, trans_no_, organ_id_,student_instrument_id_,maintenance_status_,
+        repair_name_,exemption_amount_,student_id_, student_name_, student_school_,
         employee_id_, employee_name_, subject_id_,
         subject_name_, type_, instrument_no_,fee_list_,
         description_, amount_, finish_time_,
@@ -56,7 +57,7 @@
         address_, pay_status_, create_time_,
         update_time_,repair_status_,goods_json_)
         values (#{id,jdbcType=INTEGER},#{musicGroupId}, #{transNo,jdbcType=VARCHAR}, #{organId,jdbcType=INTEGER},
-        #{studentInstrumentId},#{repairName},#{exemptionAmount},
+        #{studentInstrumentId},#{maintenanceStatus},#{repairName},#{exemptionAmount},
         #{studentId,jdbcType=INTEGER}, #{studentName,jdbcType=VARCHAR}, #{studentSchool,jdbcType=VARCHAR},
         #{employeeId,jdbcType=INTEGER}, #{employeeName,jdbcType=VARCHAR}, #{subjectId,jdbcType=INTEGER},
         #{subjectName,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, #{instrumentNo,jdbcType=VARCHAR},