LiGuang 3 سال پیش
والد
کامیت
fffab532c2

+ 26 - 12
jeecg-boot-module-demo/src/main/java/org/jeecg/modules/geke/userShift/controller/UserShiftController.java

@@ -191,7 +191,7 @@ public class UserShiftController extends JeecgController<UserShift, IUserShiftSe
 	  * @param response
 	  * @return
 	  */
-	 @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+	 /*@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
 	 public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
 		 MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
 		 Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
@@ -638,7 +638,7 @@ public class UserShiftController extends JeecgController<UserShift, IUserShiftSe
 			 }
 		 }
 		 return Result.error("文件导入失败!");
-	 }
+	 }*/
 	  /**
 	   * 通过excel导入数据
 	   *
@@ -646,7 +646,7 @@ public class UserShiftController extends JeecgController<UserShift, IUserShiftSe
 	   * @param response
 	   * @return
 	   */
-	/*  @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+	  @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
 	  public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) throws IOException {
 		  MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
 		  Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
@@ -756,9 +756,9 @@ public class UserShiftController extends JeecgController<UserShift, IUserShiftSe
 								  }
 								  for (String s : lst) {
 									  List<String> leavs = statutoryLeaveService.getList(s);
-									  Object os = dataMap.get("a" + s.split("-")[1]);
-									  if (os != null && os.equals("法") && leavs == null) {
-										  errs.add("第" + index + "行,排班有误");
+									  Object os = dataMap.get("a" + s.split("-")[2]);
+									  if (os != null && os.equals("法") && leavs.size()<1) {
+										  errs.add(o.getName()+","+"排班有误");
 										  break;
 									  } else if (os != null) {
 										  if (!os.equals("休")) {
@@ -766,20 +766,31 @@ public class UserShiftController extends JeecgController<UserShift, IUserShiftSe
 										  } else {
 											  sum++;
 										  }
+									  }else if (oConvertUtils.isEmpty(os)&&leavs.size()>0){
+										  for (String leav : leavs) {
+										  	if (leav.equals(s.split("-")[2])) {
+												errs.add(o.getName() + "," + s.split("-")[2] + "号请排法");
+												break;
+											}
+										  }
+										  if (errs.size()>0){
+										  	break;
+										  }
+
 									  }
 								  }
 								  if (userId.get("category").equals("106")) {
 									  if (xsum > 6 || sum > 1) {
-										  errs.add("第" + index + "行,排班有误");
+										  errs.add(o.getName()+","+"排班有误");
 										  break;
 									  }
 								  } else {
 									  if (xsum > 5 || sum > 2) {
-										  errs.add("第" + index + "行,排班有误");
+										  errs.add(o.getName()+","+"排班有误");
 										  break;
 									  }
 								  }
-								  if (oConvertUtils.isNotEmpty(dataMap.get("a" + i))) {
+								  if (oConvertUtils.isNotEmpty(dataMap.get("a" + i))&&errs.size()<1) {
 									  UserShift u = new UserShift();
 									  u.setUserId(userId.get("id").toString());
 									  u.setShiftDate(DateUtils.parseDate(o.getMoth() + "-" + i, "yyyy-MM-dd"));
@@ -794,6 +805,8 @@ public class UserShiftController extends JeecgController<UserShift, IUserShiftSe
 										  u.setShiftId("0");
 									  }
 									  ls.add(u);
+								  }else {
+								  	break;
 								  }
 							  }
 
@@ -819,11 +832,12 @@ public class UserShiftController extends JeecgController<UserShift, IUserShiftSe
 				for (String u : us) {
 				userShiftService.deleteUserShift(u.split(",")[0], u.split(",")[1]);
 				}
-			userShiftService.saveBatch(ls);
+				userShiftService.saveBatch(ls);
 			}
+			  return Result.ok("导入成功"+us.size()+"条");
 		  }
-		  return Result.error("文件导入失败");
-	  }*/
+		  return Result.error("文件导入失败!"+errs.get(0));
+	  }
 
 
 	 @GetMapping(value = "/UserShiftType")

+ 1 - 1
jeecg-boot-module-demo/src/main/java/org/jeecg/modules/geke/userchange/entity/UserChage.java

@@ -35,7 +35,7 @@ public class UserChage {
 	private java.lang.String id;
 
 	@Excel(name = "工号", width = 15)
-	private java.lang.String workNo;
+	private transient java.lang.String workNo;
 
 	@Excel(name = "姓名", width = 15)
 	@ApiModelProperty(value = "员工姓名")

+ 2 - 1
jeecg-boot-module-demo/src/main/java/org/jeecg/modules/geke/vacation/service/impl/VacationServiceImpl.java

@@ -45,7 +45,8 @@ public class VacationServiceImpl extends ServiceImpl<VacationMapper, Vacation> i
         if (one==null){
             return super.save(vacation);
         }else {
-            return super.updateById(vacation);
+            one.setHolidayCount(vacation.getHolidayCount());
+            return super.updateById(one);
         }
 
     }

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

@@ -2863,38 +2863,20 @@ public class SysUserController {
                 if (list!=null&&list.size()>0){
                     List<SysUser>lst=new ArrayList<>();
                     list.forEach(str->{
-                    if (oConvertUtils.isNotEmpty(str.getUserId())&&oConvertUtils.isNotEmpty(str.getEndWages())&&str.getTime()!=null) {
-                        str.setType("工资调整");
+                    if (oConvertUtils.isNotEmpty(str.getWorkNo())&&oConvertUtils.isNotEmpty(str.getEndWages())&&str.getTime()!=null) {
                         str.setState(1);
                         str.setConmitId(sysUsers.getId());
                         str.setConmitDate(new Date());
-                        List<SysDepart> sysDeparts = sysDepartService.queryUserDeparts(str.getUserId());
-                        SysUser byId = sysUserService.getById(str.getUserId());
-                        SysUser sysUser = new SysUser();
-                        if (byId != null) {
-                            str.setRealname(byId.getRealname());
-                        }
-                        if (str.getUserId() != null && !str.getUserId().equals("")) {
-                            sysUser.setId(str.getUserId());
-                        }
-                        if (str.getEndWages() != null && !str.getEndWages().equals("")) {
-                            sysUser.setWagesOne(str.getEndWages());
-                        }
-                        if (sysDeparts != null) {
-                            str.setDeptId(sysDeparts.get(0).getId());
-                            str.setDeptName(sysDeparts.get(0).getDepartName());
-                        }
-                        if (byId != null && byId.getPost() != null && !"".equals(byId.getPost())) {
-                            SysPosition ones = sysPositionService.getOnes(byId.getPost());
-                            if (ones != null) {
-                                str.setStartPost(ones.getName());
-                            }
-                        }
+                        SysUser user = sysUserService.getOneByWorkNo(str.getWorkNo());
+                        List<SysDepart> sysDeparts = sysDepartService.queryUserDeparts(user.getId());
+                        str.setDeptId(sysDeparts.get(0).getId());
+                        str.setUserId(user.getId());
                         lstt.add(str);
                     }
                    // lst.add(sysUser);
                     });
                     userChageService.saveBatch(lstt);
+                    weixinUserService.editUserChange();
                     //sysUserService.updateBatchById(lst);
                 }
                 //400条 saveBatch消耗时间1592毫秒  循环插入消耗时间1947毫秒

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

@@ -241,5 +241,7 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
 	boolean editWorkMoth(@Param("userid")String userid,@Param("sum")String sum);
 	//非正常离职变更
 	boolean editQuit(@Param("userid")String userid,@Param("date") Date date);
+	//根据工号查询
+	SysUser getOneByWorkNo(@Param("workNo")String workNo);
 
 }

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

@@ -417,11 +417,11 @@ on a.depart_name=b.orgCodeTxt
 	and a.del_flag='0' and a.employment_status='10' order by create_time desc
 	</select>
     <select id="tpUser" resultType="org.jeecg.modules.system.entity.SysUser">
-		select *from sys_user where sy_state='0'
+		select *from sys_user where 1=1
 	<if test="state!=null and ''!=state">
 	and	info_sy in (#{state},'3')
 	</if>
-	and del_flag='0' and employment_status='10'
+	and del_flag='0'
 	<if test="wxState!=null and ''!=wxState">
 		and sy_state='0'
 	</if>
@@ -557,4 +557,11 @@ on a.depart_name=b.orgCodeTxt
 			and id &lt;&gt; #{userid}
 		</if>
 	</select>
+	<select id="getOneByWorkNo" resultType="org.jeecg.modules.system.entity.SysUser">
+		select *from sys_user where 1=1
+		<if test="workNo!=null and ''!=workNo">
+			and work_no=#{workNo}
+		</if>
+
+	</select>
 </mapper>

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

@@ -328,4 +328,6 @@ List<String>  departIds(String userid);
 
 	boolean editQuit(SysUser sysUser);
 
+	SysUser getOneByWorkNo(String workNo);
+
 }

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

@@ -700,6 +700,11 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
 		return userMapper.editQuit(sysUser.getId(),sysUser.getNewDate());
 	}
 
+	@Override
+	public SysUser getOneByWorkNo(String workNo) {
+		return userMapper.getOneByWorkNo(workNo);
+	}
+
 
 	/**
 	 * 循环获取字典数据 树

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

@@ -839,7 +839,6 @@ public class WeixinUserImpl implements IWeixinUserService{
         //获取审批通过后又撤销的
         lists.addAll(WeixinVacationList(String.valueOf(startDate), String.valueOf(endDate),"","Bs7yC3swLeNVwa2WyLsSXVL5XV6kVJmnEQTwW4cFS","6"));
         lists.addAll(WeixinVacationList(String.valueOf(startDate2), String.valueOf(startDate),"","Bs7yC3swLeNVwa2WyLsSXVL5XV6kVJmnEQTwW4cFS","6"));
-
         if (lists!=null&&lists.size()>0){
                iworkOvertimeService.removeByIds(lists);
            }
@@ -1277,10 +1276,9 @@ public class WeixinUserImpl implements IWeixinUserService{
                             vacation.setStartDate(beginDate);
                             vacation.setEndDate(EndDate);
                             //计算天数
-                            long countD = new Long(value.get("new_duration").toString());
-                            long countDa = countD / 3600;
-
-                            vacation.setHolidayCount(countDa + "");
+                            Double countD = Double.parseDouble(value.get("new_duration").toString());
+                            Double countDa = countD / 3600;
+                            vacation.setHolidayCount(countDa.toString());
                         }else if (s.equals("Textarea")){
                             value = (Map) ll.get("value");
                             vacation.setDemo(value.get("text").toString());
@@ -1347,8 +1345,8 @@ public class WeixinUserImpl implements IWeixinUserService{
                             long ltt = new Long(value.get("new_end").toString());
                             Date EndDate = new Date(ltt * 1000);
                             //计算天数
-                            long countD = new Long(value.get("new_duration").toString());
-                            long countDa = countD / 3600;
+                            Double countD = Double.parseDouble(value.get("new_duration").toString());
+                            Double countDa = countD / 3600;
                             work.setBeginDate(beginDate);
                             work.setEndDate(EndDate);
                             work.setDuration(String.valueOf(countDa));
@@ -1747,11 +1745,19 @@ public class WeixinUserImpl implements IWeixinUserService{
                     if (ls.getCategory()!=null&&ls.getCategory().equals("101")){
                         tyname="正式工";
                     }else if (ls.getCategory()!=null&&ls.getCategory().equals("102")){
-                        tyname="合同工";
+                        tyname="顾问";
                     }else if (ls.getCategory()!=null&&ls.getCategory().equals("103")){
                         tyname="实习生";
                     }else if (ls.getCategory()!=null&&ls.getCategory().equals("104")){
                         tyname="劳务工";
+                    }else if (ls.getCategory()!=null&&ls.getCategory().equals("105")){
+                        tyname="外包5+2";
+                    }else if (ls.getCategory()!=null&&ls.getCategory().equals("106")){
+                        tyname="外包6+1";
+                    }else if (ls.getCategory()!=null&&ls.getCategory().equals("107")){
+                        tyname="退休员工";
+                    }else if (ls.getCategory()!=null&&ls.getCategory().equals("108")){
+                        tyname="外籍员工";
                     }
                     map.put("rpersontypename", tyname);
                     map.put("rEmployState", ls.getEmploymentStatus());

+ 2 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/workOvertime/entity/workOvertime.java

@@ -34,11 +34,11 @@ public class workOvertime {
 	private String id;
 	@Excel(name = "工号", width = 15)
 	@ApiModelProperty(value = "工号")
-	private String workNo;
+	private transient String  workNo;
 	/**加班人员*/
 	@Excel(name = "加班人员", width = 15)
     @ApiModelProperty(value = "加班人员")
-	private String person;
+	private  String person;
 
 	/**备用虚拟字段-**/
 	@Excel(name = "一级部门", width = 15)

+ 6 - 9
jeecg-boot-module-system/src/main/java/org/jeecg/modules/workOvertime/service/impl/workOvertimeServiceImpl.java

@@ -42,15 +42,12 @@ public class workOvertimeServiceImpl extends ServiceImpl<workOvertimeMapper, wor
 
     @Override
     public Boolean workSave(workOvertime work) {
-//        Boolean b=true;
-//        String one = works.getOne(work.getPerson(), DateUtils.formatDate(work.getCommitDate()));
-//        if (one!=null&&!one.equals("")){
-//            return true;
-//        }
-//
-//        b= save(work);
-
-       return save(work);
+        workOvertime byId = this.getById(work.getId());
+        if (byId!=null){
+            byId.setDuration(work.getDuration());
+            return this.updateById(byId);
+        }
+        return save(work);
     }
 
     @Override