Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/dev' into dev

大数据与最优化研究所 1 anno fa
parent
commit
67f7c5292f

+ 1 - 1
src/main/java/com/xjrsoft/module/ledger/mapper/WfSubscriptionMapper.java

@@ -39,5 +39,5 @@ public interface WfSubscriptionMapper extends MPJBaseMapper<WfSubscription> {
     /**
      * 列表查询
      */
-    List<WfSubscriptionExcelVo> getList(@Param("dto") WfSubscriptionPageDto dto);
+    List<WfSubscriptionPageVo> getList(@Param("dto") WfSubscriptionPageDto dto);
 }

+ 27 - 1
src/main/java/com/xjrsoft/module/ledger/service/impl/WfSubscriptionServiceImpl.java

@@ -30,7 +30,11 @@ import lombok.AllArgsConstructor;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 import java.util.Objects;
 import java.util.stream.Collectors;
 
@@ -159,6 +163,28 @@ public class WfSubscriptionServiceImpl extends MPJBaseServiceImpl<WfSubscription
 
     @Override
     public List<WfSubscriptionExcelVo> getList(WfSubscriptionPageDto dto) {
-        return wfSubscriptionMapper.getList(dto);
+        List<WfSubscriptionList> wfSubscriptionList = wfSubscriptionListMapper.selectList(
+                new QueryWrapper<WfSubscriptionList>().lambda().orderByAsc(WfSubscriptionList::getId)
+        );
+        Map<Long, String> flowMap = new HashMap<>();
+        for (WfSubscriptionList subscriptionList : wfSubscriptionList) {
+            if(flowMap.containsKey(subscriptionList.getParentId())){
+                continue;
+            }
+            flowMap.put(subscriptionList.getParentId(), subscriptionList.getNameOfThePurchasedItem());
+        }
+        List<WfSubscriptionPageVo> list = wfSubscriptionMapper.getList(dto);
+        List<WfSubscriptionExcelVo> result = new ArrayList<>();
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        for (WfSubscriptionPageVo record : list) {
+            WfSubscriptionExcelVo excelVo = BeanUtil.toBean(record, WfSubscriptionExcelVo.class);
+            if(record.getShenQingRiQi4752() != null){
+                excelVo.setApplyDate(sdf.format(record.getShenQingRiQi4752()));
+            }
+
+            excelVo.setFlowName(flowMap.get(record.getId()));
+            result.add(excelVo);
+        }
+        return result;
     }
 }

+ 25 - 25
src/main/java/com/xjrsoft/module/ledger/vo/WfSubscriptionExcelVo.java

@@ -10,49 +10,49 @@ import java.util.Date;
 import java.util.List;
 
 /**
-* @title: 物品申购分页列表出参
-* @Author dzx
-* @Date: 2024-02-19
-* @Version 1.0
-*/
+ * @title: 物品申购分页列表出参
+ * @Author dzx
+ * @Date: 2024-02-19
+ * @Version 1.0
+ */
 @Data
 public class WfSubscriptionExcelVo {
-
     /**
-    * 
-    */
+     * 附件
+     */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("编号")
+    @ApiModelProperty("编号")
+    private String number;
+    /**
+     *
+     */
     @ContentStyle(dataFormat = 49)
-    @ExcelProperty("主键编号")
-    @ApiModelProperty("主键编号")
-    private String id;
+    @ExcelProperty("流程名称")
+    @ApiModelProperty("流程名称")
+    private String flowName;
     /**
-    * 申请部门
-    */
+     * 申请部门
+     */
     @ContentStyle(dataFormat = 49)
     @ExcelProperty("申请部门")
     @ApiModelProperty("申请部门")
     private String orgName;
     /**
-    * 申请日期
-    */
+     * 申请日期
+     */
     @ContentStyle(dataFormat = 49)
     @ExcelProperty("申请日期")
     @ApiModelProperty("申请日期")
-    private String shenQingRiQi4752;
+    private String applyDate;
     /**
-    * 申请人
-    */
+     * 申请人
+     */
     @ContentStyle(dataFormat = 49)
     @ExcelProperty("申请人")
     @ApiModelProperty("申请人")
     private String userName;
-    /**
-    * 附件
-    */
-    @ContentStyle(dataFormat = 49)
-    @ExcelProperty("编号")
-    @ApiModelProperty("编号")
-    private String number;
+
 
 
 }

+ 2 - 2
src/main/resources/mapper/ledger/WfSubscriptionMapper.xml

@@ -20,8 +20,8 @@
         order by t1.shen_qing_ri_qi4752 desc
     </select>
 
-    <select id="getList" parameterType="com.xjrsoft.module.ledger.dto.WfSubscriptionPageDto" resultType="com.xjrsoft.module.ledger.vo.WfSubscriptionExcelVo">
-        select t1.id,t2.name as org_name,t3.name as user_name,DATE_FORMAT(t1.shen_qing_ri_qi4752, '%Y年%m月%d日') as shen_qing_ri_qi4752, t1.folder_id,t1.number from wf_subscription t1
+    <select id="getList" parameterType="com.xjrsoft.module.ledger.dto.WfSubscriptionPageDto" resultType="com.xjrsoft.module.ledger.vo.WfSubscriptionPageVo">
+        select t1.id,t2.name as org_name,t3.name as user_name,t1.shen_qing_ri_qi4752, t1.folder_id,t1.number from wf_subscription t1
         left join xjr_department t2 on t1.application_department = t2.id
         left join xjr_user t3 on t1.user_id = t3.id
         where 1 = 1