wuxw 1 год назад
Родитель
Сommit
4f36500786

+ 68 - 0
java110-bean/src/main/java/com/java110/dto/work/WorkTaskItemDto.java

@@ -16,6 +16,7 @@ public class WorkTaskItemDto extends WorkPoolContentDto implements Serializable
     private String deductionPersonId;
     private String finishTime;
     private String deductionPersonName;
+    private String deductionPersonNameLike;
     private String deductionMoney;
     private String contentId;
     private String storeId;
@@ -23,20 +24,31 @@ public class WorkTaskItemDto extends WorkPoolContentDto implements Serializable
     private String deductionReason;
     private String itemId;
     private String state;
+
+    private String[] states;
+    private String stateName;
     private String communityId;
     private String taskId;
 
     private String staffName;
+    private String staffNameLike;
 
     private String remark;
 
     private String pathUrl;
 
+    private String startTime;
+
+    private String endTime;
+
 
     private Date createTime;
 
     private String statusCd = "0";
 
+    private String score;
+
+
 
     public String getDeductionPersonId() {
         return deductionPersonId;
@@ -174,4 +186,60 @@ public class WorkTaskItemDto extends WorkPoolContentDto implements Serializable
     public void setPathUrl(String pathUrl) {
         this.pathUrl = pathUrl;
     }
+
+    public String getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(String startTime) {
+        this.startTime = startTime;
+    }
+
+    public String getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(String endTime) {
+        this.endTime = endTime;
+    }
+
+    public String getStateName() {
+        return stateName;
+    }
+
+    public void setStateName(String stateName) {
+        this.stateName = stateName;
+    }
+
+    public String getStaffNameLike() {
+        return staffNameLike;
+    }
+
+    public void setStaffNameLike(String staffNameLike) {
+        this.staffNameLike = staffNameLike;
+    }
+
+    public String getDeductionPersonNameLike() {
+        return deductionPersonNameLike;
+    }
+
+    public void setDeductionPersonNameLike(String deductionPersonNameLike) {
+        this.deductionPersonNameLike = deductionPersonNameLike;
+    }
+
+    public String getScore() {
+        return score;
+    }
+
+    public void setScore(String score) {
+        this.score = score;
+    }
+
+    public String[] getStates() {
+        return states;
+    }
+
+    public void setStates(String[] states) {
+        this.states = states;
+    }
 }

+ 74 - 38
java110-bean/src/main/java/com/java110/po/workPool/WorkTaskItemPo.java

@@ -17,6 +17,7 @@ package com.java110.po.workPool;
 
 import java.io.Serializable;
 import java.util.Date;
+
 /**
  * 类表述: Po 数据模型实体对象 基本保持与数据库模型一直 用于 增加修改删除 等时的数据载体
  * add by 吴学文 at 2024-10-31 00:45:24 mail: 928255095@qq.com
@@ -28,97 +29,132 @@ import java.util.Date;
 public class WorkTaskItemPo implements Serializable {
 
     private String deductionPersonId;
-private String finishTime;
-private String deductionPersonName;
-private String deductionMoney;
-private String contentId;
-private String statusCd = "0";
-private String storeId;
-private String workId;
-private String deductionReason;
-private String itemId;
-private String state;
-private String communityId;
-private String taskId;
-public String getDeductionPersonId() {
+    private String finishTime;
+    private String deductionPersonName;
+    private String deductionMoney;
+    private String contentId;
+    private String statusCd = "0";
+    private String storeId;
+    private String workId;
+    private String deductionReason;
+    private String itemId;
+    private String state;
+    private String communityId;
+    private String taskId;
+
+    private String score;
+
+
+    public String getDeductionPersonId() {
         return deductionPersonId;
     }
-public void setDeductionPersonId(String deductionPersonId) {
+
+    public void setDeductionPersonId(String deductionPersonId) {
         this.deductionPersonId = deductionPersonId;
     }
-public String getFinishTime() {
+
+    public String getFinishTime() {
         return finishTime;
     }
-public void setFinishTime(String finishTime) {
+
+    public void setFinishTime(String finishTime) {
         this.finishTime = finishTime;
     }
-public String getDeductionPersonName() {
+
+    public String getDeductionPersonName() {
         return deductionPersonName;
     }
-public void setDeductionPersonName(String deductionPersonName) {
+
+    public void setDeductionPersonName(String deductionPersonName) {
         this.deductionPersonName = deductionPersonName;
     }
-public String getDeductionMoney() {
+
+    public String getDeductionMoney() {
         return deductionMoney;
     }
-public void setDeductionMoney(String deductionMoney) {
+
+    public void setDeductionMoney(String deductionMoney) {
         this.deductionMoney = deductionMoney;
     }
-public String getContentId() {
+
+    public String getContentId() {
         return contentId;
     }
-public void setContentId(String contentId) {
+
+    public void setContentId(String contentId) {
         this.contentId = contentId;
     }
-public String getStatusCd() {
+
+    public String getStatusCd() {
         return statusCd;
     }
-public void setStatusCd(String statusCd) {
+
+    public void setStatusCd(String statusCd) {
         this.statusCd = statusCd;
     }
-public String getStoreId() {
+
+    public String getStoreId() {
         return storeId;
     }
-public void setStoreId(String storeId) {
+
+    public void setStoreId(String storeId) {
         this.storeId = storeId;
     }
-public String getWorkId() {
+
+    public String getWorkId() {
         return workId;
     }
-public void setWorkId(String workId) {
+
+    public void setWorkId(String workId) {
         this.workId = workId;
     }
-public String getDeductionReason() {
+
+    public String getDeductionReason() {
         return deductionReason;
     }
-public void setDeductionReason(String deductionReason) {
+
+    public void setDeductionReason(String deductionReason) {
         this.deductionReason = deductionReason;
     }
-public String getItemId() {
+
+    public String getItemId() {
         return itemId;
     }
-public void setItemId(String itemId) {
+
+    public void setItemId(String itemId) {
         this.itemId = itemId;
     }
-public String getState() {
+
+    public String getState() {
         return state;
     }
-public void setState(String state) {
+
+    public void setState(String state) {
         this.state = state;
     }
-public String getCommunityId() {
+
+    public String getCommunityId() {
         return communityId;
     }
-public void setCommunityId(String communityId) {
+
+    public void setCommunityId(String communityId) {
         this.communityId = communityId;
     }
-public String getTaskId() {
+
+    public String getTaskId() {
         return taskId;
     }
-public void setTaskId(String taskId) {
+
+    public void setTaskId(String taskId) {
         this.taskId = taskId;
     }
 
 
+    public String getScore() {
+        return score;
+    }
 
+    public void setScore(String score) {
+        this.score = score;
+    }
 }

+ 67 - 5
java110-db/src/main/resources/mapper/oa/WorkTaskItemV1ServiceDaoImplMapper.xml

@@ -8,10 +8,12 @@
     <!-- 保存工作任务明细信息 add by wuxw 2018-07-03 -->
     <insert id="saveWorkTaskItemInfo" parameterType="Map">
         insert into work_task_item(
-        deduction_person_id,finish_time,deduction_person_name,deduction_money,content_id,store_id,work_id,deduction_reason,item_id,state,community_id,task_id
+        deduction_person_id,finish_time,deduction_person_name,deduction_money,
+        content_id,store_id,work_id,deduction_reason,item_id,state,community_id,task_id,score
         ) values (
-        #{deductionPersonId},#{finishTime},#{deductionPersonName},#{deductionMoney},#{contentId},#{storeId},#{workId},#{deductionReason},#{itemId},#{state},
-        #{communityId},#{taskId}
+        #{deductionPersonId},#{finishTime},#{deductionPersonName},#{deductionMoney},
+        #{contentId},#{storeId},#{workId},#{deductionReason},#{itemId},#{state},
+        #{communityId},#{taskId},#{score}
         )
     </insert>
 
@@ -22,7 +24,7 @@
         deductionPersonName,t.deduction_money deductionMoney,t.content_id contentId,t.status_cd statusCd,t.store_id
         storeId,t.work_id workId,t.deduction_reason deductionReason,t.item_id itemId,t.state,t.community_id
         communityId,t.task_id taskId,wpc.content,we.staff_name staffName,we.remark,t.create_time createTime,
-        wpf.path_url pathUrl
+        wpf.path_url pathUrl,t.score
         from work_task_item t
         left join work_pool_content wpc on t.content_id = wpc.content_id and wpc.status_cd = '0'
         left join work_event we on t.item_id = we.item_id and we.status_cd = '0' and we.event_type = '1001'
@@ -61,6 +63,12 @@
         <if test="state !=null and state != ''">
             and t.state= #{state}
         </if>
+        <if test="states != null">
+            and t.state in
+            <foreach collection="states" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
         <if test="communityId !=null and communityId != ''">
             and t.community_id= #{communityId}
         </if>
@@ -91,7 +99,9 @@
         <if test="deductionMoney !=null and deductionMoney != ''">
             , t.deduction_money= #{deductionMoney}
         </if>
-
+        <if test="score !=null and score != ''">
+            , t.score= #{score}
+        </if>
 
         <if test="deductionReason !=null and deductionReason != ''">
             , t.deduction_reason= #{deductionReason}
@@ -161,6 +171,12 @@
         <if test="state !=null and state != ''">
             and t.state= #{state}
         </if>
+        <if test="states != null">
+            and t.state in
+            <foreach collection="states" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
         <if test="communityId !=null and communityId != ''">
             and t.community_id= #{communityId}
         </if>
@@ -171,4 +187,50 @@
 
     </select>
 
+    <!-- 查询工作任务明细数量 add by wuxw 2018-07-03 -->
+    <select id="queryWorkDeductionCount" parameterType="Map" resultType="Map">
+        select count(1) count
+        from work_task_item t
+        left join work_task wt on t.task_id = wt.task_id and wt.status_cd = '0'
+        left join work_pool_content wpc on t.content_id = wpc.content_id and wpc.status_cd = '0'
+        left join work_event we on t.item_id = we.item_id and we.status_cd = '0' and we.event_type = '1001'
+        where t.deduction_money > 0
+        and t.status_cd = '0'
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+        <if test="staffNameLike !=null and staffNameLike != ''">
+            and wt.staff_name like concat('%', #{staffNameLike},'%')
+        </if>
+        <if test="deductionPersonNameLike !=null and deductionPersonNameLike != ''">
+            and t.deduction_person_name like concat('%', #{deductionPersonNameLike},'%')
+        </if>
+    </select>
+
+    <!-- 查询工作任务明细数量 add by wuxw 2018-07-03 -->
+    <select id="queryWorkDeductions" parameterType="Map" resultType="Map">
+        select wt.staff_name staffName,wt.start_time startTime,wt.end_time endTime,wpc.content,t.finish_time finishTime,
+        t.state,we.remark,t.deduction_money deductionMoney,t.deduction_reason deductionReason,t.deduction_person_name deductionPersonName,
+        t.create_time createTime,wt.work_id workId,t.score
+        from work_task_item t
+        left join work_task wt on t.task_id = wt.task_id and wt.status_cd = '0'
+        left join work_pool_content wpc on t.content_id = wpc.content_id and wpc.status_cd = '0'
+        left join work_event we on t.item_id = we.item_id and we.status_cd = '0' and we.event_type = '1001'
+        where t.deduction_money > 0
+        and t.status_cd = '0'
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+        <if test="staffNameLike !=null and staffNameLike != ''">
+            and wt.staff_name like concat('%', #{staffNameLike},'%')
+        </if>
+        <if test="deductionPersonNameLike !=null and deductionPersonNameLike != ''">
+            and t.deduction_person_name like concat('%', #{deductionPersonNameLike},'%')
+        </if>
+        order by t.create_time desc
+        <if test="page != -1 and page != null ">
+            limit #{page}, #{row}
+        </if>
+    </select>
+
 </mapper>

+ 10 - 4
java110-interface/src/main/java/com/java110/intf/oa/IWorkTaskItemV1InnerServiceSMO.java

@@ -16,6 +16,7 @@
 package com.java110.intf.oa;
 
 import com.java110.config.feign.FeignConfiguration;
+import com.java110.dto.work.WorkCopyDto;
 import com.java110.dto.work.WorkTaskItemDto;
 import com.java110.po.workPool.WorkTaskItemPo;
 import org.springframework.cloud.openfeign.FeignClient;
@@ -39,18 +40,17 @@ public interface IWorkTaskItemV1InnerServiceSMO {
 
 
     @RequestMapping(value = "/saveWorkTaskItem", method = RequestMethod.POST)
-    public int saveWorkTaskItem(@RequestBody  WorkTaskItemPo workTaskItemPo);
+    int saveWorkTaskItem(@RequestBody WorkTaskItemPo workTaskItemPo);
 
     @RequestMapping(value = "/updateWorkTaskItem", method = RequestMethod.POST)
-    public int updateWorkTaskItem(@RequestBody  WorkTaskItemPo workTaskItemPo);
+    int updateWorkTaskItem(@RequestBody WorkTaskItemPo workTaskItemPo);
 
     @RequestMapping(value = "/deleteWorkTaskItem", method = RequestMethod.POST)
-    public int deleteWorkTaskItem(@RequestBody  WorkTaskItemPo workTaskItemPo);
+    int deleteWorkTaskItem(@RequestBody WorkTaskItemPo workTaskItemPo);
 
     /**
      * <p>查询小区楼信息</p>
      *
-     *
      * @param workTaskItemDto 数据对象分享
      * @return WorkTaskItemDto 对象数据
      */
@@ -65,4 +65,10 @@ public interface IWorkTaskItemV1InnerServiceSMO {
      */
     @RequestMapping(value = "/queryWorkTaskItemsCount", method = RequestMethod.POST)
     int queryWorkTaskItemsCount(@RequestBody WorkTaskItemDto workTaskItemDto);
+
+    @RequestMapping(value = "/queryWorkDeductionCount", method = RequestMethod.POST)
+    int queryWorkDeductionCount(@RequestBody WorkTaskItemDto workCopyDto);
+
+    @RequestMapping(value = "/queryWorkDeductions", method = RequestMethod.POST)
+    List<WorkTaskItemDto> queryWorkDeductions(@RequestBody WorkTaskItemDto workCopyDto);
 }

+ 6 - 1
service-oa/src/main/java/com/java110/oa/cmd/work/FinishWorkCopyCmd.java

@@ -85,16 +85,21 @@ public class FinishWorkCopyCmd extends Cmd {
 
         Assert.listOnlyOne(userDtos, "用户不存在");
         String deductionMoney = "0.00";
+        String score= "10";
         String deductionReason = reqJson.getString("deductionReason");
         if (reqJson.containsKey("deductionMoney") && !StringUtil.isEmpty(reqJson.getString("deductionMoney"))) {
             deductionMoney = reqJson.getString("deductionMoney");
             deductionReason += (" 扣款 " + deductionMoney + "元");
         }
+        if (reqJson.containsKey("score") && !StringUtil.isEmpty(reqJson.getString("score"))) {
+            score = reqJson.getString("score");
+        }
 
         WorkTaskItemPo workTaskItemPo = new WorkTaskItemPo();
         workTaskItemPo.setItemId(reqJson.getString("itemId"));
         workTaskItemPo.setDeductionMoney(deductionMoney);
         workTaskItemPo.setDeductionReason(deductionReason);
+        workTaskItemPo.setScore(score);
         workTaskItemPo.setDeductionPersonId(userDtos.get(0).getUserId());
         workTaskItemPo.setDeductionPersonName(userDtos.get(0).getName());
         workTaskItemPo.setState(WorkTaskItemDto.STATE_COPY_COMPLETE);
@@ -119,7 +124,7 @@ public class FinishWorkCopyCmd extends Cmd {
 
         workTaskItemDto = new WorkTaskItemDto();
         workTaskItemDto.setTaskId(reqJson.getString("taskId"));
-        workTaskItemDto.setState(WorkTaskItemDto.STATE_COMPLETE);
+        workTaskItemDto.setStates(new String[]{WorkTaskItemDto.STATE_COMPLETE,WorkTaskItemDto.STATE_WAIT});
         int count = workTaskItemV1InnerServiceSMOImpl.queryWorkTaskItemsCount(workTaskItemDto);
 
         if (count > 0) {

+ 89 - 0
service-oa/src/main/java/com/java110/oa/cmd/work/ListWorkDeductionCmd.java

@@ -0,0 +1,89 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.oa.cmd.work;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.context.CmdContextUtils;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.Cmd;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.dto.work.WorkCopyDto;
+import com.java110.dto.work.WorkTaskItemDto;
+import com.java110.intf.oa.IWorkCopyV1InnerServiceSMO;
+import com.java110.intf.oa.IWorkTaskItemV1InnerServiceSMO;
+import com.java110.intf.oa.IWorkTaskV1InnerServiceSMO;
+import com.java110.utils.exception.CmdException;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.vo.ResultVo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * 类表述:查询 工单扣款
+ * 服务编码:workCopy.listWorkDeduction
+ * 请求路劲:/app/workCopy.ListWorkCopy
+ * add by 吴学文 at 2023-12-25 16:18:32 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@Java110Cmd(serviceCode = "work.listWorkDeduction")
+public class ListWorkDeductionCmd extends Cmd {
+
+    private static Logger logger = LoggerFactory.getLogger(ListWorkDeductionCmd.class);
+    @Autowired
+    private IWorkTaskItemV1InnerServiceSMO workTaskItemV1InnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+        super.validatePageInfo(reqJson);
+        Assert.hasKeyAndValue(reqJson, "communityId", "未包含小区信息");
+        String storeId = CmdContextUtils.getStoreId(cmdDataFlowContext);
+        reqJson.put("storeId", storeId);
+    }
+
+    @Override
+    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+
+        WorkTaskItemDto workCopyDto = BeanConvertUtil.covertBean(reqJson, WorkTaskItemDto.class);
+
+        int count = workTaskItemV1InnerServiceSMOImpl.queryWorkDeductionCount(workCopyDto);
+
+        List<WorkTaskItemDto> workTaskItemDtos = null;
+
+        if (count > 0) {
+            workTaskItemDtos = workTaskItemV1InnerServiceSMOImpl.queryWorkDeductions(workCopyDto);
+        } else {
+            workTaskItemDtos = new ArrayList<>();
+        }
+
+        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reqJson.getInteger("row")), count, workTaskItemDtos);
+
+        ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
+
+        cmdDataFlowContext.setResponseEntity(responseEntity);
+    }
+}

+ 3 - 0
service-oa/src/main/java/com/java110/oa/dao/IWorkTaskItemV1ServiceDao.java

@@ -70,4 +70,7 @@ public interface IWorkTaskItemV1ServiceDao {
      */
     int queryWorkTaskItemsCount(Map info);
 
+    int queryWorkDeductionCount(Map info);
+
+    List<Map> queryWorkDeductions(Map info);
 }

+ 21 - 0
service-oa/src/main/java/com/java110/oa/dao/impl/WorkTaskItemV1ServiceDaoImpl.java

@@ -108,5 +108,26 @@ public class WorkTaskItemV1ServiceDaoImpl extends BaseServiceDao implements IWor
         return Integer.parseInt(infos.get(0).get("count").toString());
     }
 
+    @Override
+    public int queryWorkDeductionCount(Map info) {
+        logger.debug("查询 queryWorkDeductionCount 入参 info : {}",info);
+
+        List<Map> infos = sqlSessionTemplate.selectList("workTaskItemV1ServiceDaoImpl.queryWorkDeductionCount", info);
+        if (infos.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(infos.get(0).get("count").toString());
+    }
+
+    @Override
+    public List<Map> queryWorkDeductions(Map info) {
+        logger.debug("查询 getWorkTaskItemInfo 入参 info : {}",info);
+
+        List<Map> infos = sqlSessionTemplate.selectList("workTaskItemV1ServiceDaoImpl.queryWorkDeductions",info);
+
+        return infos;
+    }
+
 
 }

+ 23 - 1
service-oa/src/main/java/com/java110/oa/smo/impl/WorkTaskItemV1InnerServiceSMOImpl.java

@@ -16,6 +16,7 @@
 package com.java110.oa.smo.impl;
 
 
+import com.java110.dto.work.WorkCopyDto;
 import com.java110.oa.dao.IWorkTaskItemV1ServiceDao;
 import com.java110.intf.oa.IWorkTaskItemV1InnerServiceSMO;
 import com.java110.dto.work.WorkTaskItemDto;
@@ -82,6 +83,27 @@ public class WorkTaskItemV1InnerServiceSMOImpl extends BaseServiceSMO implements
 
     @Override
     public int queryWorkTaskItemsCount(@RequestBody WorkTaskItemDto workTaskItemDto) {
-        return workTaskItemV1ServiceDaoImpl.queryWorkTaskItemsCount(BeanConvertUtil.beanCovertMap(workTaskItemDto));    }
+        return workTaskItemV1ServiceDaoImpl.queryWorkTaskItemsCount(BeanConvertUtil.beanCovertMap(workTaskItemDto));
+    }
+
+    @Override
+    public int queryWorkDeductionCount(@RequestBody WorkTaskItemDto workCopyDto) {
+        return workTaskItemV1ServiceDaoImpl.queryWorkDeductionCount(BeanConvertUtil.beanCovertMap(workCopyDto));
+    }
+
+    @Override
+    public List<WorkTaskItemDto> queryWorkDeductions(@RequestBody WorkTaskItemDto workTaskItemDto) {
+        //校验是否传了 分页信息
+
+        int page = workTaskItemDto.getPage();
+
+        if (page != PageDto.DEFAULT_PAGE) {
+            workTaskItemDto.setPage((page - 1) * workTaskItemDto.getRow());
+        }
+
+        List<WorkTaskItemDto> workTaskItems = BeanConvertUtil.covertBeanList(workTaskItemV1ServiceDaoImpl.queryWorkDeductions(BeanConvertUtil.beanCovertMap(workTaskItemDto)), WorkTaskItemDto.class);
+
+        return workTaskItems;
+    }
 
 }