瀏覽代碼

Merge branch 'saas' of http://git.dayaedu.com/yonge/mec into feature/0529-live

zouxuan 2 年之前
父節點
當前提交
32a0effe34

+ 4 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ExportServiceImpl.java

@@ -1790,8 +1790,8 @@ public class ExportServiceImpl implements ExportService {
             List<JSONObject> orderItemList = JSONObject.parseArray(JSONObject.parseObject(goodsJson).getString("orderItemList"), JSONObject.class);
             productIdList.addAll(orderItemList.stream().map(e -> e.get("productId").toString()).collect(Collectors.toSet()));
         }
-        List<String> categoryNames = sellOrderDao.getMallProductCategory("mall_pro");
-        Map<Long,String> productCategoryMap = MapUtil.convertMybatisMap(sellOrderDao.getMallProductMap(productIdList,"mall_pro"));
+        List<String> categoryNames = sellOrderDao.getMallProductCategory("mec_mall");
+        Map<Long,String> productCategoryMap = MapUtil.convertMybatisMap(sellOrderDao.getMallProductMap(productIdList,"mec_mall"));
         for (StudentPaymentOrderMallExportDto row : studentPaymentOrderExportDtos) {
             if (row.getActualAmount() == null) {
                 row.setActualAmount(BigDecimal.ZERO);
@@ -2622,8 +2622,8 @@ public class ExportServiceImpl implements ExportService {
             List<JSONObject> orderItemList = JSONObject.parseArray(JSONObject.parseObject(goodsJson).getString("orderItemList"), JSONObject.class);
             productIdList.addAll(orderItemList.stream().map(e -> e.get("productId").toString()).collect(Collectors.toSet()));
         }
-        List<String> categoryNames = sellOrderDao.getMallProductCategory("mall_pro");
-        Map<Long,String> productCategoryMap = MapUtil.convertMybatisMap(sellOrderDao.getMallProductMap(productIdList,"mall_pro"));
+        List<String> categoryNames = sellOrderDao.getMallProductCategory("mec_mall");
+        Map<Long,String> productCategoryMap = MapUtil.convertMybatisMap(sellOrderDao.getMallProductMap(productIdList,"mec_mall"));
         for (StudentPaymentOrderMallExportDto basicOrder : studentPaymentOrderExportDtos) {
             basicOrder.getUser().setUsername(studentNameMap.get(basicOrder.getUserId()));
             basicOrder.setUserOrganName(userOrganNameMap.get(basicOrder.getOrganId()));

+ 19 - 13
mec-biz/src/main/java/com/ym/mec/biz/service/impl/FinancialExpenditureServiceImpl.java

@@ -264,7 +264,6 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
                 List<FinancialExpenditure> financialExpenditureList = new ArrayList<>();
                 Integer organId = null;
                 String note = "";
-                ExpenditureTypeEnum expenditureTypeEnum = ExpenditureTypeEnum.REFUND;
                 FeeProjectEnum feeProjectEnum = FeeProjectEnum.REFUND;
                 BigDecimal totalAmount = BigDecimal.ZERO;
 
@@ -283,9 +282,6 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
                     if (oaInputDto.getName().contains("金额")) {
                         totalAmount = new BigDecimal(submitValue.toString());
                     }
-                    if (StringUtils.equals("支出类型", oaInputDto.getName())) {
-                        expenditureTypeEnum = ExpenditureTypeEnum.valueOfDesc(submitValue.toString());
-                    }
                     if (StringUtils.equals("费用类别", oaInputDto.getName()) || StringUtils.equals("费用类型", oaInputDto.getName())) {
                         feeProjectEnum = FeeProjectEnum.valueOfDesc(submitValue.toString());
                     }
@@ -328,7 +324,7 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
                                     }
                                 }
                                 financialExpenditure.setFeeProject(feeProjectEnum);
-                                financialExpenditure.setType(expenditureTypeEnum);
+                                financialExpenditure.setType(getExpenditureType(feeProjectEnum));
                                 financialExpenditure.setAprovalTime(endTime);
                                 financialExpenditure.setPaymentTime(endTime);
                                 financialExpenditure.setAmount(totalAmount);
@@ -356,7 +352,6 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
                             financialExpenditure.setApplyUserId(pWorkOrderInfo.getCreator());
                             financialExpenditure.setProcessId(pWorkOrderInfo.getProcess());
                             financialExpenditure.setEffectiveTime(DateUtil.format(endTime,DateUtil.ISO_YEAR_MONTH_FORMAT));
-                            financialExpenditure.setType(expenditureTypeEnum);
                             List<OaColumnDto> columns = oaInputDto.getColumns();
                             if (columns != null && columns.size() > 0) {
                                 for (OaColumnDto column : columns) {
@@ -391,14 +386,13 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
                                                 financialExpenditure.setCurrentAmount(financialExpenditure.getAmount());
                                             } else if (StringUtils.equals(name,"情况说明") || StringUtils.equals(name,"事由")) {
                                                 financialExpenditure.setCause(o.toString());
-                                            } else if (StringUtils.equals(name,"支出类型")) {
-                                                financialExpenditure.setType(ExpenditureTypeEnum.valueOfDesc(o.toString()));
-                                            } else if (StringUtils.equals(name,"费用类型") || StringUtils.equals(name,"费用类别")) {
+                                            }else if (StringUtils.equals(name,"费用类型") || StringUtils.equals(name,"费用类别")) {
                                                 FeeProjectEnum projectEnum = FeeProjectEnum.valueOfDesc(o.toString());
                                                 if(projectEnum == null){
                                                     projectEnum = feeProjectEnum;
                                                 }
                                                 financialExpenditure.setFeeProject(projectEnum);
+                                                financialExpenditure.setType(getExpenditureType(projectEnum));
                                             }else if (StringUtils.equals(name,"日期") || StringUtils.equals(name,"费用发生日期")) {
                                                 financialExpenditure.setPaymentTime(DateUtil.stringToDate(o.toString(),DateUtil.DEFAULT_PATTERN));
                                             } else if (StringUtils.equals(name,"费用分摊月份")) {
@@ -483,11 +477,10 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
                         for (FinancialExpenditure financialExpenditure : financialExpenditures) {
                             financialExpenditure.setAprovalTime(endTime);
                             financialExpenditure.setPaymentTime(endTime);
-                            financialExpenditure.setType(expenditureTypeEnum);
                             financialExpenditure.setEffectiveTime(DateUtil.format(endTime,DateUtil.ISO_YEAR_MONTH_FORMAT));
                             financialExpenditure.setApplyUser(realName);
-                            financialExpenditure.setType(ExpenditureTypeEnum.REFUND);
                             financialExpenditure.setFeeProject(FeeProjectEnum.REFUND);
+                            financialExpenditure.setType(getExpenditureType(financialExpenditure.getFeeProject()));
                             financialExpenditure.setBatchNo(pWorkOrderInfo.getId().toString());
                             financialExpenditure.setFinancialProcessNo(pWorkOrderInfo.getId().toString());
                         }
@@ -525,10 +518,9 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
                         financialExpenditure.setCurrentAmount(financialExpenditure.getAmount());
                     }else if(StringUtils.equals(name,"情况说明")){
                         financialExpenditure.setCause(o.toString());
-                    }else if(StringUtils.equals(name,"支出类型")){
-                        financialExpenditure.setType(ExpenditureTypeEnum.valueOfDesc(o.toString()));
                     }else if(StringUtils.equals(name,"费用类型") || StringUtils.equals(name,"费用类别")){
                         financialExpenditure.setFeeProject(FeeProjectEnum.valueOfDesc(o.toString()));
+                        financialExpenditure.setType(getExpenditureType(financialExpenditure.getFeeProject()));
                     }
                 }
                 financialExpenditureDao.insert(financialExpenditure);
@@ -536,6 +528,19 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
         }
     }
 
+    public static ExpenditureTypeEnum getExpenditureType(FeeProjectEnum feeProjectEnum) {
+        switch (feeProjectEnum) {
+            case REFUND:
+                return ExpenditureTypeEnum.REFUND;
+            case HOUSE:
+            case OFFICE:
+            case MAINS_PROPERTY:
+                return ExpenditureTypeEnum.FIXED;
+            default:
+                return ExpenditureTypeEnum.VARIABLE;
+        }
+    }
+
     @Override
     public void checkCourseReturnFee(Map<String,String> paramMap) {
         String tplInfoId = paramMap.get("tplInfoId");
@@ -721,4 +726,5 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
         }
         return financialExpenditureList;
     }
+
 }

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

@@ -673,16 +673,16 @@
         </foreach>
     </select>
     <select id="getMallProductMap" resultType="java.util.Map">
-        select pp.id 'key',ppc.name 'value' from mall_pro.pms_product_category ppc
-        left join mall_pro.pms_product_category ppcc ON ppcc.parent_id = ppc.id
-        left join mall_pro.pms_product pp ON pp.product_category_id = ppcc.id
+        select pp.id 'key',ppc.name 'value' from mec_mall.pms_product_category ppc
+        left join mec_mall.pms_product_category ppcc ON ppcc.parent_id = ppc.id
+        left join mec_mall.pms_product pp ON pp.product_category_id = ppcc.id
         where pp.id IN
         <foreach collection="productIdList" item="id" open="(" close=")" separator=",">
             #{id}
         </foreach>
     </select>
     <select id="getMallProductCategory" resultType="java.lang.String">
-        select name from mall_pro.pms_product_category where parent_id = 0
+        select name from mec_mall.pms_product_category where parent_id = 0
     </select>
 
 </mapper>

+ 6 - 6
mec-student/src/main/java/com/ym/mec/student/controller/WechatController.java

@@ -43,11 +43,11 @@ public class WechatController extends BaseController {
 
 	@ApiOperation("获取签名")
 	@GetMapping(value = "/getSignature")
-	public Object getSignature(String url,String platForm) throws Exception {
-		if(StringUtils.isEmpty(platForm)){
-			platForm = "gym";
+	public Object getSignature(String url,String platform) throws Exception {
+		if(StringUtils.isEmpty(platform)){
+			platform = "gym";
 		}
-		Map<String, String> appIdMap = appidMap.get(platForm);
+		Map<String, String> appIdMap = appidMap.get(platform);
 
 		url = URLDecoder.decode(url);
 		String appId = appIdMap.get("appId");
@@ -83,8 +83,8 @@ public class WechatController extends BaseController {
 		map.put("appId", "wx80f175c0eb6836e9");
 		map.put("secret", "a9d779747dba9f4e82f19882debe3e93");
 		Map<String,String> map1 = new HashMap<>();
-		map.put("appId", "wx751141096e75a4ee");
-		map.put("secret", "e882d76c95d1613607a85338b1bed3ff");
+		map1.put("appId", "wx751141096e75a4ee");
+		map1.put("secret", "e882d76c95d1613607a85338b1bed3ff");
 		resultMap.put("gym",map);
 		resultMap.put("daya",map1);
 		return resultMap;