mingfu 1 месяц назад
Родитель
Сommit
35f6a3a4d6

+ 9 - 0
ie-admin/src/main/java/com/ruoyi/web/controller/dz/DzSchoolController.java

@@ -71,6 +71,15 @@ public class DzSchoolController extends BaseController
 //            dzSchool.setCampus(false);
 //        }
         dzSchool.setCampus(false);
+        if (StringUtils.isNotBlank(dzSchool.getAreaCode())) {
+            if (dzSchool.getAreaCode().endsWith("0000")) {
+                dzSchool.setPro(Long.parseLong(dzSchool.getAreaCode()));
+            } else if (dzSchool.getAreaCode().endsWith("00")) {
+                dzSchool.setCity(Long.parseLong(dzSchool.getAreaCode()));
+            } else {
+                dzSchool.setArea(Long.parseLong(dzSchool.getAreaCode()));
+            }
+        }
         startPage();
         List<DzSchool> list= dzSchoolService.selectDzSchoolList(dzSchool);
         //处理省市区

+ 6 - 0
ie-admin/src/main/java/com/ruoyi/web/domain/CardUserBody.java

@@ -1,11 +1,14 @@
 package com.ruoyi.web.domain;
 
 import com.alibaba.fastjson2.JSONArray;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import com.ruoyi.common.core.domain.model.RegisterBody;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+import java.util.Date;
+
 @Data
 @ApiModel("卡用户信息")
 public class CardUserBody extends RegisterBody {
@@ -13,4 +16,7 @@ public class CardUserBody extends RegisterBody {
     Long cardId;
     @ApiModelProperty(value = "目标院校", example = "")
     JSONArray directionStudy;
+    @ApiModelProperty(value = "到期日期", example = "2028-08-08")
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    Date outDate;
 }

+ 5 - 3
ie-admin/src/main/java/com/ruoyi/web/service/SysRegisterService.java

@@ -171,8 +171,10 @@ public class SysRegisterService
         upUser.setScores(cardUserBody.getScores());
         upUser.setSchoolId(cardUserBody.getSchoolId());
         upUser.setClassId(cardUserBody.getClassId());
-
-
+        upUser.setPhonenumber(cardUserBody.getMobile());
+        if (!userService.checkPhoneUnique(upUser)) {
+            throw new ValidationException("保存用户'" + upUser.getNickName() + "'失败,注册手机已存在" + cardUserBody.getMobile());
+        }
         JSONObject directed = cardUserBody.getDirectionStudy().getJSONObject(0);
         Long planId = directed.getLongValue("majorId");
         Long universityId = directed.getLongValue("universityId");
@@ -186,7 +188,7 @@ public class SysRegisterService
         upCard.setClassId(cardUserBody.getClassId());
         upCard.setCampusId(cardUserBody.getCampusSchoolId());
         upCard.setCampusClassId(cardUserBody.getCampusClassId());
-
+        upCard.setOutDate(cardUserBody.getOutDate());
         userService.updateUserInfo(upUser);
         cardsService.updateDzCards(upCard);
     }

+ 10 - 0
ie-system/src/main/java/com/ruoyi/dz/domain/DzSchool.java

@@ -54,6 +54,8 @@ public class DzSchool extends BaseEntity
 
     String proCityAreaName ;
 
+    String areaCode;
+
     /** 状态(0:无效,1:有效) */
     @Excel(name = "状态(0:无效,1:有效)")
     private Integer status;
@@ -182,6 +184,14 @@ public class DzSchool extends BaseEntity
         this.campus = campus;
     }
 
+    public String getAreaCode() {
+        return areaCode;
+    }
+
+    public void setAreaCode(String areaCode) {
+        this.areaCode = areaCode;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

+ 1 - 1
ie-system/src/main/java/com/ruoyi/dz/service/impl/DzCardsServiceImpl.java

@@ -378,7 +378,7 @@ public class DzCardsServiceImpl implements IDzCardsService
         List<DzCards> cards = dzCardsMapper.selectCardsByCardIds(cardIds);
         DzCards up = new DzCards();
         if(CardAction.Pay.equals(action)) {
-            if(cards.stream().filter(t -> !t.getPayStatus().equals(PayStatus.UnPay.getVal())).count() > 0) {
+            if(cards.stream().filter(t -> t.getPayStatus().equals(PayStatus.Paid.getVal())).count() > 0) {
                 throw new ValidationException("重复支付已支付卡: " + StringUtils.join(cardIds, ","));
             }
             up.setPayStatus(PayStatus.Paid.getVal());

+ 2 - 1
ie-system/src/main/resources/mapper/dz/DzCardsMapper.xml

@@ -109,7 +109,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <where>
             <if test="cardNo != null  and cardNo != ''"> and c.card_no = #{cardNo}</if>
             <if test="password != null  and password != ''"> and c.password = #{password}</if>
-            <if test="type != null "> and c.type = #{type}</if>
+            <if test="type != null and type == 1 "> and c.type in (6, 2) </if>
+            <if test="type != null and type != 1 "> and c.type = #{type}</if>
             <if test="status != null "> and c.status = #{status}</if>
             <if test="distributeStatus != null "> and distribute_status = #{distributeStatus}</if>
             <if test="timeStatus != null "> and time_status = #{timeStatus}</if>