sangwenwei 1 рік тому
батько
коміт
663e75d39f

+ 1 - 1
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/holiday/mapper/xml/HolidayMapper.xml

@@ -5,7 +5,7 @@
 <mapper namespace="com.jeeplus.business.holiday.mapper.HolidayMapper">
 <mapper namespace="com.jeeplus.business.holiday.mapper.HolidayMapper">
 
 
     <select id="findPageList" resultType="com.jeeplus.business.holiday.service.dto.HolidayDTO">
     <select id="findPageList" resultType="com.jeeplus.business.holiday.service.dto.HolidayDTO">
-        select
+        select distinct
             a.id,
             a.id,
             a.create_by_id,
             a.create_by_id,
             a.create_time,
             a.create_time,

+ 1 - 1
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/humanResources/mapper/xml/StaffDimissionMapper.xml

@@ -5,7 +5,7 @@
 <mapper namespace="com.jeeplus.business.humanResources.mapper.StaffDimissionMapper">
 <mapper namespace="com.jeeplus.business.humanResources.mapper.StaffDimissionMapper">
 
 
     <select id="findPageList" resultType="com.jeeplus.business.humanResources.service.dto.StaffDimissionDTO">
     <select id="findPageList" resultType="com.jeeplus.business.humanResources.service.dto.StaffDimissionDTO">
-        select
+        select distinct
             a.id,
             a.id,
             a.create_by_id,
             a.create_by_id,
             a.create_time,
             a.create_time,

+ 1 - 1
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/humanResources/mapper/xml/StaffUserInfoMapper.xml

@@ -5,7 +5,7 @@
 <mapper namespace="com.jeeplus.business.humanResources.mapper.StaffUserInfoMapper">
 <mapper namespace="com.jeeplus.business.humanResources.mapper.StaffUserInfoMapper">
 
 
     <select id="findPageList" resultType="com.jeeplus.business.humanResources.service.dto.StaffUserInfoDTO">
     <select id="findPageList" resultType="com.jeeplus.business.humanResources.service.dto.StaffUserInfoDTO">
-        select
+        select distinct
             a.id,
             a.id,
             a.create_by_id,
             a.create_by_id,
             a.create_time,
             a.create_time,

+ 1 - 1
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/inscription/mapper/xml/InscriptionMapper.xml

@@ -5,7 +5,7 @@
 <mapper namespace="com.jeeplus.business.inscription.mapper.InscriptionMapper">
 <mapper namespace="com.jeeplus.business.inscription.mapper.InscriptionMapper">
 
 
     <select id="findPageList" resultType="com.jeeplus.business.inscription.service.dto.InscriptionDTO">
     <select id="findPageList" resultType="com.jeeplus.business.inscription.service.dto.InscriptionDTO">
-        select
+        select distinct
             a.id,
             a.id,
             a.create_by_id,
             a.create_by_id,
             su.name as createName,
             su.name as createName,

+ 1 - 1
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/meetingRoom/mapper/xml/MeetingRoomMapper.xml

@@ -5,7 +5,7 @@
 <mapper namespace="com.jeeplus.business.meetingRoom.mapper.MeetingRoomMapper">
 <mapper namespace="com.jeeplus.business.meetingRoom.mapper.MeetingRoomMapper">
 
 
     <select id="findPageList" resultType="com.jeeplus.business.meetingRoom.domain.MeetingRoom">
     <select id="findPageList" resultType="com.jeeplus.business.meetingRoom.domain.MeetingRoom">
-        select
+        select distinct
             a.id,
             a.id,
             a.create_by_id,
             a.create_by_id,
             su.name as createName,
             su.name as createName,

+ 49 - 46
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/meetingRoom/service/MeetingRoomService.java

@@ -223,60 +223,63 @@ public class MeetingRoomService {
 
 
                 }else {
                 }else {
                     Map<String, String> emptyMap = new HashMap<>();
                     Map<String, String> emptyMap = new HashMap<>();
-                    return emptyMap;
+                    meetingRoomMaps.add(emptyMap);
                 }
                 }
                 meetingRoomMaps.add(hashMap); // 将当前会议的映射添加到列表中
                 meetingRoomMaps.add(hashMap); // 将当前会议的映射添加到列表中
             }
             }
-            //获取当前时间
-            LocalTime now = LocalTime.now();
-            String format1 = now.format(formatter);
-            Time nowDate = Time.valueOf(format1);
-            ArrayList<LocalTime> dateList = new ArrayList<>();
-            //判断当前时间在哪个范围内
-            if ((nowDate.after(am1) && nowDate.before(am2))){
-                // 获取时间段内的所有时间
-                LocalTime currentTime = time1;
-                while (currentTime.isBefore(time2)) {
-                    currentTime = currentTime.plus(30 * 60, ChronoUnit.SECONDS); // 每隔半小时
-                    dateList.add(currentTime);
-                }
-                //将每半个小时的时间进行遍历,与当前时间比较
-                for (LocalTime localTime : dateList) {
-                    Time time = Time.valueOf(localTime);
-                    //如果当前时间在每半小时间隔之后,则将之前的存到map中
-                    if (nowDate.after(time)){
-                        mergedMap.put(time+"",localTime.format(formatter));
+            //将找到的时间重新存入到新的map中
+            if (ObjectUtils.isNotEmpty(meetingRoomMaps)){
+                for (Map<String, String> map : meetingRoomMaps) {
+                    for (Map.Entry<String, String> entry : map.entrySet()) {
+                        String key = entry.getKey();
+                        String value = entry.getValue();
+                        if (mergedMap.containsKey(key)) {
+                            int size = mergedMap.size();
+                            mergedMap.put((size+1)+"",value);
+                        } else {
+                            mergedMap.put(key, value);
+                        }
                     }
                     }
                 }
                 }
             }
             }
-            if ((nowDate.after(pm1) && nowDate.before(pm2))){
-                // 获取时间段内的所有时间
-                LocalTime currentTime = time3;
-                while (currentTime.isBefore(time4)) {
-                    currentTime = currentTime.plus(30 * 60, ChronoUnit.SECONDS); // 每隔半小时
-                    dateList.add(currentTime);
-                }
-                //将每半个小时的时间进行遍历,与当前时间比较
-                for (LocalTime localTime : dateList) {
-                    Time time = Time.valueOf(localTime);
-                    //如果当前时间在每半小时间隔之后,则将之前的存到map中
-                    if (nowDate.after(time)){
-                        mergedMap.put(time+"",localTime.format(formatter));
-                    }
+
+        }
+        //获取当前时间
+        LocalTime now = LocalTime.now();
+        String format1 = now.format(formatter);
+        Time nowDate = Time.valueOf(format1);
+        ArrayList<LocalTime> dateList = new ArrayList<>();
+        //判断当前时间在哪个范围内
+        if ((nowDate.after(am1) && nowDate.before(am2))){
+            // 获取时间段内的所有时间
+            LocalTime currentTime = time1;
+            dateList.add(currentTime);
+            while (currentTime.isBefore(time2)) {
+                currentTime = currentTime.plus(30 * 60, ChronoUnit.SECONDS); // 每隔半小时
+                dateList.add(currentTime);
+            }
+            //将每半个小时的时间进行遍历,与当前时间比较
+            for (LocalTime localTime : dateList) {
+                Time time = Time.valueOf(localTime);
+                //如果当前时间在每半小时间隔之后,则将之前的存到map中
+                if (nowDate.after(time)){
+                    mergedMap.put(time+"",localTime.format(formatter));
                 }
                 }
             }
             }
-
-            //将找到的时间重新存入到新的map中
-            for (Map<String, String> map : meetingRoomMaps) {
-                for (Map.Entry<String, String> entry : map.entrySet()) {
-                    String key = entry.getKey();
-                    String value = entry.getValue();
-                    if (mergedMap.containsKey(key)) {
-                        int size = mergedMap.size();
-                        mergedMap.put((size+1)+"",value);
-                    } else {
-                        mergedMap.put(key, value);
-                    }
+        }
+        if ((nowDate.after(pm1) && nowDate.before(pm2))){
+            // 获取时间段内的所有时间
+            LocalTime currentTime = time3;
+            while (currentTime.isBefore(time4)) {
+                currentTime = currentTime.plus(30 * 60, ChronoUnit.SECONDS); // 每隔半小时
+                dateList.add(currentTime);
+            }
+            //将每半个小时的时间进行遍历,与当前时间比较
+            for (LocalTime localTime : dateList) {
+                Time time = Time.valueOf(localTime);
+                //如果当前时间在每半小时间隔之后,则将之前的存到map中
+                if (nowDate.after(time)){
+                    mergedMap.put(time+"",localTime.format(formatter));
                 }
                 }
             }
             }
         }
         }

+ 66 - 24
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/workContractInfo/service/JyWorkContractService.java

@@ -49,7 +49,7 @@ public class JyWorkContractService {
         if (StringUtils.isNotEmpty(workContractInfoDto.getId())) {
         if (StringUtils.isNotEmpty(workContractInfoDto.getId())) {
             JyWorkContractInfo info = jyWorkContractInfoMapper.selectById(workContractInfoDto.getId());
             JyWorkContractInfo info = jyWorkContractInfoMapper.selectById(workContractInfoDto.getId());
             if (info != null) {
             if (info != null) {
-                workContractInfoDto.setContractTypes(null);
+//                workContractInfoDto.setContractTypes(null);
                 return update(workContractInfoDto);
                 return update(workContractInfoDto);
             }
             }
         }
         }
@@ -152,32 +152,35 @@ public class JyWorkContractService {
         contractTypes = workContractInfoDto.getContractTypes();
         contractTypes = workContractInfoDto.getContractTypes();
         String contractNo="";
         String contractNo="";
         StringBuffer sb = new StringBuffer();
         StringBuffer sb = new StringBuffer();
-        for (List<String> contractType : contractTypes) {
-            if (contractType.size()>0){
-                switch (contractType.get(0)){
-                    case "1": //环境监测
-                        contractNo=SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), JyWorkContractInfoDto.BIZ_CODE4,TokenProvider.getCurrentToken());
-                        break;
-                    case "2": //环境影响评价
-                        contractNo=SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), JyWorkContractInfoDto.BIZ_CODE3,TokenProvider.getCurrentToken());
-                        break;
-                    case "3": //水土保持
-                        contractNo=SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), JyWorkContractInfoDto.BIZ_CODE2,TokenProvider.getCurrentToken());
-                        break;
-                    case "4": //其他
-                        contractNo=SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), JyWorkContractInfoDto.BIZ_CODE1,TokenProvider.getCurrentToken());
-                        break;
-                    default:
-                        return null;
+        if (CollectionUtil.isNotEmpty(contractTypes)){
+            for (List<String> contractType : contractTypes) {
+                if (contractType.size()>0){
+                    switch (contractType.get(0)){
+                        case "1": //环境监测
+                            contractNo=SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), JyWorkContractInfoDto.BIZ_CODE4,TokenProvider.getCurrentToken());
+                            break;
+                        case "2": //环境影响评价
+                            contractNo=SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), JyWorkContractInfoDto.BIZ_CODE3,TokenProvider.getCurrentToken());
+                            break;
+                        case "3": //水土保持
+                            contractNo=SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), JyWorkContractInfoDto.BIZ_CODE2,TokenProvider.getCurrentToken());
+                            break;
+                        case "4": //其他
+                            contractNo=SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), JyWorkContractInfoDto.BIZ_CODE1,TokenProvider.getCurrentToken());
+                            break;
+                        default:
+                            return null;
+                    }
+                }
+                //判断合同类型是否有二级
+                if (contractType.size()>1){
+                    sb.append(contractType.get(1)+",");
+                    newType=sb.substring(0,sb.lastIndexOf(","));
                 }
                 }
-            }
-            //判断合同类型是否有二级
-            if (contractType.size()>1){
-                sb.append(contractType.get(1)+",");
-                newType=sb.substring(0,sb.lastIndexOf(","));
             }
             }
         }
         }
 
 
+
         //生成id
         //生成id
         String id = UUID.randomUUID().toString().replace("-", "");
         String id = UUID.randomUUID().toString().replace("-", "");
 
 
@@ -196,7 +199,9 @@ public class JyWorkContractService {
         info.setClosingDate(workContractInfoDto.getClosingDate()); //结束日期
         info.setClosingDate(workContractInfoDto.getClosingDate()); //结束日期
         info.setContractDate(workContractInfoDto.getContractDate()); //签订日期
         info.setContractDate(workContractInfoDto.getContractDate()); //签订日期
         info.setContractType(newType);//合同类型(小类)
         info.setContractType(newType);//合同类型(小类)
-        info.setContractTypeFirst(contractTypes.get(0).get(0));
+        if (CollectionUtil.isNotEmpty(contractTypes)){
+            info.setContractTypeFirst(contractTypes.get(0).get(0));
+        }
         info.setName(workContractInfoDto.getContractName()); //合同名称
         info.setName(workContractInfoDto.getContractName()); //合同名称
         info.setContractOpposite(workContractInfoDto.getContractOpposite()); //对方合同编号
         info.setContractOpposite(workContractInfoDto.getContractOpposite()); //对方合同编号
         info.setDepartment(workContractInfoDto.getDepartment());//所属部门
         info.setDepartment(workContractInfoDto.getDepartment());//所属部门
@@ -240,6 +245,43 @@ public class JyWorkContractService {
 //        info.setNo(serialNum);
 //        info.setNo(serialNum);
         info.setUpdateById(userDTO.getId());
         info.setUpdateById(userDTO.getId());
         info.setUpdateTime(new Date());
         info.setUpdateTime(new Date());
+        if (StringUtils.isBlank(workContractInfoDto.getContractNo())){
+            //合同编号生成
+            List<List<String>> contractTypes = new ArrayList<>();
+            String newType="";
+            contractTypes = workContractInfoDto.getContractTypes();
+            String contractNo="";
+            StringBuffer sb = new StringBuffer();
+            for (List<String> contractType : contractTypes) {
+                if (contractType.size()>0){
+                    switch (contractType.get(0)){
+                        case "1": //环境监测
+                            contractNo=SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), JyWorkContractInfoDto.BIZ_CODE4,TokenProvider.getCurrentToken());
+                            break;
+                        case "2": //环境影响评价
+                            contractNo=SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), JyWorkContractInfoDto.BIZ_CODE3,TokenProvider.getCurrentToken());
+                            break;
+                        case "3": //水土保持
+                            contractNo=SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), JyWorkContractInfoDto.BIZ_CODE2,TokenProvider.getCurrentToken());
+                            break;
+                        case "4": //其他
+                            contractNo=SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), JyWorkContractInfoDto.BIZ_CODE1,TokenProvider.getCurrentToken());
+                            break;
+                        default:
+                            return null;
+                    }
+                }
+                //判断合同类型是否有二级
+                if (contractType.size()>1){
+                    sb.append(contractType.get(1)+",");
+                    newType=sb.substring(0,sb.lastIndexOf(","));
+                }
+            }
+            info.setNo(contractNo); //合同编号
+            info.setContractType(newType);//合同类型(小类)
+            info.setContractTypeFirst(contractTypes.get(0).get(0));
+        }
+        info.setName(workContractInfoDto.getContractName()); //合同名称
         jyWorkContractInfoMapper.updateById(info);
         jyWorkContractInfoMapper.updateById(info);
         List<WorkAttachmentInfo> list = workContractInfoDto.getWorkAttachmentList();
         List<WorkAttachmentInfo> list = workContractInfoDto.getWorkAttachmentList();
 //        if (CollectionUtil.isNotEmpty(list)) {
 //        if (CollectionUtil.isNotEmpty(list)) {

+ 2 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/workContractInfo/service/dto/JyWorkContractInfoDto.java

@@ -173,4 +173,6 @@ public class JyWorkContractInfoDto extends BaseDTO implements Serializable {
 
 
     private String name;
     private String name;
 
 
+    private String contractNo;
+
 }
 }