瀏覽代碼

Merge remote-tracking branch 'origin/feature-operating-report' into feature-operating-report

周箭河 4 年之前
父節點
當前提交
b791dd97aa

+ 13 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/FinancialExpenditure.java

@@ -1,8 +1,8 @@
 package com.ym.mec.biz.dal.entity;
 
 import com.ym.mec.biz.dal.enums.ExpenditureTypeEnum;
+import com.ym.mec.biz.dal.enums.FeeProjectEnum;
 import io.swagger.annotations.ApiModelProperty;
-
 import java.math.BigDecimal;
 import java.util.Date;
 
@@ -30,8 +30,12 @@ public class FinancialExpenditure {
 	/**  */
 	@ApiModelProperty(value = "申请人编号",required = false)
 	private Integer applyUserId;
+
 	@ApiModelProperty(value = "支出类型(1:固定费用、2:变动费用:3:业务退费)",required = false)
 	private ExpenditureTypeEnum type;
+
+	@ApiModelProperty(value = "费用项目",required = false)
+	private FeeProjectEnum feeProject;
 	/**  */
 	@ApiModelProperty(value = "费用",required = false)
 	private BigDecimal amount;
@@ -51,6 +55,14 @@ public class FinancialExpenditure {
 	/**  */
 	private Integer delFlag;
 
+	public FeeProjectEnum getFeeProject() {
+		return feeProject;
+	}
+
+	public void setFeeProject(FeeProjectEnum feeProject) {
+		this.feeProject = feeProject;
+	}
+
 	public Integer getId() {
 		return id;
 	}

+ 43 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/FeeProjectEnum.java

@@ -0,0 +1,43 @@
+package com.ym.mec.biz.dal.enums;
+
+import com.ym.mec.common.enums.BaseEnum;
+
+public enum FeeProjectEnum implements BaseEnum<Integer, FeeProjectEnum> {
+    SALARY(1, "工资"),
+    SOCIAL_SECURITY_HOUSE_ALLOWANCE(2, "社保公积金"),
+    HOUSE(3, "房屋"),
+    OFFICE(4, "办公"),
+    MAINS_PROPERTY(5, "水电物业"),
+    TRAVEL(6, "差旅"),
+    SERVICES(7, "服务"),
+    WELFARE(8, "福利"),
+    ACTIVITIES(9, "活动"),
+    TRAFFIC(10, "交通"),
+    CERTIFICATES(11, "考级"),
+    INSTRUMENT(12, "琴行"),
+    HANDLING(13, "手续费"),
+    TAXES(14, "税金"),
+    COMMUNICATIONS(15, "通讯"),
+    POSTAL_TRANSPORT(16, "邮递运输"),
+    HOSPITALITY(17, "招待费"),
+    NETWORK_CLASS(18, "网络教室成本"),
+    REFUND(19, "退费");
+
+    private Integer code;
+
+    private String desc;
+
+    FeeProjectEnum(Integer code, String desc) {
+        this.code = code;
+        this.desc = desc;
+    }
+
+    @Override
+    public Integer getCode() {
+        return code;
+    }
+
+    public String getDesc() {
+        return desc;
+    }
+}

+ 22 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/FinancialExpenditureQueryInfo.java

@@ -23,12 +23,34 @@ public class FinancialExpenditureQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "申请人编号",required = false)
     private Integer applyUserId;
     /**  */
+    @ApiModelProperty(value = "费用项目",required = false)
+    private Integer feeProject;
+    /**  */
+    @ApiModelProperty(value = "支出类型",required = false)
+    private Integer type;
+    /**  */
     @ApiModelProperty(value = "开始时间",required = false)
     private String startTime;
     /**  */
     @ApiModelProperty(value = "结束时间",required = false)
     private String endTime;
 
+    public Integer getFeeProject() {
+        return feeProject;
+    }
+
+    public void setFeeProject(Integer feeProject) {
+        this.feeProject = feeProject;
+    }
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
     public String getBatchNo() {
         return batchNo;
     }

+ 26 - 5
mec-biz/src/main/java/com/ym/mec/biz/service/impl/FinancialExpenditureServiceImpl.java

@@ -5,6 +5,9 @@ import com.alibaba.fastjson.JSONObject;
 import com.ym.mec.biz.dal.dao.FinancialExpenditureDao;
 import com.ym.mec.biz.dal.dto.FinancialExpenditureDto;
 import com.ym.mec.biz.dal.entity.FinancialExpenditure;
+import com.ym.mec.biz.dal.enums.ExpenditureTypeEnum;
+import com.ym.mec.biz.dal.enums.FeeProjectEnum;
+import com.ym.mec.biz.dal.enums.GoodsType;
 import com.ym.mec.biz.dal.enums.TemplateTypeEnum;
 import com.ym.mec.biz.dal.page.FinancialExpenditureQueryInfo;
 import com.ym.mec.biz.service.FinancialExpenditureService;
@@ -69,21 +72,39 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
 					String columnValue = columns.get(s);
 					if (columnValue.equals("phone")) {
 						if(StringUtils.isEmpty(row.get(s).toString())){
-							LOGGER.error("商品导入异常:手机号不可为空 param:{}",objectMap);
+							LOGGER.error("支出记录导入异常:手机号不可为空 param:{}",objectMap);
 							continue valueIsNull;
 						}else {
 							Integer integer = phoneMap.get(row.get(s));
 							if(integer == null){
-								LOGGER.error("商品导入异常:手机号校验失败 param:{}",objectMap);
+								LOGGER.error("支出记录导入异常:手机号校验失败 param:{}",objectMap);
 								continue valueIsNull;
 							}else {
 								objectMap.put("applyUserId", integer);
 							}
 						}
 					}
+					if (columnValue.equals("type")) {
+						for (ExpenditureTypeEnum expenditureType : ExpenditureTypeEnum.values()) {
+							if (expenditureType.getDesc().equals(row.get(s).toString())) {
+								objectMap.put(columnValue, expenditureType);
+								break;
+							}
+						}
+						continue;
+					}
+					if (columnValue.equals("feeProject")) {
+						for (FeeProjectEnum feeProject : FeeProjectEnum.values()) {
+							if (feeProject.getDesc().equals(row.get(s).toString())) {
+								objectMap.put(columnValue, feeProject);
+								break;
+							}
+						}
+						continue;
+					}
 					if (columnValue.equals("amount")) {
 						if(StringUtils.isEmpty(row.get(s).toString())){
-							LOGGER.error("商品导入异常:费用不可为空 param:{}",objectMap);
+							LOGGER.error("支出记录导入异常:费用不可为空 param:{}",objectMap);
 							continue valueIsNull;
 						}else {
 							objectMap.put("amount", row.get(s));
@@ -92,7 +113,7 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
 					if (columnValue.equals("organName") && StringUtils.isNotEmpty(row.get(s).toString())) {
 						Integer integer = organMap.get(row.get(s));
 						if(integer == null){
-							LOGGER.error("商品导入异常:分部校验失败 param:{}",objectMap);
+							LOGGER.error("支出记录导入异常:分部校验失败 param:{}",objectMap);
 						}else {
 							objectMap.put("organId", integer);
 						}
@@ -100,7 +121,7 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
 					if (columnValue.equals("cooperationOrganName") && StringUtils.isNotEmpty(row.get(s).toString())) {
 						Integer integer = cooperationOrganMap.get(row.get(s));
 						if(integer == null){
-							LOGGER.error("商品导入异常:合作单位校验失败 param:{}",objectMap);
+							LOGGER.error("支出记录导入异常:合作单位校验失败 param:{}",objectMap);
 						}else {
 							objectMap.put("cooperationOrganId", integer);
 						}

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

@@ -15,6 +15,7 @@
         <result column="cooperation_organ_id_" property="cooperationOrganId"/>
         <result column="apply_user_id_" property="applyUserId"/>
         <result column="type_" property="type" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+        <result column="fee_project_" property="feeProject" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result column="amount_" property="amount"/>
         <result column="item_detail_" property="itemDetail"/>
         <result column="payment_time_" property="paymentTime"/>
@@ -38,17 +39,22 @@
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.FinancialExpenditure" useGeneratedKeys="true" keyColumn="id"
             keyProperty="id">
         INSERT INTO financial_expenditure (batch_no_,financial_process_no_,dingtalk_process_no_,
-        organ_id_,cooperation_organ_id_,apply_user_id_,amount_,item_detail_,payment_time_,cause_,create_time_,update_time_)
+        organ_id_,cooperation_organ_id_,apply_user_id_,amount_,item_detail_,payment_time_,cause_,create_time_,update_time_,fee_project_,type_)
         VALUES(#{batchNo},#{financialProcessNo},#{dingtalkProcessNo},#{organId},#{cooperationOrganId},#{applyUserId},#{amount},
-        #{itemDetail},#{paymentTime},#{cause},now(),now())
+        #{itemDetail},#{paymentTime},#{cause},now(),now(),#{feeProject,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+        #{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler})
     </insert>
+
     <insert id="batchInsert">
         INSERT INTO financial_expenditure (batch_no_,financial_process_no_,dingtalk_process_no_,
-        organ_id_,cooperation_organ_id_,apply_user_id_,amount_,item_detail_,payment_time_,cause_,create_time_,update_time_)
+        organ_id_,cooperation_organ_id_,apply_user_id_,amount_,item_detail_,payment_time_,cause_,create_time_,update_time_,fee_project_,type_)
         VALUES
         <foreach collection="financialExpenditures" item="item" separator=",">
-            (#{item.batchNo},#{item.financialProcessNo},#{item.dingtalkProcessNo},#{item.organId},#{item.cooperationOrganId},#{item.applyUserId},#{item.amount},
-            #{item.itemDetail},#{item.paymentTime},#{item.cause},now(),now())
+            (#{item.batchNo},#{item.financialProcessNo},#{item.dingtalkProcessNo},#{item.organId},
+            #{item.cooperationOrganId},#{item.applyUserId},#{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})
         </foreach>
     </insert>
 
@@ -56,8 +62,11 @@
     <update id="update" parameterType="com.ym.mec.biz.dal.entity.FinancialExpenditure">
         UPDATE financial_expenditure
         <set>
-            <if test="delFlag != null">
-                del_flag_ = #{delFlag},
+            <if test="feeProject != null">
+                fee_project_ = #{feeProject,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+            </if>
+            <if test="type != null">
+                type_ = #{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
             </if>
             <if test="batchNo != null">
                 batch_no_ = #{batchNo},
@@ -108,6 +117,12 @@
             <if test="batchNo != null and batchNo != ''">
                 AND fe.batch_no_ = #{batchNo}
             </if>
+            <if test="feeProject != null">
+                AND fe.fee_project_ = #{feeProject}
+            </if>
+            <if test="type != null">
+                AND fe.type_ = #{type}
+            </if>
             <if test="financialProcessNo != null and financialProcessNo != ''">
                 AND fe.financial_process_no_ = #{financialProcessNo}
             </if>

+ 7 - 5
mec-web/src/main/resources/columnMapper.ini

@@ -16,10 +16,12 @@
 批次号 = batchNo
 财务流程编号 = financialProcessNo
 钉钉流程编号 = dingtalkProcessNo
-分部 = organName
-合作单位 = cooperationOrganName
+费用归属分部 = organName
+费用归属学校 = cooperationOrganName
 申请人(手机号) = phone
-费用 = amount
-费用明细 = itemDetail
-支付时间 = paymentTime
+费用类型 = type
+费用项目 = feeProject
+付款金额 = amount
+备注 = itemDetail
+付款时间 = paymentTime
 事由 = cause

二進制
mec-web/src/main/resources/excelTemplate/财务支出导入模板.xls