处理问题

This commit is contained in:
wanggeng 2022-05-23 11:11:02 +08:00
parent 51fe298d3e
commit 0aa4514d84
14 changed files with 126 additions and 8 deletions

View File

@ -0,0 +1,68 @@
package ink.wgink.util;
import ink.wgink.exceptions.ParamsException;
import org.joda.time.DateTime;
/**
* @ClassName: IdCardUtil
* @Description: 身份证工具
* @Author: wanggeng
* @Date: 2022/5/20 22:39
* @Version: 1.0
*/
public class IdCardUtil {
/**
* 获取性别
*
* @param idCard
* @return
*/
public static Integer getSexNumber(String idCard) {
if (!RegexUtil.isIdentity(idCard)) {
throw new ParamsException("身份证格式错误");
}
return Integer.parseInt(idCard.substring(16, 17));
}
/**
* 获取性别
*
* @param idCard
* @return
*/
public static String getSexName(String idCard) {
int sexNumber = getSexNumber(idCard);
if (sexNumber % 2 == 0) {
return "";
} else {
return "";
}
}
/**
* 获得年龄
*
* @param idCard
* @return
*/
public static Integer getAge(String idCard) {
int birthYear = Integer.parseInt(idCard.substring(6, 10));
int birthMonth = Integer.parseInt(idCard.substring(10, 12));
int birthDay = Integer.parseInt(idCard.substring(12, 14));
DateTime now = DateTime.now();
int year = now.getYear();
int month = now.getMonthOfYear();
int day = now.getDayOfMonth();
int age = year - birthYear;
if (month < birthMonth) {
return age - 1;
} else if (month == birthMonth && day < birthDay) {
return age - 1;
}
return age;
}
}

View File

@ -26,6 +26,8 @@ public class EnvManager {
private IEnvDao envDao; private IEnvDao envDao;
private Env env = new Env(); private Env env = new Env();
private EnvManager() {}
public static EnvManager getInstance() { public static EnvManager getInstance() {
return envManager; return envManager;
} }

View File

@ -103,11 +103,11 @@ public class AreaDTO implements Serializable {
} }
public String getAreaMergerName() { public String getAreaMergerName() {
return areaMergerName == null ? "" : areaMergerName; return areaMergerName == null ? "" : areaMergerName.trim();
} }
public void setAreaMergerMame(String areaMergerMame) { public void setAreaMergerName(String areaMergerName) {
this.areaMergerName = areaMergerMame; this.areaMergerName = areaMergerName;
} }
public String getAreaShortName() { public String getAreaShortName() {

View File

@ -119,6 +119,14 @@ public interface IAreaService {
*/ */
List<AreaDTO> listByCode(String areaCode); List<AreaDTO> listByCode(String areaCode);
/**
* 地区字典列表通过地区字典编码
*
* @param areaCodes
* @return
*/
List<AreaDTO> listByCodes(List<String> areaCodes);
/** /**
* 地区字典子列表不包含本级 * 地区字典子列表不包含本级
* *

View File

@ -15,6 +15,7 @@ import ink.wgink.util.string.WStringUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -124,6 +125,16 @@ public class AreaServiceImpl extends DefaultBaseService implements IAreaService
return areaDao.list(params); return areaDao.list(params);
} }
@Override
public List<AreaDTO> listByCodes(List<String> areaCodes) {
if (areaCodes == null || areaCodes.isEmpty()) {
return new ArrayList<>();
}
Map<String, Object> params = getHashMap(1);
params.put("areaCodes", areaCodes);
return areaDao.list(params);
}
@Override @Override
public List<AreaDTO> listSubByCode(String areaCode) { public List<AreaDTO> listSubByCode(String areaCode) {
Map<String, Object> params = getHashMap(4); Map<String, Object> params = getHashMap(4);

View File

@ -219,6 +219,13 @@
#{areaIds[${index}]} #{areaIds[${index}]}
</foreach> </foreach>
</if> </if>
<if test="areaCodes != null and areaCodes.size > 0">
AND
area_code IN
<foreach collection="areaCodes" index="index" open="(" separator="," close=")">
#{areaCodes[${index}]}
</foreach>
</if>
</select> </select>
<!-- 字典详情 --> <!-- 字典详情 -->

View File

@ -2,6 +2,7 @@ package ink.wgink.service.department.service;
import ink.wgink.interfaces.department.IDepartmentBaseService; import ink.wgink.interfaces.department.IDepartmentBaseService;
import ink.wgink.interfaces.department.IDepartmentCheckService; import ink.wgink.interfaces.department.IDepartmentCheckService;
import ink.wgink.pojo.pos.DepartmentPO;
import ink.wgink.pojo.result.UploadExcelResultDTO; import ink.wgink.pojo.result.UploadExcelResultDTO;
import ink.wgink.service.department.pojo.vos.DepartmentVO; import ink.wgink.service.department.pojo.vos.DepartmentVO;
import ink.wgink.service.department.pojo.vos.MergeDepartmentInfoVO; import ink.wgink.service.department.pojo.vos.MergeDepartmentInfoVO;
@ -100,4 +101,11 @@ public interface IDepartmentService extends IDepartmentBaseService, IDepartmentC
*/ */
void resetCode(); void resetCode();
/**
* 部门列表
*
* @param departmentNames
* @return
*/
List<DepartmentPO> listPOByNames(List<String> departmentNames);
} }

View File

@ -539,6 +539,13 @@ public class DepartmentServiceImpl extends DefaultBaseService implements IDepart
return count(params); return count(params);
} }
@Override
public List<DepartmentPO> listPOByNames(List<String> departmentNames) {
Map<String, Object> params = getHashMap(2);
params.put("departmentNames", departmentNames);
return listPO(params);
}
/** /**
* 通过上级ID和新增或修改日期获取组织列表简单模式 * 通过上级ID和新增或修改日期获取组织列表简单模式
* *

View File

@ -668,6 +668,13 @@
#{departmentIds[${index}]} #{departmentIds[${index}]}
</foreach> </foreach>
</if> </if>
<if test="departmentNames != null and departmentNames.size > 0">
AND
department_name IN
<foreach collection="departmentNames" index="index" open="(" separator="," close=")">
#{departmentNames[${index}]}
</foreach>
</if>
<if test="departmentName != null and departmentName != ''"> <if test="departmentName != null and departmentName != ''">
AND AND
department_name = #{departmentName} department_name = #{departmentName}

View File

@ -147,7 +147,7 @@
<label class="layui-form-label layui-form-label-up">选择地区</label> <label class="layui-form-label layui-form-label-up">选择地区</label>
<div class="layui-input-block layui-input-block-down select-area"> <div class="layui-input-block layui-input-block-down select-area">
<input type="hidden" id="departmentAreaCode" name="departmentAreaCode"> <input type="hidden" id="departmentAreaCode" name="departmentAreaCode">
<input type="text" id="departmentAreaName" name="departmentAreaName" class="layui-input" value="" placeholder="请选择地区" maxlength="255" readonly lay-verify="required" style="cursor:pointer;"> <input type="text" id="departmentAreaName" name="departmentAreaName" class="layui-input" value="" placeholder="请选择地区" maxlength="255" readonly style="cursor:pointer;">
<div class="layui-btn-group select-btn"> <div class="layui-btn-group select-btn">
<button type="button" id="areaSelectBtn" class="layui-btn layui-btn-sm layui-btn-primary" title="选择区域"> <button type="button" id="areaSelectBtn" class="layui-btn layui-btn-sm layui-btn-primary" title="选择区域">
<i class="fa fa-circle-thin"></i> <i class="fa fa-circle-thin"></i>

View File

@ -153,7 +153,7 @@
<label class="layui-form-label layui-form-label-up">选择地区</label> <label class="layui-form-label layui-form-label-up">选择地区</label>
<div class="layui-input-block layui-input-block-down select-area"> <div class="layui-input-block layui-input-block-down select-area">
<input type="hidden" id="departmentAreaCode" name="departmentAreaCode"> <input type="hidden" id="departmentAreaCode" name="departmentAreaCode">
<input type="text" id="departmentAreaName" name="departmentAreaName" class="layui-input" value="" placeholder="请选择地区" maxlength="255" readonly lay-verify="required" style="cursor:pointer;"> <input type="text" id="departmentAreaName" name="departmentAreaName" class="layui-input" value="" placeholder="请选择地区" maxlength="255" readonly style="cursor:pointer;">
<div class="layui-btn-group select-btn"> <div class="layui-btn-group select-btn">
<button type="button" id="areaSelectBtn" class="layui-btn layui-btn-sm layui-btn-primary" title="选择区域"> <button type="button" id="areaSelectBtn" class="layui-btn layui-btn-sm layui-btn-primary" title="选择区域">
<i class="fa fa-circle-thin"></i> <i class="fa fa-circle-thin"></i>

View File

@ -160,7 +160,7 @@
<label class="layui-form-label layui-form-label-up">选择地区</label> <label class="layui-form-label layui-form-label-up">选择地区</label>
<div class="layui-input-block layui-input-block-down select-area"> <div class="layui-input-block layui-input-block-down select-area">
<input type="hidden" id="departmentAreaCode" name="departmentAreaCode"> <input type="hidden" id="departmentAreaCode" name="departmentAreaCode">
<input type="text" id="departmentAreaName" name="departmentAreaName" class="layui-input" value="" placeholder="请选择地区" maxlength="255" readonly lay-verify="required" style="cursor:pointer;"> <input type="text" id="departmentAreaName" name="departmentAreaName" class="layui-input" value="" placeholder="请选择地区" maxlength="255" readonly style="cursor:pointer;">
<div class="layui-btn-group select-btn"> <div class="layui-btn-group select-btn">
<button type="button" id="areaSelectBtn" class="layui-btn layui-btn-sm layui-btn-primary" title="选择区域"> <button type="button" id="areaSelectBtn" class="layui-btn layui-btn-sm layui-btn-primary" title="选择区域">
<i class="fa fa-circle-thin"></i> <i class="fa fa-circle-thin"></i>

View File

@ -143,7 +143,7 @@
<label class="layui-form-label layui-form-label-up">选择地区</label> <label class="layui-form-label layui-form-label-up">选择地区</label>
<div class="layui-input-block layui-input-block-down select-area"> <div class="layui-input-block layui-input-block-down select-area">
<input type="hidden" id="departmentAreaCode" name="departmentAreaCode"> <input type="hidden" id="departmentAreaCode" name="departmentAreaCode">
<input type="text" id="departmentAreaName" name="departmentAreaName" class="layui-input" value="" placeholder="请选择地区" maxlength="255" readonly lay-verify="required" style="cursor:pointer;"> <input type="text" id="departmentAreaName" name="departmentAreaName" class="layui-input" value="" placeholder="请选择地区" maxlength="255" readonly style="cursor:pointer;">
<div class="layui-btn-group select-btn"> <div class="layui-btn-group select-btn">
<button type="button" id="areaSelectBtn" class="layui-btn layui-btn-sm layui-btn-primary" title="选择区域"> <button type="button" id="areaSelectBtn" class="layui-btn layui-btn-sm layui-btn-primary" title="选择区域">
<i class="fa fa-circle-thin"></i> <i class="fa fa-circle-thin"></i>

View File

@ -160,7 +160,7 @@
<label class="layui-form-label layui-form-label-up">选择地区</label> <label class="layui-form-label layui-form-label-up">选择地区</label>
<div class="layui-input-block layui-input-block-down select-area"> <div class="layui-input-block layui-input-block-down select-area">
<input type="hidden" id="departmentAreaCode" name="departmentAreaCode"> <input type="hidden" id="departmentAreaCode" name="departmentAreaCode">
<input type="text" id="departmentAreaName" name="departmentAreaName" class="layui-input" value="" placeholder="请选择地区" maxlength="255" readonly lay-verify="required" style="cursor:pointer;"> <input type="text" id="departmentAreaName" name="departmentAreaName" class="layui-input" value="" placeholder="请选择地区" maxlength="255" readonly style="cursor:pointer;">
<div class="layui-btn-group select-btn"> <div class="layui-btn-group select-btn">
<button type="button" id="areaSelectBtn" class="layui-btn layui-btn-sm layui-btn-primary" title="选择区域"> <button type="button" id="areaSelectBtn" class="layui-btn layui-btn-sm layui-btn-primary" title="选择区域">
<i class="fa fa-circle-thin"></i> <i class="fa fa-circle-thin"></i>