Jelajahi Sumber

Merge branch 'master' of https://mx.jqmoyan.com/ch-校园卡/backend_dormitory

liu 2 bulan lalu
induk
melakukan
56b997710a

+ 5 - 4
src/main/java/com/template/api/WelcomeStudentControllerAPI.java

@@ -1,10 +1,7 @@
 package com.template.api;
 
 import com.template.model.pojo.WelcomeStudent;
-import com.template.model.request.InfoCollectionRequest;
-import com.template.model.request.InsertStudentRequest;
-import com.template.model.request.RegisterRequest;
-import com.template.model.request.updateStudentRequest;
+import com.template.model.request.*;
 import com.template.model.result.CommonResult;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -21,6 +18,10 @@ import java.text.ParseException;
 @Api(tags = {"WelcomeStudentController"}, value = "学生信息管理")
 public interface WelcomeStudentControllerAPI {
 
+    @PostMapping(value = "/insertRemark")
+    @ApiOperation(value = "添加学生备注", notes = "添加学生备注", httpMethod = "POST")
+    CommonResult insertRemark(@Validated @RequestBody insertRemarkRequest irp, BindingResult bindingResult) throws Exception;
+
     @PostMapping(value = "/insertStudentInfo")
     @ApiOperation(value = "添加学生信息", notes = "添加学生信息", httpMethod = "POST")
     CommonResult insertStudentInfo(@Validated @RequestBody InsertStudentRequest isr, BindingResult bindingResult) throws Exception;

+ 24 - 4
src/main/java/com/template/controller/WelcomeStudentController.java

@@ -16,10 +16,7 @@ import com.template.common.utils.*;
 import com.template.model.enumModel.eFileType;
 import com.template.model.enumModel.eSchool;
 import com.template.model.pojo.*;
-import com.template.model.request.InfoCollectionRequest;
-import com.template.model.request.InsertFamilyRequest;
-import com.template.model.request.InsertStudentRequest;
-import com.template.model.request.updateStudentRequest;
+import com.template.model.request.*;
 import com.template.model.result.CommonResult;
 import com.template.model.result.PageUtils;
 import com.template.model.vo.*;
@@ -111,6 +108,29 @@ public class WelcomeStudentController implements WelcomeStudentControllerAPI {
     private static Logger logger = LoggerFactory.getLogger(WelcomeStudentController.class);
 
     @Override
+    public CommonResult insertRemark(insertRemarkRequest irp, BindingResult bindingResult) throws Exception {
+        if (bindingResult.hasErrors()) {
+            String st = paramUtils.getParamError(bindingResult);
+            return CommonResult.fail(st);
+        }
+        WelcomeStudent student = welcomeStudentService.getManageById(irp.getId());
+
+        if(student == null){
+            return CommonResult.fail("学生信息已失效,无法添加备注");
+        }
+
+        if(student.getIsRegistered().intValue() == 1){
+            return CommonResult.fail("已报到学生无法添加备注");
+        }
+
+        student.setRemark(student.getRemark()+""+TimeExchange.getTime()+":"+irp.getRemark()+";");
+
+        int result = welcomeStudentService.updateWelcomeStudent(student);
+
+        return result < 0 ? CommonResult.fail("添加备注失败") : CommonResult.ok("添加备注成功");
+    }
+
+    @Override
     @AWelcomeLog("新增学生信息管理")
     @AWelcomeTypeLog("新增")
     @AWelcomeLogMode("学生信息管理")

+ 3 - 0
src/main/java/com/template/model/pojo/WelcomeStudent.java

@@ -209,6 +209,9 @@ public class WelcomeStudent implements Serializable {
     @ApiModelProperty(value = "是否已报到")
     private Integer isRegistered;
 
+    @ApiModelProperty(value = "备注")
+    private String remark;
+
     @ApiModelProperty(value = "创建时间")
     @TableField(fill = FieldFill.INSERT)
     private Date createTime;

+ 22 - 0
src/main/java/com/template/model/request/insertRemarkRequest.java

@@ -0,0 +1,22 @@
+package com.template.model.request;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import java.math.BigDecimal;
+
+/**
+ * 修改密码
+ */
+@Data
+public class insertRemarkRequest {
+    @NotNull(message = "学生ID不能为空")
+    private Integer id;
+
+    @NotBlank(message = "备注不能为空")
+    private String remark;
+
+
+}

+ 3 - 0
src/main/java/com/template/model/vo/StudentPageVo.java

@@ -98,4 +98,7 @@ public class StudentPageVo {
     @JsonIgnore
     @ApiModelProperty(value = "层次")
     private String batchValue;
+
+    @ApiModelProperty(value = "备注")
+    private String remark;
 }

+ 2 - 1
src/main/resources/mapper/template/WelcomeStudentMapper.xml

@@ -27,6 +27,7 @@
         <result property="collegeId" column="college_id"/>
         <result property="majorId" column="major_id"/>
         <result property="batchValue" column="batch_value"/>
+        <result property="remark" column="remark"/>
     </resultMap>
 
     <select id="queryStudentPageList" resultType="com.template.model.vo.StudentPageVo" resultMap="studentPageMap">
@@ -34,7 +35,7 @@
         ws.id,ws.admiss_num,ws.name,ws.card_id,ws.college,ws.major,ws.classstr,
         ws.traffic_method,ws.arrive,ws.amount_payable,ws.pay_amount,ws.fill_status,
         CONCAT(wsd.build, '-', wsd.dormitory, '-', wsd.number) as dormitory,ws.sex,ws.is_registered as isRegistered,wv.car_number as carNumber,ws.phone,wf.`name` as familyName,
-        wf.phone as familyPhone,ws.arrvie_date as arrvieDate,ws.is_pay,ws.college_id,ws.major_id,ws.batch_value
+        wf.phone as familyPhone,ws.arrvie_date as arrvieDate,ws.is_pay,ws.college_id,ws.major_id,ws.batch_value,ws.remark
         from welcome_student ws
         left join welcome_bed wsd on wsd.deleted =0 and wsd.student_card = ws.card_id
         left join welcome_visitor wv on wv.deleted =0 and wv.student_card = ws.card_id