Răsfoiți Sursa

调整履职计划

luojun 2 ani în urmă
părinte
comite
cf3ae48aac

+ 3 - 3
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/impl/AppPlanServiceImpl.java

@@ -352,7 +352,7 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
     }
 
     private AppPlan convertToAppPlan(AppPlanVo app) {
-        LoginUser loginUser = SecurityUtils.getLoginUser();
+//        LoginUser loginUser = SecurityUtils.getLoginUser();
         AppPlan plan = new AppPlan();
         plan.setCheckType(app.getExecType());
         plan.setCheckOrgType(app.getOrgType());
@@ -361,8 +361,8 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
             plan.setCreateTime(time);
         }
         plan.setUpdateTime(time);
-        plan.setModifiedName(loginUser.getUsername());
-        plan.setModifiedBy(loginUser.getUserid());
+        plan.setModifiedName(SecurityUtils.getUsername());
+        plan.setModifiedBy(SecurityUtils.getUserId());
         plan.setExecOrgType(app.getOrgType());
         plan.setExecType(app.getExecType());
 

+ 12 - 12
soc-modules/soc-modules-core/src/main/resources/mapper/resumption/AppPlanMapper.xml

@@ -127,23 +127,23 @@
 
     <select id="selectByPlanId" resultType="com.xunmei.core.resumption.vo.appPlan.RuleItemVo">
         SELECT a.id,
-               b.item_name,
-               b.item_desc,
-               b.item_num,
-               a.safe_type,
+               b.name as item_name,
+               b.desc as item_desc,
+--                b.item_num,
+--                a.safe_type,
                c.`name`           area_name,
-               a.point_name,
-               a.point_num,
+               a.name as point_name,
+--                a.point_num,
                h.point_scan,
                h.required,
-               d.rule_name     as ruleName,
+               d.name  as ruleName,
                a.business_type as businessType
         FROM (SELECT item_id, point_scan, required FROM sys_plan_to_item WHERE plan_id = #{planId}) h
-                 LEFT JOIN sys_rule_point a ON h.item_id = a.id
-                 LEFT JOIN sys_rule_item b ON a.item_id = b.id
-                 LEFT JOIN t_area c ON a.area_id = c.id
-                 LEFT JOIN sys_rule d on b.rule_id = d.id
-        order by b.item_num, a.point_num
+                 LEFT JOIN core_resumption_rule_point a ON h.item_id = a.id
+                 LEFT JOIN core_resumption_rule_item b ON a.item_id = b.id
+                 LEFT JOIN sys_area c ON a.area_id = c.id
+                 LEFT JOIN core_resumption_rule d on b.rule_id = d.id
+--         order by b.item_num, a.point_num
     </select>
 
     <select id="findExecOrgByPlan" parameterType="Long" resultType="Long">

+ 15 - 3
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysWorkTimeServiceImpl.java

@@ -272,11 +272,23 @@ public class SysWorkTimeServiceImpl extends ServiceImpl<SysWorkTimeMapper, SysWo
     @Override
     @Transactional(rollbackFor = Exception.class,propagation = Propagation.REQUIRES_NEW)
     public List<SysWorkTime> batchnew(Long orgId, List<SysWorkTime> workTimeDtoList) {
+        Date now = DateUtil.beginOfDay(new Date());
+        Date updateTime = new Date();
 
         for (SysWorkTime s : workTimeDtoList) {
-            s.setId(null);
-            s.setOrgId(orgId);
-            baseMapper.insert(s);
+            if (s.getIsEnable() == null || s.getYmdDate().before(now)) {
+//                WORKTIMEBUSINESSLOG.info("作息时间[ {} ]小于现在时间, 不允许改变", workDate);
+//                return null;
+            }else {
+                s.setId(null);
+                s.setOrgId(orgId);
+                s.setIsManual(1L);
+                s.setUpdateTime(updateTime);
+
+                baseMapper.insert(s);
+
+            }
+
         }
         return workTimeDtoList;
     }