Преглед на файлове

Merge branch 'master' of http://git.dayaedu.com/yonge/mec

zouxuan преди 4 години
родител
ревизия
65d24fc106

+ 15 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SysPaymentConfig.java

@@ -49,6 +49,13 @@ public class SysPaymentConfig {
     private Integer organId;
 
     /**
+     * 账户类型
+     */
+    @ApiModelProperty(value = "账户类型(0-内部、1-外部)")
+    private Integer accountType;
+
+
+    /**
      * 分部名称
      */
     @ApiModelProperty(value = "分部名称")
@@ -231,5 +238,13 @@ public class SysPaymentConfig {
     public void setRouteScale(String routeScale) {
         this.routeScale = routeScale;
     }
+
+    public Integer getAccountType() {
+        return accountType;
+    }
+
+    public void setAccountType(Integer accountType) {
+        this.accountType = accountType;
+    }
 }
 

+ 13 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/OperatingReportServiceImpl.java

@@ -5,6 +5,7 @@ import com.ym.mec.biz.dal.dto.OrganFullJobResourceNumDto;
 import com.ym.mec.biz.dal.entity.CooperationOrgan;
 import com.ym.mec.biz.dal.entity.FinancialExpenditure;
 import com.ym.mec.biz.dal.entity.OperatingReport;
+import com.ym.mec.biz.dal.entity.Organization;
 import com.ym.mec.biz.dal.enums.ExpenditureTypeEnum;
 import com.ym.mec.biz.service.OperatingReportService;
 import com.ym.mec.common.dal.BaseDAO;
@@ -30,6 +31,8 @@ public class OperatingReportServiceImpl extends BaseServiceImpl<Integer, Operati
     private FinancialExpenditureDao financialExpenditureDao;
     @Autowired
     private SysConfigDao sysConfigDao;
+    @Autowired
+    private OrganizationDao organizationDao;
 
 
     @Override
@@ -47,7 +50,7 @@ public class OperatingReportServiceImpl extends BaseServiceImpl<Integer, Operati
         Map<Integer, OperatingReport> cooperationOperating = new HashMap<>();
         Map<Integer, OperatingReport> organOperating = new HashMap<>();
 
-        //1获取分部的全职资源数的分摊费用
+        //1.1 获取分部的全职资源数的分摊费用
         BigDecimal fullJobFee = new BigDecimal(sysConfigDao.findConfigValue("full_job_fee"));
         List<OrganFullJobResourceNumDto> organFullJobResources = cooperationOrganDao.getOrganFullJobResourceNum();
         for (OrganFullJobResourceNumDto organFullJobResource : organFullJobResources) {
@@ -56,7 +59,15 @@ public class OperatingReportServiceImpl extends BaseServiceImpl<Integer, Operati
             operatingReport.setDistributionAmount(new BigDecimal(organFullJobResource.getNum()).multiply(fullJobFee).divide(new BigDecimal(12), 2, BigDecimal.ROUND_HALF_UP));
             organOperating.put(organFullJobResource.getOrganId(), operatingReport);
         }
-        //1、合作单位的全职资源分摊费用
+        //1.2 初始化没有全职资源数的分部
+        List<Organization> organs = organizationDao.findAllOrgans();
+        for (Organization organ : organs) {
+            if(organOperating.containsKey(organ.getId())) continue;
+            OperatingReport operatingReport = new OperatingReport();
+            operatingReport.setOrganId(organ.getId());
+            organOperating.put(organ.getId(), operatingReport);
+        }
+        //1.3 合作单位的全职资源分摊费用
         List<CooperationOrgan> allCooperationOrgan = cooperationOrganDao.getAllCooperationOrgan();
         for (CooperationOrgan cooperationOrgan : allCooperationOrgan) {
             OperatingReport operatingReport = new OperatingReport();

+ 11 - 1
mec-biz/src/main/resources/config/mybatis/SysPaymentConfigMapper.xml

@@ -5,6 +5,7 @@
         <!--@Table sys_payment_config-->
         <id column="id_" jdbcType="INTEGER" property="id"/>
         <result column="organ_id_" property="organId"/>
+        <result column="account_tyoe_" property="accountType"/>
         <result column="pay_type_" property="payType"/>
         <result column="yq_mer_no_" property="yqMerNo"/>
         <result column="hf_mer_no_" property="hfMerNo"/>
@@ -22,7 +23,7 @@
     </resultMap>
     <sql id="Base_Column_List">
         <!--@mbg.generated-->
-        id_, organ_id_,pay_type_,yq_mer_no_,hf_mer_no_,type_,route_scale_,create_time_, update_time_
+        id_, organ_id_,account_type_,pay_type_,yq_mer_no_,hf_mer_no_,type_,route_scale_,create_time_, update_time_
     </sql>
     <select id="get" parameterType="java.lang.Integer" resultMap="SysPaymentConfig">
         <!--@mbg.generated-->
@@ -44,6 +45,9 @@
             <if test="organId != null">
                 organ_id_,
             </if>
+            <if test="accountType != null">
+                account_type_,
+            </if>
             <if test="payType != null">
                 pay_type_,
             </if>
@@ -70,6 +74,9 @@
             <if test="organId != null">
                 #{organId},
             </if>
+            <if test="accountType != null">
+                #{accountType},
+            </if>
             <if test="payType != null">
                 #{payType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
             </if>
@@ -100,6 +107,9 @@
             <if test="organId != null">
                 organ_id_ = #{organId},
             </if>
+            <if test="accountType != null">
+                account_type_ = #{accountType},
+            </if>
             <if test="payType != null">
                 pay_type_ = #{payType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
             </if>