Bläddra i källkod

经营报表导出

zouxuan 2 år sedan
förälder
incheckning
b4d1ff6d9e

+ 6 - 71
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/PWorkOrderInfo.java

@@ -1,5 +1,10 @@
 package com.ym.mec.biz.dal.dto;
 
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
 public class PWorkOrderInfo {
     private Integer id;
 
@@ -19,75 +24,5 @@ public class PWorkOrderInfo {
 
     private Integer deptId;
 
-    public Integer getDeptId() {
-        return deptId;
-    }
-
-    public void setDeptId(Integer deptId) {
-        this.deptId = deptId;
-    }
-
-    public String getTitle() {
-        return title;
-    }
-
-    public void setTitle(String title) {
-        this.title = title;
-    }
-
-    public Integer getId() {
-        return id;
-    }
-
-    public void setId(Integer id) {
-        this.id = id;
-    }
-
-    public Integer getProcess() {
-        return process;
-    }
-
-    public void setProcess(Integer process) {
-        this.process = process;
-    }
-
-    public Integer getClassify() {
-        return classify;
-    }
-
-    public void setClassify(Integer classify) {
-        this.classify = classify;
-    }
-
-    public Boolean getEnd() {
-        return isEnd;
-    }
-
-    public void setEnd(Boolean end) {
-        isEnd = end;
-    }
-
-    public Boolean getDenied() {
-        return isDenied;
-    }
-
-    public void setDenied(Boolean denied) {
-        isDenied = denied;
-    }
-
-    public Boolean getCancel() {
-        return isCancel;
-    }
-
-    public void setCancel(Boolean cancel) {
-        isCancel = cancel;
-    }
-
-    public Integer getCreator() {
-        return creator;
-    }
-
-    public void setCreator(Integer creator) {
-        this.creator = creator;
-    }
+    private Date updateTime;
 }

+ 3 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/FinancialExpenditure.java

@@ -61,6 +61,9 @@ public class FinancialExpenditure {
 	/**  */
 	@ApiModelProperty(value = "经营报表生效时间",required = false)
 	private String effectiveTime;
+	/**  */
+	@ApiModelProperty(value = "审批通过时间",required = false)
+	private Date aprovalTime;
 
 	@ApiModelProperty(value = "当月实际金额",required = false)
 	private BigDecimal currentAmount = BigDecimal.ZERO;;

+ 6 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/FinancialExpenditureServiceImpl.java

@@ -242,6 +242,7 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
             if(hasFinancial != null){
                 return;
             }
+            Date endTime = pWorkOrderInfo.getUpdateTime();
             String realName = "";
             if(pWorkOrderInfo.getCreator() != null){
                 SimpleUserDto simpleUser = teacherDao.getSimpleUser(pWorkOrderInfo.getCreator());
@@ -321,6 +322,7 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
                                                 }
                                             }
                                         }
+                                        financialExpenditure.setAprovalTime(endTime);
                                         financialExpenditure.setAmount(totalAmount);
                                         financialExpenditure.setCause(note);
                                         financialExpenditure.setBatchNo(pWorkOrderInfo.getId().toString());
@@ -338,6 +340,7 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
                         nullUser:
                         for (HashMap hashMap : hashMaps) {
                             FinancialExpenditure financialExpenditure = new FinancialExpenditure();
+                            financialExpenditure.setAprovalTime(endTime);
                             financialExpenditure.setBatchNo(pWorkOrderInfo.getId().toString());
                             financialExpenditure.setFinancialProcessNo(pWorkOrderInfo.getId().toString());
                             financialExpenditure.setApplyUser(realName);
@@ -411,7 +414,7 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
                                                     financialExpenditure.setType(ExpenditureTypeEnum.valueOfDesc(o.toString()));
                                                     continue;
                                                 }
-                                            } else if (name.contains("费用类型")) {
+                                            } else if (name.contains("费用类型") || name.contains("费用类别")) {
                                                 Object o = hashMap.get(inputDto.getModel());
                                                 if (Objects.nonNull(o) && StringUtils.isNotEmpty(o.toString())) {
                                                     financialExpenditure.setFeeProject(FeeProjectEnum.valueOfDesc(o.toString()));
@@ -495,6 +498,7 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
                     }
                     if(CollectionUtils.isNotEmpty(financialExpenditures)){
                         for (FinancialExpenditure financialExpenditure : financialExpenditures) {
+                            financialExpenditure.setAprovalTime(endTime);
                             financialExpenditure.setApplyUser(realName);
                             financialExpenditure.setType(ExpenditureTypeEnum.REFUND);
                             financialExpenditure.setFeeProject(FeeProjectEnum.REFUND);
@@ -510,6 +514,7 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
                 financialExpenditureDao.batchInsert(financialExpenditureList);
             }else {
                 FinancialExpenditure financialExpenditure = new FinancialExpenditure();
+                financialExpenditure.setAprovalTime(endTime);
                 financialExpenditure.setBatchNo(workOrderId.toString());
                 financialExpenditure.setFinancialProcessNo(workOrderId.toString());
                 financialExpenditure.setApplyUser(realName);

+ 7 - 4
mec-biz/src/main/resources/config/mybatis/FinancialExpenditureMapper.xml

@@ -24,6 +24,7 @@
         <result column="current_amount_" property="currentAmount"/>
         <result column="del_flag_" property="delFlag"/>
         <result column="cause_" property="cause"/>
+        <result column="aproval_time_" property="aprovalTime"/>
         <result column="create_time_" property="createTime"/>
         <result column="update_time_" property="updateTime"/>
 		<result column="tenant_id_" property="tenantId" />
@@ -50,12 +51,13 @@
             keyProperty="id">
         INSERT INTO financial_expenditure (batch_no_, financial_process_no_, dingtalk_process_no_,
                                            process_id_,organ_id_, cooperation_organ_id_, apply_user_, apply_user_id_, amount_, item_detail_,
-                                           payment_time_, cause_, create_time_, update_time_, fee_project_, type_, tenant_id_,student_id_,effective_time_)
+                                           payment_time_, cause_, create_time_, update_time_, fee_project_, type_,
+                                           tenant_id_,student_id_,effective_time_,aproval_time_)
         VALUES (#{batchNo}, #{financialProcessNo}, #{dingtalkProcessNo},#{processId}, #{organId}, #{cooperationOrganId},
                 #{applyUser}, #{applyUserId}, #{amount},
                 #{itemDetail}, #{paymentTime}, #{cause}, now(), now(),
                 #{feeProject,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
-                #{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{tenantId},#{studentId},#{effectiveTime})
+                #{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{tenantId},#{studentId},#{effectiveTime},#{aprovalTime})
     </insert>
 
     <insert id="batchInsert" parameterType="com.ym.mec.biz.dal.entity.FinancialExpenditure" useGeneratedKeys="true"
@@ -63,14 +65,14 @@
             keyProperty="id">
         INSERT INTO financial_expenditure (batch_no_,financial_process_no_,dingtalk_process_no_,
         process_id_,organ_id_,cooperation_organ_id_,apply_user_,amount_,item_detail_,payment_time_,
-                                           cause_,create_time_,update_time_,fee_project_,type_,tenant_id_,student_id_,effective_time_)
+                                           cause_,create_time_,update_time_,fee_project_,type_,tenant_id_,student_id_,effective_time_,aproval_time_)
         VALUES
         <foreach collection="financialExpenditures" item="item" separator=",">
             (#{item.batchNo},#{item.financialProcessNo},#{item.dingtalkProcessNo},#{item.processId},#{item.organId},
             #{item.cooperationOrganId},#{item.applyUser},#{item.amount},
             #{item.itemDetail},#{item.paymentTime},#{item.cause},now(),now(),
             #{item.feeProject,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
-            #{item.type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{item.tenantId},#{item.studentId},#{effectiveTime})
+            #{item.type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{item.tenantId},#{item.studentId},#{effectiveTime},#{aprovalTime})
         </foreach>
     </insert>
 
@@ -232,6 +234,7 @@
         <result property="process" column="process"/>
         <result property="title" column="title"/>
         <result property="deptId" column="dept_id"/>
+        <result property="updateTime" column="update_time"/>
     </resultMap>
     <select id="getWorkOrderInfo" resultMap="PWorkOrderInfo">
         SELECT woi.*,su.mec_user_id FROM oa_pro.p_work_order_info woi

+ 2 - 2
mec-biz/src/main/resources/config/mybatis/OperatingReportNewMapper.xml

@@ -377,7 +377,7 @@
 			SUM(CASE WHEN hc.human_cost_type_ = 'STUDENT_MANAGEMENT_FEE_ADJUSTMENT' THEN hc.amount_ ELSE 0 END) AS studentManagementFeeAdjustment
 		FROM
 			organization o
-				left join financial_expenditure fe ON o.id_ = fe.organ_id_ AND fe.process_id_ = 28 AND DATE_FORMAT(fe.create_time_, '%Y-%m') = #{month} AND fe.del_flag_ = 0
+				left join financial_expenditure fe ON o.id_ = fe.organ_id_ AND fe.process_id_ = 28 AND DATE_FORMAT(fe.aproval_time_, '%Y-%m') = #{month} AND fe.del_flag_ = 0
 				left join human_cost hc ON hc.organ_id_ = o.id_  AND hc.month_ = #{month}
 		WHERE
 			o.tenant_id_ = 1 AND o.del_flag_ = 0
@@ -403,7 +403,7 @@
 		from financial_expenditure fe
 				 left join organization o ON o.id_ = fe.organ_id_
 				 left join cooperation_organ co ON co.id_ = fe.cooperation_organ_id_
-		where fe.process_id_ IN (19,22,28) AND fe.del_flag_ = 0 AND DATE_FORMAT(fe.create_time_, '%Y-%m') = #{month}
+		where fe.process_id_ IN (19,22,28,51) AND fe.del_flag_ = 0 AND DATE_FORMAT(fe.aproval_time_, '%Y-%m') = #{month}
 		order by fe.id_ DESC
 	</select>
 	<select id="sumHumanCost" resultType="com.ym.mec.biz.dal.dto.HumanTypeDto">