Browse Source

Merge branch 'dev_vaccine_change'

dev
zxc 3 years ago
parent
commit
2bb1c0a801
  1. 2
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcEpidemicSpecialAttentionDTO.java
  2. 32
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VaccinationListResultDTO.java
  3. 3
      epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.60__alter_ic_epidemic_special_attention.sql
  4. 4
      epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml

2
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcEpidemicSpecialAttentionDTO.java

@ -70,7 +70,7 @@ public class IcEpidemicSpecialAttentionDTO implements Serializable {
/** /**
* 手机号 * 手机号
*/ */
@NotBlank(message = "mobile不能为空",groups = IcEpidemicSpecialAttentionAdd.class) // @NotBlank(message = "mobile不能为空",groups = IcEpidemicSpecialAttentionAdd.class)
private String mobile; private String mobile;
/** /**

32
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VaccinationListResultDTO.java

@ -5,6 +5,7 @@ import lombok.Data;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import java.io.Serializable; import java.io.Serializable;
import java.util.regex.Pattern;
/** /**
* @Author zxc * @Author zxc
@ -118,16 +119,26 @@ public class VaccinationListResultDTO implements Serializable {
this.sex = "未知"; this.sex = "未知";
}else { }else {
if (this.idCard.length() == NumConstant.FIFTEEN){ if (this.idCard.length() == NumConstant.FIFTEEN){
if (Integer.parseInt(this.idCard.substring(NumConstant.FOURTEEN, NumConstant.FIFTEEN)) % NumConstant.TWO == NumConstant.ZERO) { String substring = this.idCard.substring(NumConstant.FOURTEEN, NumConstant.FIFTEEN);
sex = "女"; if (!isNumeric2(substring)){
} else { this.sex = "未知";
sex = "男"; }else {
if (Integer.parseInt(substring) % NumConstant.TWO == NumConstant.ZERO) {
sex = "女";
} else {
sex = "男";
}
} }
}else if (this.idCard.length() == NumConstant.EIGHTEEN){ }else if (this.idCard.length() == NumConstant.EIGHTEEN){
if (Integer.parseInt(this.idCard.substring(NumConstant.SIXTEEN).substring(NumConstant.ZERO,NumConstant.ONE)) % NumConstant.TWO == NumConstant.ZERO) { String substring = this.idCard.substring(NumConstant.SIXTEEN).substring(NumConstant.ZERO, NumConstant.ONE);
sex = "女"; if (!isNumeric2(substring)){
} else { this.sex = "未知";
sex = "男"; }else {
if (Integer.parseInt(substring) % NumConstant.TWO == NumConstant.ZERO) {
sex = "女";
} else {
sex = "男";
}
} }
}else { }else {
this.sex = "未知"; this.sex = "未知";
@ -135,4 +146,9 @@ public class VaccinationListResultDTO implements Serializable {
} }
} }
private static final Pattern NUMBER_PATTERN = Pattern.compile("-?\\d+(\\.\\d+)?");
public static boolean isNumeric2(String str) {
return str != null && NUMBER_PATTERN.matcher(str).matches();
}
} }

3
epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.60__alter_ic_epidemic_special_attention.sql

@ -0,0 +1,3 @@
ALTER TABLE `ic_epidemic_special_attention`
MODIFY COLUMN `MOBILE` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '手机号';

4
epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml

@ -36,7 +36,7 @@
LEFT JOIN ic_resi_user b ON a.id_card = b.id_card AND b.del_flag = '0' and b.CUSTOMER_ID=a.CUSTOMER_ID LEFT JOIN ic_resi_user b ON a.id_card = b.id_card AND b.del_flag = '0' and b.CUSTOMER_ID=a.CUSTOMER_ID
LEFT JOIN (SELECT id_card , CUSTOMER_ID, count(1) AS vaccinationCount, CREATED_TIME FROM ic_vaccine WHERE DEL_FLAG = 0 GROUP BY ID_CARD, CUSTOMER_ID) v ON (v.ID_CARD = a.ID_CARD and v.CUSTOMER_ID=a.CUSTOMER_ID) LEFT JOIN (SELECT id_card , CUSTOMER_ID, count(1) AS vaccinationCount, CREATED_TIME FROM ic_vaccine WHERE DEL_FLAG = 0 GROUP BY ID_CARD, CUSTOMER_ID) v ON (v.ID_CARD = a.ID_CARD and v.CUSTOMER_ID=a.CUSTOMER_ID)
WHERE a.DEL_FLAG = 0 WHERE a.DEL_FLAG = 0
AND a.ORG_ID = #{orgId} AND concat(a.pids,':',#{orgId}) like concat('%',#{orgId},'%')
AND a.ATTENTION_TYPE = #{attentionType} AND a.ATTENTION_TYPE = #{attentionType}
<if test='null != name and "" != name'> <if test='null != name and "" != name'>
AND a.`NAME` LIKE CONCAT('%',#{name},'%') AND a.`NAME` LIKE CONCAT('%',#{name},'%')
@ -87,7 +87,7 @@
FROM ic_epidemic_special_attention a FROM ic_epidemic_special_attention a
LEFT JOIN ic_resi_user b ON a.id_card = b.id_card AND b.del_flag = '0' and a.CUSTOMER_ID = b.CUSTOMER_ID LEFT JOIN ic_resi_user b ON a.id_card = b.id_card AND b.del_flag = '0' and a.CUSTOMER_ID = b.CUSTOMER_ID
WHERE a.DEL_FLAG = 0 WHERE a.DEL_FLAG = 0
AND a.ORG_ID = #{orgId} AND concat(a.pids,':',#{orgId}) like concat('%',#{orgId},'%')
AND a.ATTENTION_TYPE = #{attentionType} AND a.ATTENTION_TYPE = #{attentionType}
<if test='null != name and "" != name'> <if test='null != name and "" != name'>
AND a.`NAME` LIKE CONCAT('%',#{name},'%') AND a.`NAME` LIKE CONCAT('%',#{name},'%')

Loading…
Cancel
Save