From 4ab167bd46cc342c08d3fad9cfa10baf02817114 Mon Sep 17 00:00:00 2001 From: fuliqi <fuliqi@qq.com> Date: 星期二, 20 八月 2024 17:17:25 +0800 Subject: [PATCH] 合同模板修改 --- ycl-server/src/main/java/com/ycl/platform/service/impl/TContractServiceImpl.java | 96 +++++++++++++++++------------------------------ 1 files changed, 35 insertions(+), 61 deletions(-) diff --git a/ycl-server/src/main/java/com/ycl/platform/service/impl/TContractServiceImpl.java b/ycl-server/src/main/java/com/ycl/platform/service/impl/TContractServiceImpl.java index 747dd0e..03bc5de 100644 --- a/ycl-server/src/main/java/com/ycl/platform/service/impl/TContractServiceImpl.java +++ b/ycl-server/src/main/java/com/ycl/platform/service/impl/TContractServiceImpl.java @@ -79,69 +79,43 @@ private List<CalculateRule> getExcelData() { ArrayList<CalculateRule> list = new ArrayList<>(); - CalculateRule calculateRule1 = new CalculateRule(); - calculateRule1.setId(1); - calculateRule1.setRuleName("瑙嗛骞冲潎鍦ㄧ嚎鐜�"); - calculateRule1.setRuleCondition("鈮�98%"); - calculateRule1.setMax(98D); - calculateRule1.setDeductCategory(RuleDeductCategoryEnum.DEDUCT_POINTS); - calculateRule1.setCalcFraction(0.00); - list.add(calculateRule1); - CalculateRule calculateRule2 = new CalculateRule(); - calculateRule2.setRuleName("瑙嗛骞冲潎鍦ㄧ嚎鐜�"); - calculateRule2.setRuleCondition("95%鈮よ棰戝钩鍧囧湪绾跨巼锛�98%"); - calculateRule2.setMax(97D); - calculateRule2.setMin(95D); - calculateRule2.setDeductCategory(RuleDeductCategoryEnum.DEDUCT_POINTS); - calculateRule2.setCalcFraction(5.00); - list.add(calculateRule2); - CalculateRule calculateRule3 = new CalculateRule(); - calculateRule3.setRuleName("瑙嗛骞冲潎鍦ㄧ嚎鐜�"); - calculateRule3.setRuleCondition("90%鈮よ棰戝钩鍧囧湪绾跨巼锛�95%"); - calculateRule3.setMax(94D); - calculateRule3.setMin(90D); - calculateRule3.setDeductCategory(RuleDeductCategoryEnum.DEDUCT_POINTS); - calculateRule3.setCalcFraction(10.00); - list.add(calculateRule3); - CalculateRule calculateRule33 = new CalculateRule(); - calculateRule33.setRuleName("瑙嗛骞冲潎鍦ㄧ嚎鐜�"); - calculateRule33.setRuleCondition("锛�90%"); - calculateRule33.setMin(89D); - calculateRule33.setDeductCategory(RuleDeductCategoryEnum.DEDUCT_POINTS); - calculateRule33.setCalcFraction(10.00); - list.add(calculateRule33); - CalculateRule calculateRule4 = new CalculateRule(); - calculateRule4.setId(2); - calculateRule4.setRuleName("鍓嶇鎰熺煡婧愭不鐞嗗伐浣�"); - calculateRule4.setRuleCondition("鏃堕挓鍚屾锛堣秴杩嚶�3绉掍负涓嶅悎鏍硷級"); - calculateRule4.setDeductCategory(RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY); - calculateRule4.setCalcFraction(0.1); - list.add(calculateRule4); - CalculateRule calculateRule7 = new CalculateRule(); - calculateRule7.setRuleName("鍓嶇鎰熺煡婧愭不鐞嗗伐浣�"); - calculateRule7.setRuleCondition("OSD鏍囪瘑"); - calculateRule7.setDeductCategory(RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY); - calculateRule7.setCalcFraction(0.1); - list.add(calculateRule7); - CalculateRule calculateRule6 = new CalculateRule(); - calculateRule6.setRuleName("鍓嶇鎰熺煡婧愭不鐞嗗伐浣�"); - calculateRule6.setRuleCondition("涓�鏈轰竴妗�"); - calculateRule6.setDeductCategory(RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY); - calculateRule6.setCalcFraction(0.1); - list.add(calculateRule6); - CalculateRule calculateRule5 = new CalculateRule(); - calculateRule5.setId(3); - calculateRule5.setRuleName("鍚庡彴绯荤粺鐨勪繚闅�"); - calculateRule5.setRuleCondition("鍗曟鏁呴殰鏃堕暱鑻ヨ秴鍑�72灏忔椂涓嶈冻144灏忔椂鐨勶紝姣忚秴鍑�12灏忔椂锛堜笉瓒�12灏忔椂鎸�12灏忔椂璁★級"); - calculateRule5.setMax(144D); - calculateRule5.setMin(72D); - calculateRule5.setDeductCategory(RuleDeductCategoryEnum.MULTIPLY_POINTS_AFTER_DIVIDING_QUANTITY); - calculateRule5.setCalcFraction(2.00); - calculateRule5.setCalcUnit(12); - list.add(calculateRule5); + setTemplateRule(list,1,"璁惧骞冲潎鍦ㄧ嚎鐜�","鈮�98%",null,98D,RuleDeductCategoryEnum.DEDUCT_POINTS,0.00); + setTemplateRule(list,null,"璁惧骞冲潎鍦ㄧ嚎鐜�","95%鈮よ澶囧钩鍧囧湪绾跨巼锛�98%",97D,95D,RuleDeductCategoryEnum.DEDUCT_POINTS,5.00); + setTemplateRule(list,null,"璁惧骞冲潎鍦ㄧ嚎鐜�","90%鈮よ澶囧钩鍧囧湪绾跨巼锛�95%",94D,90D,RuleDeductCategoryEnum.DEDUCT_POINTS,10.00); + setTemplateRule(list,null,"璁惧骞冲潎鍦ㄧ嚎鐜�","锛�90%",89D,null,RuleDeductCategoryEnum.DEDUCT_POINTS,20.00); + + setTemplateRule(list,2,"鍓嶇鎰熺煡婧愭不鐞嗗伐浣�","鏃堕挓鍚屾锛堣秴杩嚶�3绉掍负涓嶅悎鏍硷級",null,null,RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY,0.1); + setTemplateRule(list,null,"鍓嶇鎰熺煡婧愭不鐞嗗伐浣�","OSD鏍囪瘑",null,null,RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY,0.1); + setTemplateRule(list,null,"鍓嶇鎰熺煡婧愭不鐞嗗伐浣�","涓�鏈轰竴妗�",null,null,RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY,0.1); + + setTemplateRule(list,3,"瀛樺偍鏁呴殰","鍥犲瓨鍌ㄨ澶囥�佷簯瀛樺偍杞欢绛夊紩璧峰钩鍙颁笉鑳芥甯告煡鐪嬪巻鍙插浘鍍�,鍗曟鏁呴殰鏃堕暱鍦�24灏忔椂浠ュ唴鐨�",24D,null,RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY,0.5); + setTemplateRule(list,null,"瀛樺偍鏁呴殰","鍥犲瓨鍌ㄨ澶囥�佷簯瀛樺偍杞欢绛夊紩璧峰钩鍙颁笉鑳芥甯告煡鐪嬪巻鍙插浘鍍�,鍗曟鏁呴殰鏃堕暱鑻ヨ秴鍑�24灏忔椂浠ヤ笂銆�",null,24D,RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY,1.0); + setTemplateRule(list,null,"瀛樺偍鏁呴殰","鍥犺棰戞垨鑰呭浘鐗囦涪澶卞鑷撮噸瑕佹浜嬩欢涓嶈兘鍥炴斁鎴栨煡鐪�",null,null,RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY,2.0); + + setTemplateRule(list,4,"瀵逛簬鍓嶇鐐逛綅寮傚父鎯呭喌鐨勫鐞�","闀滃ご鏁呴殰鎴栨薄鏌撴垨鏍戞灊閬尅鎴栨灙鏈鸿瑙掑亸绉绘甯歌搴︽垨琛ュ厜鐏簲浜湭浜�,24灏忔椂鍚庢湭淇鐨�",null,24D,RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY,0.5); + setTemplateRule(list,null,"瀵逛簬鍓嶇鐐逛綅寮傚父鎯呭喌鐨勫鐞�","闀滃ご鏁呴殰鎴栨薄鏌撴垨鏍戞灊閬尅鎴栨灙鏈鸿瑙掑亸绉绘甯歌搴︽垨琛ュ厜鐏簲浜湭浜�,48灏忔椂鍚庢湭淇鐨�",null,48D,RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY,1.0); + + setTemplateRule(list,5,"纭繚褰曞儚瀹屾暣涓嶅畾鏈熷鎵�鏈夌偣浣嶅綍鍍忓畬鏁存�ф娊鏌�","姣忚矾瑙嗛绱涓㈠け10鍒嗛挓浠ュ唴",10D,null,RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY,0.2); + setTemplateRule(list,null,"纭繚褰曞儚瀹屾暣涓嶅畾鏈熷鎵�鏈夌偣浣嶅綍鍍忓畬鏁存�ф娊鏌�","涓㈠け10-60 鍒嗛挓",60D,10D,RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY,0.5); + setTemplateRule(list,null,"纭繚褰曞儚瀹屾暣涓嶅畾鏈熷鎵�鏈夌偣浣嶅綍鍍忓畬鏁存�ф娊鏌�","涓㈠け1 灏忔椂-4 灏忔椂锛堝惈锛�",240D,60D,RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY,1.0); + setTemplateRule(list,null,"纭繚褰曞儚瀹屾暣涓嶅畾鏈熷鎵�鏈夌偣浣嶅綍鍍忓畬鏁存�ф娊鏌�","涓㈠け4 灏忔椂-12 灏忔椂锛堝惈锛�",720D,240D,RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY,1.5); + setTemplateRule(list,null,"纭繚褰曞儚瀹屾暣涓嶅畾鏈熷鎵�鏈夌偣浣嶅綍鍍忓畬鏁存�ф娊鏌�","涓㈠け12 灏忔椂浠ヤ笂",null,720D,RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY,2.0); + + setTemplateRule(list,6,"纭繚鍥剧墖瀹屾暣涓嶅畾鏈熷鎵�鏈変汉鑴歌溅杈嗕互鍙婃櫤鑳藉墠绔姄鎷嶇殑鍥剧墖瀹屾暣鎬ф娊鏌�","鍙戠幇鍚庡彴瀛樺偍涓嶈兘璋冨彇鍓嶇璁惧鍥剧墖",null,null,RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY,2.0); + return list; } - + private static void setTemplateRule(ArrayList<CalculateRule> list,Integer id,String ruleName,String condition,Double max,Double min,RuleDeductCategoryEnum deductCategoryEnum,Double calcFraction) { + CalculateRule calculateRule = new CalculateRule(); + calculateRule.setId(id); + calculateRule.setRuleName(ruleName); + calculateRule.setRuleCondition(condition); + calculateRule.setMax(max); + calculateRule.setMin(min); + calculateRule.setDeductCategory(deductCategoryEnum); + calculateRule.setCalcFraction(calcFraction); + list.add(calculateRule); + } @Override @Transactional @SneakyThrows -- Gitblit v1.8.0