wanyong 1 年之前
父節點
當前提交
0a729b7276

+ 1 - 0
addon/customer/web/js/project/projectManagementList.js

@@ -176,3 +176,4 @@ shr.defineClass("shr.project.projectManagementList",shr.framework.List,{
 //		}
 //	},
 });
+

+ 9 - 13
app/workSheetSystem/src/main/java/com/qy/worksheetsystem/controller/PersonWorkController.java

@@ -66,11 +66,11 @@ public class PersonWorkController {
     @ApiImplicitParams({
             @ApiImplicitParam(name = "token", value = "token", required = true, paramType = "header", dataType = "String"),
     })
-    public MessageResultV2 insertWork(@RequestHeader("token") String token, @RequestBody WorkHoursReport jobWork) {
+    public MessageResult insertWork(@RequestHeader("token") String token, @RequestBody WorkHoursReport jobWork) {
         try {
             String number = JWTUtil.getCacheNumber(token);
             if (StringUtils.isEmpty(number)) {
-                return MessageResultV2.error("token异常");
+                return MessageResult.error("token异常");
             }
             Map<String, Object> map = new HashMap<>();
             SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
@@ -83,14 +83,12 @@ public class PersonWorkController {
             Date endDate = format.parse(endTime);
             Date enterDate = format.parse(person.get("enterDate"));
             if (enterDate.compareTo(beginDate) > 0) {
-                return MessageResultV2.error("不能填报,入职日期之前的日期!");
+                return MessageResult.error("不能填报,入职日期之前的日期!");
             }
             map.put("jobWork",jobWork);
             map.put("person",person);
             map.put("beginDate",beginDate);
             map.put("endDate",endDate);
-            map.put("beginDateStr",beginTime);
-            map.put("endDateStr",endTime);
             //校验报工日期是否超过8小时
             List<Map<String,Object>> availableList = personWorkService.getAvailableDateInfo(number,beginTime,endTime);
             Map<String,Map<String,Object>> availableMap = Maps.newHashMap();
@@ -116,7 +114,7 @@ public class PersonWorkController {
                 Hours += Hour.intValue();
                 String projectId = jobWorkEntry.getProjectId();
                 if (StringUtils.isBlank(projectId)) {
-                    return MessageResultV2.error("项目id为空");
+                    return MessageResult.error("项目id为空");
                 }
                 for (int i = begin; i <= end; i++) {
                     String iday = "01";
@@ -136,22 +134,20 @@ public class PersonWorkController {
                 }
             }
             if (Hours > 8) {
-                return MessageResultV2.error("报工小时数不能大于8小时");
+                return MessageResult.error("报工小时数不能大于8小时");
             }
             if (errMsg.length() > 0) {
-                MessageResultV2 result = new MessageResultV2();
+                MessageResult result = new MessageResult();
                 result.setCode(400);
                 result.setMsg(errMsg.toString());
                 return result;
             }
-            Map<String,Object> objectMap = personWorkService.insertWork(map);
-            MessageResultV2 resultV2 = MessageResultV2.success();
-            resultV2.setData(objectMap);
-            return resultV2;
+
         }catch (Exception e){
             log.error(e.getMessage(),e);
-            return MessageResultV2.error(e.getMessage());
+            return MessageResult.error(e.getMessage());
         }
+        return MessageResult.success().add("jobWork","jobWork");
     }
 
     @ApiOperation(value = "获取员工报工列表", notes = "获取员工报工列表")

+ 4 - 13
app/workSheetSystem/src/main/java/com/qy/worksheetsystem/model/mapper/PersonMapper.xml

@@ -5,43 +5,34 @@
     <select id="getPersonByUserId" resultType="java.util.Map" parameterType="String">
         select p.fid id,p.fnumber number,p.fname_l2 name,
         CONVERT(varchar(10) ,isnull(pp2.FEnterDate,''),120) enterDate,
-        btype.fname_l2 btypeName,btype.fid btypeId,
-        pp.fid userID,pp2.FControlUnitID controlUnitID,pp2.FHrOrgUnitID hrOrgUnitID,
-        pop.FPersonDep adminOrgID
+        btype.fname_l2 btypeName,btype.fid btypeId
         from t_bd_person p
         left join t_pm_user pp on pp.fpersonid=p.fid
         left join T_HR_EMPLABORRELATION pp2 on pp2.FPersonID=p.fid
         left join T_HR_BDEmployeeType btype on btype.fid=pp2.FLaborRelationStateID
-        left join T_HR_PersonPosition pop on pop.fpersonid=p.fid
         where pp.fid=#{userid}
     </select>
 
     <select id="getPersonByOpenId" resultType="java.util.Map" parameterType="String">
         select p.fid id,p.fnumber number,p.fname_l2 name,
         CONVERT(varchar(10) ,isnull(pp2.FEnterDate,''),120) enterDate,
-        btype.fname_l2 btypeName,btype.fid btypeId,
-        pp.fid userID,pp2.FControlUnitID controlUnitID,pp2.FHrOrgUnitID hrOrgUnitID,
-        pop.FPersonDep adminOrgID
+        btype.fname_l2 btypeName,btype.fid btypeId
+
         from t_bd_person p
         left join t_pm_user pp on pp.fpersonid=p.fid
         left join T_HR_EMPLABORRELATION pp2 on pp2.FPersonID=p.fid
         left join T_HR_BDEmployeeType btype on btype.fid=pp2.FLaborRelationStateID
-        left join T_HR_PersonPosition pop on pop.fpersonid=p.fid
         where pp.fopenid=#{openid}
     </select>
 
     <select id="getPersonByJobNo" resultType="java.util.Map" parameterType="String">
         select p.fid id,p.fnumber number,p.fname_l2 name,
         CONVERT(varchar(10) ,isnull(pp2.FEnterDate,''),120) enterDate,
-
-        btype.fname_l2 btypeName,btype.fid btypeId,
-        pp.fid userID,pp2.FControlUnitID controlUnitID,pp2.FHrOrgUnitID hrOrgUnitID,
-        pop.FPersonDep adminOrgID
+        btype.fname_l2 btypeName,btype.fid btypeId
         from t_bd_person p
         left join t_pm_user pp on pp.fpersonid=p.fid
         left join T_HR_EMPLABORRELATION pp2 on pp2.FPersonID=p.fid
         left join T_HR_BDEmployeeType btype on btype.fid=pp2.FLaborRelationStateID
-        left join T_HR_PersonPosition pop on pop.fpersonid=p.fid
         where p.fnumber=#{jobNo}
     </select>
 </mapper>

+ 0 - 6
app/workSheetSystem/src/main/java/com/qy/worksheetsystem/model/mapper/PersonWorkMapper.java

@@ -9,12 +9,6 @@ import java.util.Map;
 
 @Repository
 public interface PersonWorkMapper {
-        String selectBillKey();
-        String selectKeyByBosTyoe(@Param("employeeID") String employeeID);
 
         List<Map<String,Object>> getAvailableDateInfo(@Param("employeeID") String employeeID, @Param("startDate")String startDate,  @Param("endDate")String endDate);
-
-        int insertBill(@Param("billList")List<Map<String, Object>> billList);
-
-        int insertWork(@Param("workList")List<Map<String, Object>> workList);
 }

+ 4 - 44
app/workSheetSystem/src/main/java/com/qy/worksheetsystem/model/mapper/PersonWorkMapper.xml

@@ -1,12 +1,9 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.qy.worksheetsystem.model.mapper.PersonWorkMapper">
-    <select id="selectBillKey" resultType="String">
+    <select id="selectKey" resultType="String">
         select dbo.newbosid('CF9DCEB1') as id
     </select>
-    <select id="selectKeyByBosTyoe" resultType="String">
-        select dbo.newbosid(#{bosTyoe}) as id
-    </select>
     <select id="getAvailableDateInfo" resultType="java.util.Map">
         SELECT
         item.fid as "id",
@@ -28,44 +25,7 @@
         AND w.FISDEFAULT=1
         order by item.FDate
     </select>
-    <!---->
-    <select id="getPersonWorkList" resultType="java.util.Map">
-        select * from CT_PRO_WorkHoursReportEntry
-    </select>
-    <insert id="insertBill" parameterType="java.util.List" >
-        insert
-        into CT_PRO_WorkHoursReport(
-        CFAffiliatedProjec,FAdminOrgUnitId,FHROrgUnitID,
-        FBillState,FNumber,FBizDate,
-        FCreatorID,FCreateTime,FLastUpdateUserID,
-        FLastUpdateTime, FControlUnitID,FID,
-        CFDataSource,CFFillingStartDate,CFFillingEndDate
-        )
-        values
-        <foreach collection="billList" item="item" index="index" separator=",">
-        (
-            #{item.affiliatedProject}, #{item.adminOrg}, #{item.hrOrgUnit},
-            #{item.billState}, #{item.number}, #{item.bizDate},
-            #{item.creator}, getDate(), #{item.lastUpdateUser},
-            getDate(), #{item.CU}, #{item.id},
-            'employeeReport', #{item.fillingStartDate}, #{item.fillingEndDate}
-        )
-        </foreach>
-    </insert>
-    <insert id="insertWork" parameterType="java.util.List">
-        INSERT
-        into CT_PRO_WorkHoursReportEntry(FParentID,CFEmployeeID,CFClockTime,
-        CFClockLocation,CFData,CFWorkingHours,
-        CFNotes,FSeq,Fid
-        )
-        values
-        <foreach collection="workList" item="item" index="index" separator=",">
-            (
-            #{item.parent},#{item.employee},
-            #{item.clockTime},#{item.clockLocation},#{item.data},
-            #{item.WorkingHours},#{item.notes},
-            #{item.seq},dbo.newbosid('22DCD041')
-            )
-        </foreach>
-    </insert>
+    <!--22DCD041-->
+
+
 </mapper>

+ 0 - 1
app/workSheetSystem/src/main/java/com/qy/worksheetsystem/model/mapper/ProjectMapper.xml

@@ -68,5 +68,4 @@
         </if>
         #{dateTime}
     </select>
-
 </mapper>

+ 0 - 1
app/workSheetSystem/src/main/java/com/qy/worksheetsystem/service/PersonWorkService.java

@@ -16,5 +16,4 @@ public interface PersonWorkService {
     public Map<String,Object> insertWork(Map<String,Object> param);
 
     public List<Map<String, Object>> getAvailableDateInfo(String number, String startDate, String endDate);
-
 }

+ 15 - 92
app/workSheetSystem/src/main/java/com/qy/worksheetsystem/service/impl/PersonWorkServiceImpl.java

@@ -1,31 +1,17 @@
 package com.qy.worksheetsystem.service.impl;
 
-
-import cn.hutool.core.lang.Snowflake;
-import cn.hutool.core.util.IdUtil;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-import com.qy.worksheetsystem.model.MessageResult;
 import com.qy.worksheetsystem.model.mapper.PersonMapper;
 import com.qy.worksheetsystem.model.mapper.PersonWorkMapper;
 
-import com.qy.worksheetsystem.model.mapper.ProjectMapper;
 import com.qy.worksheetsystem.service.PersonService;
 import com.qy.worksheetsystem.service.PersonWorkService;
-import com.qy.worksheetsystem.util.SnowflakeUtils;
 import com.qy.worksheetsystem.vo.InsertJobWorkingVO;
-import com.qy.worksheetsystem.vo.WorkHoursReport;
-import com.qy.worksheetsystem.vo.WorkHoursReportEntry;
 import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
-import org.springframework.web.bind.annotation.RequestHeader;
 
 import javax.annotation.Resource;
 import java.math.BigDecimal;
-import java.text.SimpleDateFormat;
-import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -42,93 +28,34 @@ import java.util.Map;
 @Service
 public class PersonWorkServiceImpl implements PersonWorkService {
     private static final BigDecimal h8 = new BigDecimal(8);
-
     @Resource
     private PersonWorkMapper personWorkMapper;
     @Resource
     private PersonService personService;
 
-    @Resource
-    private ProjectMapper projectMapper;
-
     @Override
     @Transactional
     public Map<String,Object> insertWork(Map<String,Object> param){
-        try {
-            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
-            int begin = (int) param.get("begin");
-            int end = (int) param.get("end");
-            String yearMonth = (String) param.get("yearMonth");
-            WorkHoursReport jobWork = (WorkHoursReport) param.get("jobWork");
-            Map<String, String> person = (Map<String, String>) param.get("person");
-            Date beginDate = (Date) param.get("beginDate");
-            Date endDate = (Date) param.get("endDate");
-            Map<String, Map<String, Object>> availableMap = (Map<String, Map<String, Object>>) param.get("availableMap");
-
-            List<Map<String, Object>> billList = Lists.newArrayList();
-            List<Map<String, Object>> workList = Lists.newArrayList();
-            Integer Hours = 0;
-            for (WorkHoursReportEntry jobWorkEntry : jobWork.getEntries()) {
-                String workingHours = jobWorkEntry.getWorkingHours();
-                BigDecimal Hour = new BigDecimal(workingHours);
-                Hours += Hour.intValue();
-                String projectId = jobWorkEntry.getProjectId();
 
-                String number = SnowflakeUtils.getInstance().getSnowflake().nextIdStr();
 
-                Map<String, Object> billMap = new HashMap<>();
+        Map<String, String> billMap = new HashMap<>();
+        billMap.put("affiliatedProject","");
+        billMap.put("fillingStartDate","");
+        billMap.put("fillingEndDate","");
+        billMap.put("adminOrg","");
+        billMap.put("hrOrgUnit","");
+        billMap.put("billState","");
+        billMap.put("number","");
+        billMap.put("CU","");
+        billMap.put("bizDate","");
+        billMap.put("creator","");
+        billMap.put("createTime","");
+        billMap.put("lastUpdateUser","");
+        billMap.put("lastUpdateTime","");
+        
 
-                String billID = personWorkMapper.selectBillKey();
-                billMap.put("id", billID);
-                billMap.put("affiliatedProject", projectId);
-                billMap.put("fillingStartDate", beginDate);
-                billMap.put("fillingEndDate", endDate);
-                billMap.put("adminOrg", person.get("adminOrgID"));
-                billMap.put("hrOrgUnit", person.get("hrOrgUnitID"));
-                billMap.put("billState", jobWork.getState());
-                billMap.put("number", number);
-                billMap.put("CU", person.get("controlUnitID"));
-                Date createTime = new Date();
-                billMap.put("bizDate", createTime);
-                billMap.put("creator", person.get("userID"));
-                billMap.put("createTime", createTime);
-                billMap.put("lastUpdateUser", person.get("userID"));
-                billMap.put("lastUpdateTime", createTime);
-                for (int i = begin; i <= end; i++) {
-                    Map<String, Object> objectMap = Maps.newHashMap();
-                    String iday = "01";
-                    if (i < 10) {
-                        iday = "0" + i;
-                    } else {
-                        iday = i + "";
-                    }
-                    String reportDate = yearMonth + iday;
-                    Map<String, Object> avMap = availableMap.get(reportDate);
-                    BigDecimal availableWorkHous = (BigDecimal) avMap.get("availableWorkHous");
-                    BigDecimal workHours = (BigDecimal) avMap.get("workHours");
-                    objectMap.put("parent", billID);
-                    objectMap.put("employee", person.get("id"));
-                    objectMap.put("clockTime", reportDate);
-                    objectMap.put("clockLocation", "移动端");
-                    objectMap.put("data", format.parse(reportDate));
-                    objectMap.put("WorkingHours", availableWorkHous);
-                    objectMap.put("notes", "");
-                    objectMap.put("seq", i);
-                    workList.add(objectMap);
 
-                }
-                billList.add(billMap);
-            }
 
-            int bInt = personWorkMapper.insertBill(billList);
-            int wInt = personWorkMapper.insertWork(workList);
-            Map<String, Object> reMap = Maps.newHashMap();
-            reMap.put("billList", billList);
-            reMap.put("workList", workList);
-            return reMap;
-        }catch (Exception e){
-            log.error(e.getMessage(),e);
-        }
         return null;
     }
 
@@ -148,9 +75,5 @@ public class PersonWorkServiceImpl implements PersonWorkService {
         return list;
     }
 
-    public MessageResult getPersonWorkList(String number,String beginTime, String endTime, Boolean state) {
-        return null;
-    }
-
 
 }

+ 4 - 4
src/com/kingdee/eas/hr/project/AbstractWorkHoursReportEntryInfo.java

@@ -42,13 +42,13 @@ public class AbstractWorkHoursReportEntryInfo extends com.kingdee.eas.framework.
     /**
      * Object:分录's 打卡时间property 
      */
-    public java.sql.Timestamp getClockTime()
+    public String getClockTime()
     {
-        return getTimestamp("clockTime");
+        return getString("clockTime");
     }
-    public void setClockTime(java.sql.Timestamp item)
+    public void setClockTime(String item)
     {
-        setTimestamp("clockTime", item);
+        setString("clockTime", item);
     }
     /**
      * Object:分录's 打卡位置property