LiGuang 2 anni fa
parent
commit
d77af16d49

+ 2 - 1
jeecg-boot-module-demo/src/main/java/org/jeecg/modules/geke/makeUpCard/mapper/xml/MakeUpCardMapper.xml

@@ -16,11 +16,12 @@
     </delete>
     <select id="lists" resultType="org.jeecg.modules.geke.makeUpCard.entity.MakeUpCard">
         select a.id, a.code,a.commit_date as 'commitDate',a.state,a.demo,a.time,b.realname as 'userId',c.depart_name as'dept',c.org_type as 'order'
-            ,c.org_code as 'deptCode'
+            ,c.org_code as 'deptCode',vi.one_dept as 'deptName',vi.last_dept as 'deptName2'
             from geke_make_up_card a
             left join sys_user b on a.user_id=b.id
             left join sys_user_depart d on b.id=d.user_id
             left join sys_depart c on d.dep_id=c.id
+            left join  view_all_dept vi on b.id=vi.id
             where b.del_flag='0'
         <if test="code!=null and ''!=code">
             and a.code LIKE concat(concat('%',#{code}),'%')

+ 2 - 2
jeecg-boot-module-demo/src/main/java/org/jeecg/modules/geke/makeUpCard/service/impl/MakeUpCardServiceImpl.java

@@ -37,7 +37,7 @@ public class MakeUpCardServiceImpl extends ServiceImpl<MakeUpCardMapper, MakeUpC
             subDepIdsByDepId= makeUpCardMapper.getSubDepIdsByDepId(dept);
        }
         List<MakeUpCard> lists = makeUpCardMapper.lists(page, code, username, subDepIdsByDepId, date);
-        if (lists!=null&&lists.size()>0){
+        /*if (lists!=null&&lists.size()>0){
             lists.forEach(str->{
                 String codet=str.getDeptCode();
                 List<String>codes=new ArrayList<>();
@@ -58,7 +58,7 @@ public class MakeUpCardServiceImpl extends ServiceImpl<MakeUpCardMapper, MakeUpC
                 }
 
             });
-        }
+        }*/
         return page.setRecords(lists);
     }
 

+ 31 - 31
jeecg-boot-module-demo/src/main/java/org/jeecg/modules/geke/userShift/entity/UserShiftExcel.java

@@ -33,97 +33,97 @@ public class UserShiftExcel implements java.io.Serializable {
 	@Excel(name = "部门", width = 15)
 	private String depname;
 
-	@Excel(name = "1号", width = 15)
+	@Excel(name = "1日", width = 10)
 	private String a1;
 
-	@Excel(name = "2号", width = 15)
+	@Excel(name = "2日", width = 10)
 	private String a2;
 
-	@Excel(name = "3号", width = 15)
+	@Excel(name = "3日", width = 10)
 	private String a3;
 
-	@Excel(name = "4号", width = 15)
+	@Excel(name = "4日", width = 10)
 	private String a4;
 
-	@Excel(name = "5号", width = 15)
+	@Excel(name = "5日", width = 10)
 	private String a5;
 
-	@Excel(name = "6号", width = 15)
+	@Excel(name = "6日", width = 10)
 	private String a6;
 
-	@Excel(name = "7号", width = 15)
+	@Excel(name = "7日", width = 10)
 	private String a7;
 
-	@Excel(name = "8号", width = 15)
+	@Excel(name = "8日", width = 10)
 	private String a8;
 
-	@Excel(name = "9号", width = 15)
+	@Excel(name = "9日", width = 10)
 	private String a9;
 
-	@Excel(name = "10号", width = 15)
+	@Excel(name = "10日", width = 10)
 	private String a10;
 
-	@Excel(name = "11号", width = 15)
+	@Excel(name = "11日", width = 10)
 	private String a11;
 
-	@Excel(name = "12号", width = 15)
+	@Excel(name = "12日", width = 10)
 	private String a12;
 
-	@Excel(name = "13号", width = 15)
+	@Excel(name = "13日", width = 10)
 	private String a13;
 
-	@Excel(name = "14号", width = 15)
+	@Excel(name = "14日", width = 10)
 	private String a14;
 
-	@Excel(name = "15号", width = 15)
+	@Excel(name = "15日", width = 10)
 	private String a15;
 
-	@Excel(name = "16号", width = 15)
+	@Excel(name = "16日", width = 10)
 	private String a16;
 
-	@Excel(name = "17号", width = 15)
+	@Excel(name = "17日", width = 10)
 	private String a17;
 
-	@Excel(name = "18号", width = 15)
+	@Excel(name = "18日", width = 10)
 	private String a18;
 
-	@Excel(name = "19号", width = 15)
+	@Excel(name = "19日", width = 10)
 	private String a19;
 
-	@Excel(name = "20号", width = 15)
+	@Excel(name = "20日", width = 10)
 	private String a20;
 
-	@Excel(name = "21号", width = 15)
+	@Excel(name = "21日", width = 10)
 	private String a21;
 
-	@Excel(name = "22号", width = 15)
+	@Excel(name = "22日", width = 10)
 	private String a22;
 
-	@Excel(name = "23号", width = 15)
+	@Excel(name = "23日", width = 10)
 	private String a23;
 
-	@Excel(name = "24号", width = 15)
+	@Excel(name = "24日", width = 10)
 	private String a24;
 
-	@Excel(name = "25号", width = 15)
+	@Excel(name = "25日", width = 10)
 	private String a25;
 
-	@Excel(name = "26号", width = 15)
+	@Excel(name = "26日", width = 10)
 	private String a26;
 
-	@Excel(name = "27号", width = 15)
+	@Excel(name = "27日", width = 10)
 	private String a27;
 
-	@Excel(name = "28号", width = 15)
+	@Excel(name = "28日", width = 10)
 	private String a28;
 
-	@Excel(name = "29号", width = 15)
+	@Excel(name = "29日", width = 10)
 	private String a29;
 
-	@Excel(name = "30号", width = 15)
+	@Excel(name = "30日", width = 10)
 	private String a30;
 
-	@Excel(name = "31号", width = 15)
+	@Excel(name = "31日", width = 10)
 	private String a31;
 
 

+ 1 - 1
jeecg-boot-module-demo/src/main/java/org/jeecg/modules/geke/vacation/mapper/xml/VacationMapper.xml

@@ -123,7 +123,7 @@
         left join sys_user_depart c on b.id=c.user_id
         left join sys_depart d on c.dep_id=d.id
         left join view_all_dept vi  on vi.id=b.id
-        where 1=1
+        where b.id is not null
         <if test="vacation.realname!=null and ''!=vacation.realname">
             and b.realname like concat(concat('%',#{vacation.realname}),'%')
         </if>

+ 48 - 6
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysUserController.java

@@ -44,6 +44,8 @@ import org.jeecg.modules.geke.attendanceRule.entity.AttendanceRule;
 import org.jeecg.modules.geke.attendanceRule.service.IAttendanceRuleService;
 import org.jeecg.modules.geke.historyWages.entity.HistoryWages;
 import org.jeecg.modules.geke.historyWages.service.IHistoryWagesService;
+import org.jeecg.modules.geke.shift.entity.Shift;
+import org.jeecg.modules.geke.shift.service.IShiftService;
 import org.jeecg.modules.geke.sysFile.entity.SysFile;
 import org.jeecg.modules.geke.sysFile.service.ISysFileService;
 import org.jeecg.modules.geke.userRule.service.IUserRuleService;
@@ -91,6 +93,7 @@ import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
+import java.math.BigDecimal;
 import java.text.ParseException;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
@@ -190,6 +193,9 @@ public class SysUserController {
     @Autowired
     private  IWeixinUserService weixinUserService;
 
+    @Autowired
+    private IShiftService shiftService;
+
 
 
     /**
@@ -335,6 +341,8 @@ public class SysUserController {
                 orderItem.setColumn("one_dept");
             }if (s[0].equals("del3")){
                 orderItem.setColumn("last_dept");
+            }if (s[0].equals("cend_date")){
+                orderItem.setColumn("cu.end_date");
             }
             orderItems.add(orderItem);
         }
@@ -392,11 +400,11 @@ public class SysUserController {
         if(userIds!=null && userIds.size()>0){
             Map<String,String>  useDepNames = sysUserService.getDepNamesByUserIds(userIds);
             pageList.getRecords().forEach(item->{
-                List<UserContract> list = userContractService.list(item.getId());
+               /* List<UserContract> list = userContractService.list(item.getId());
                 if (list!=null&&list.size()>0){
                     item.setContractType(list.get(0).getContractType());
                     item.setCEndDate(list.get(0).getEndDate());
-                }
+                }*/
                 String bankCard = item.getBankCard();
                 item.setOrgCodeTxt(useDepNames.get(item.getId()));
                 List<UserQuit> userIds1 = userQuitService.getUserIds(item.getId());
@@ -557,6 +565,9 @@ public class SysUserController {
                     }
                 }if (f){
                     user.setIsSalary("1");
+                }if (!user.getCategory().equals(105)&&!user.getCategory().equals(106)){
+                    user.setEpibolyType(null);
+                   sysUserService.editType(user.getId());
                 }
 				sysUserService.editUserWithRole(user, roles);
                 sysUserService.editUserWithDepart(user, departs);
@@ -889,6 +900,8 @@ public class SysUserController {
                 orderItem.setColumn("one_dept");
             }if (s[0].equals("del3")){
                 orderItem.setColumn("last_dept");
+            }if (s[0].equals("cend_date")){
+                orderItem.setColumn("cu.end_date");
             }
             orderItems.add(orderItem);
         }
@@ -905,11 +918,11 @@ public class SysUserController {
         String rzEndDate="";
         String syStartDate="";
         String syEndDate="";
-        if (oConvertUtils.isNotEmpty(sysUser.getRzDate())){
+        if (oConvertUtils.isNotEmpty(sysUser.getRzDate())&&!sysUser.getRzDate().equals(",")){
             String[] split = sysUser.getRzDate().split(",");
             rzStartDate=split[0];
             rzEndDate=split[1];
-        }if (oConvertUtils.isNotEmpty(sysUser.getSyDate())){
+        }if (oConvertUtils.isNotEmpty(sysUser.getSyDate())&&!sysUser.getSyDate().equals(",")){
             String[] split = sysUser.getSyDate().split(",");
             syStartDate=split[0];
             syEndDate=split[1];
@@ -979,6 +992,10 @@ public class SysUserController {
                        }else {
                            item.setIsAttendance("否");
                        }
+                   }if (oConvertUtils.isNotEmpty(item.getEntryDate())){
+                       int year = getYear(item.getEntryDate(), new Date());
+                       item.setDivisionMoth(String.valueOf(year));
+                       item.setWorkMoth(String.valueOf(Integer.parseInt(item.getWorkMoth())+year));
                    }
                    List<String> orgName = sysUserService.getOrgName(item.getId());
                    List<SysUserDepVo> depNamesByUserIds = sysUserMapper.getDepNamesByUserIds(Arrays.asList(item.getId().split(",")));
@@ -1061,6 +1078,15 @@ public class SysUserController {
     }
 
 
+    public  int getYear(Date start,Date end){
+        int yearCount=0;
+        double seconds = Math.floor((end.getTime() - start.getTime()) / 1000);
+        double minutes = Math.floor(seconds / 60);
+        double hours = Math.floor(minutes / 60);
+        double days = Math.floor(hours / 24);
+        double months = Math.floor(days / 30);
+        return (int)months;
+    }
 
     /**
      * 导出excel 员工年假调休
@@ -1320,14 +1346,25 @@ public class SysUserController {
                 pageList.add(us);
             });
         }
-
+        Page<Shift> pages = new Page<Shift>(1, 10000);
+        Page<Shift> lists = shiftService.lists(pages, new Shift());
+        String str="";
+        if (lists.getRecords().size()>0){
+            for (Shift record : lists.getRecords()) {
+                if (record.getShiftType().equals("1")){
+                    str+=record.getName()+DateUtils.formatDate(record.getStartDate(),"HH:mm")+"-"+DateUtils.formatDate(record.getEndDate(),"HH:mm")+","+DateUtils.formatDate(record.getStart2Date(),"HH:mm")+"-"+DateUtils.formatDate(record.getEnd2Date(),"HH:mm")+";";
+                }else {
+                    str+=record.getName()+DateUtils.formatDate(record.getStartDate(),"HH:mm")+"-"+DateUtils.formatDate(record.getEndDate(),"HH:mm")+";";
+                }
+            }
+        }
         //导出文件名称
         mv.addObject(NormalExcelConstants.FILE_NAME, "员工排班信息");
         mv.addObject(NormalExcelConstants.CLASS, UserShiftExcel.class);
         LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
         String sName="员工排班信息";
 
-        ExportParams exportParams = new ExportParams("员工排班信息", "导出人:"+user.getRealname(), sName);
+        ExportParams exportParams = new ExportParams("员工排班信息", str, sName);
         exportParams.setImageBasePath(upLoadPath);
         mv.addObject(NormalExcelConstants.PARAMS, exportParams);
         mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
@@ -1783,6 +1820,11 @@ public class SysUserController {
             sysUserRoleVO.getUserIdList().forEach(str->{
                 sysUserRoleService.deleteUserid(str);
             });
+            String identity="1";
+            if (sysUserRoleVO.getRoleId().equals("1462659329857978370")){
+                identity="2";
+            }
+            sysUserService.editIdentity(identity,sysUserRoleVO.getUserIdList());
             String sysRoleId = sysUserRoleVO.getRoleId();
             for(String sysUserId:sysUserRoleVO.getUserIdList()) {
                 SysUserRole sysUserRole = new SysUserRole(sysUserId,sysRoleId);

+ 4 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/entity/SysUser.java

@@ -344,6 +344,9 @@ public class SysUser implements Serializable {
     @Dict(dicCode = "user_status")
     private Integer status;
 
+    @Dict(dicCode = "epiboly_type")
+    private  String epibolyType;
+
     /**
      * 删除状态(0,正常,1已删除)
      */
@@ -354,6 +357,7 @@ public class SysUser implements Serializable {
 
 
 
+
     /**
      * 是否算薪 0是 1否
      */

+ 4 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/SysUserMapper.java

@@ -243,5 +243,9 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
 	boolean editQuit(@Param("userid")String userid,@Param("date") Date date);
 	//根据工号查询
 	SysUser getOneByWorkNo(@Param("workNo")String workNo);
+	//清空外包状态
+	boolean editType(@Param("userid")String userid);
+	//批量修改员工是否为部门负责人
+	boolean editIdentity(@Param("identity")String identity,@Param("userids")List<String>userids);
 
 }

+ 15 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/xml/SysUserMapper.xml

@@ -201,6 +201,19 @@
 	<update id="editQuit">
 		update sys_user set employment_status='30',term_date=#{date} where id=#{userid}
 	</update>
+    <update id="editType">
+		update sys_user set epiboly_type= null where id=#{userid}
+	</update>
+	<update id="editIdentity">
+		update sys_user set sy_state='0',user_identity=#{identity} where 1=1
+		<if test="userids!=null and userids.size()>0">
+			and id in
+			<foreach collection="userids" index="index" item="id" open="(" separator="," close=")">
+				#{id}
+			</foreach>
+
+		</if>
+	</update>
 
 
 	<!-- 通过多个部门IDS,查询部门下的用户信息 -->
@@ -448,11 +461,12 @@ on a.depart_name=b.orgCodeTxt
 	</select>
 
 	<select id="kQueryUser"  resultMap="userMap">
-		select DISTINCT a.*,d.type as 'type',vi.one_dept as 'del2',vi.last_dept as 'del3' from sys_user a
+		select DISTINCT a.*,d.type as 'type',vi.one_dept as 'del2',vi.last_dept as 'del3',cu.contract_type,cu.end_date as 'cEndDate' from sys_user a
 		left join sys_user_depart b on a.id=b.user_id
 		left join sys_depart c on b.dep_id=c.id
 		left join geke_attendance_rule d on a.id=d.user_id
 		left join view_all_dept vi on a.id=vi.id
+		left join (select *from geke_user_contract where date_format(now(), '%Y-%m-%d') BETWEEN date_format(start_date, '%Y-%m-%d') and date_format(end_date, '%Y-%m-%d')) cu on cu.user_id=a.id
 		where a.del_flag='0'
 		<if test="user.realname!=null and ''!=user.realname">
 			and a.realname like concat(concat('%',#{user.realname}),'%')

+ 4 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/ISysUserService.java

@@ -330,4 +330,8 @@ List<String>  departIds(String userid);
 
 	SysUser getOneByWorkNo(String workNo);
 
+	boolean editType(String userid);
+
+	boolean editIdentity(String identity,List<String>userids);
+
 }

+ 10 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/SysUserServiceImpl.java

@@ -705,6 +705,16 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
 		return userMapper.getOneByWorkNo(workNo);
 	}
 
+	@Override
+	public boolean editIdentity(String identity, List<String> userids) {
+		return userMapper.editIdentity(identity,userids);
+	}
+
+	@Override
+	public boolean editType(String userid) {
+		return userMapper.editType(userid);
+	}
+
 
 	/**
 	 * 循环获取字典数据 树

+ 1 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/WeixinUserImpl.java

@@ -637,6 +637,7 @@ public class WeixinUserImpl implements IWeixinUserService{
         return ls;
     }
 
+
     /**
      * 同步考勤信息到中间平台
      * @param date