Parcourir la source

优化 催缴单申请功能

java110 il y a 4 ans
Parent
commit
92c52f8a70

+ 43 - 22
java110-bean/src/main/java/com/java110/dto/feeCollectionOrder/FeeCollectionOrderDto.java

@@ -1,6 +1,7 @@
 package com.java110.dto.feeCollectionOrder;
 
 import com.java110.dto.PageDto;
+
 import java.io.Serializable;
 import java.util.Date;
 
@@ -14,14 +15,19 @@ import java.util.Date;
  **/
 public class FeeCollectionOrderDto extends PageDto implements Serializable {
 
+    //状态 W 等待催缴 ,D 催缴中  F 催缴完成
+    public static final String STATE_WAIT = "W";
+    public static final String STATE_DOING = "D";
+    public static final String STATE_FINISH = "F";
+
     private String orderId;
-private String staffName;
-private String state;
-private String communityId;
-private String collectionWay;
-private String staffId;
-private String remarks;
-private String collectionName;
+    private String staffName;
+    private String state;
+    private String communityId;
+    private String collectionWay;
+    private String staffId;
+    private String remarks;
+    private String collectionName;
 
 
     private Date createTime;
@@ -32,49 +38,64 @@ private String collectionName;
     public String getOrderId() {
         return orderId;
     }
-public void setOrderId(String orderId) {
+
+    public void setOrderId(String orderId) {
         this.orderId = orderId;
     }
-public String getStaffName() {
+
+    public String getStaffName() {
         return staffName;
     }
-public void setStaffName(String staffName) {
+
+    public void setStaffName(String staffName) {
         this.staffName = staffName;
     }
-public String getState() {
+
+    public String getState() {
         return state;
     }
-public void setState(String state) {
+
+    public void setState(String state) {
         this.state = state;
     }
-public String getCommunityId() {
+
+    public String getCommunityId() {
         return communityId;
     }
-public void setCommunityId(String communityId) {
+
+    public void setCommunityId(String communityId) {
         this.communityId = communityId;
     }
-public String getCollectionWay() {
+
+    public String getCollectionWay() {
         return collectionWay;
     }
-public void setCollectionWay(String collectionWay) {
+
+    public void setCollectionWay(String collectionWay) {
         this.collectionWay = collectionWay;
     }
-public String getStaffId() {
+
+    public String getStaffId() {
         return staffId;
     }
-public void setStaffId(String staffId) {
+
+    public void setStaffId(String staffId) {
         this.staffId = staffId;
     }
-public String getRemarks() {
+
+    public String getRemarks() {
         return remarks;
     }
-public void setRemarks(String remarks) {
+
+    public void setRemarks(String remarks) {
         this.remarks = remarks;
     }
-public String getCollectionName() {
+
+    public String getCollectionName() {
         return collectionName;
     }
-public void setCollectionName(String collectionName) {
+
+    public void setCollectionName(String collectionName) {
         this.collectionName = collectionName;
     }
 

+ 33 - 87
java110-generator/src/main/resources/web/template_1.json

@@ -1,120 +1,66 @@
 {
-  "templateName":"短信配置",
-  "templateCode":"smsConfig",
-  "templateKey":"smsId",
-  "templateKeyName":"短信编号",
-  "searchCode": "smsId",
-  "searchName": "短信编号",
+  "templateName":"催缴记录",
+  "templateCode":"feeCollectionOrder",
+  "templateKey":"orderId",
+  "templateKeyName":"记录编号",
+  "searchCode": "orderId",
+  "searchName": "记录编号",
   "directories": "property",
   "conditions": [
     {
-      "name": "活动标题",
+      "name": "名称",
       "inputType": "input",
-      "code": "title",
+      "code": "collectionName",
+      "whereCondition": "equal"
+    },{
+      "name": "催缴人",
+      "inputType": "input",
+      "code": "staffName",
+      "whereCondition": "equal"
+    },{
+      "name": "催缴方式",
+      "inputType": "input",
+      "code": "collectionWay",
       "whereCondition": "equal"
     }
   ],
   "columns":[
     {
-      "code":"smsType",
-      "cnCode":"短信商",
-      "desc":"必填,请填写短信商",
-      "required":true,
-      "hasDefaultValue":false,
-      "inputType": "select",
-      "selectValue":"ALI,TECENT",
-      "selectValueName":"阿里,腾讯",
-      "limit":"maxin",
-      "limitParam":"1,20",
-      "limitErrInfo":"短信商超长了",
-      "show": true
-    },
-    {
-      "code": "smsBusi",
-      "cnCode":"短信业务",
-      "desc":"必填,请填写短信业务",
-      "required":true,
-      "hasDefaultValue":false,
-      "inputType": "select",
-      "selectValue":"1001,2002",
-      "selectValueName":"欠费催缴,工单通知",
-      "limit":"num",
-      "limitParam":"",
-      "limitErrInfo":"短信业务格式有误",
-      "show": true
-    },
-    {
-      "code": "templateCode",
-      "cnCode":"短信模板",
-      "desc":"必填,请填写短信模板",
+      "code":"collectionName",
+      "cnCode":"催缴名称",
+      "desc":"必填,请填写催缴名称",
       "required":true,
       "hasDefaultValue":false,
       "inputType": "input",
       "limit":"maxLength",
       "limitParam":"64",
-      "limitErrInfo":"短信模板超过64位",
-      "show": true
-    },
-    {
-      "code": "signName",
-      "cnCode":"短信签名",
-      "desc":"必填,请填写短信签名",
-      "required":true,
-      "hasDefaultValue":false,
-      "inputType": "input",
-      "limit":"maxLength",
-      "limitParam":"128",
-      "limitErrInfo":"短信签名超过128位",
+      "limitErrInfo":"催缴名称超过64位",
       "show": true
     },
     {
-      "code": "accessSecret",
-      "cnCode":"短信秘钥",
-      "desc":"必填,请填写短信秘钥",
-      "required":true,
-      "hasDefaultValue":false,
-      "inputType": "input",
-      "limit":"maxLength",
-      "limitParam":"128",
-      "limitErrInfo":"短信秘钥超过128位",
-      "show": true
-    },
-    {
-      "code": "accessKeyId",
-      "cnCode":"访问KEY",
-      "desc":"必填,请填写访问KEY",
-      "required":true,
-      "hasDefaultValue":false,
-      "inputType": "input",
-      "limit":"maxLength",
-      "limitParam":"128",
-      "limitErrInfo":"访问KEY超过128位",
-      "show": true
-    },
-    {
-      "code": "region",
-      "cnCode":"区域",
-      "desc":"必填,请填写区域",
+      "code": "staffName",
+      "cnCode":"催缴人",
+      "desc":"必填,请填写催缴人",
       "required":true,
       "hasDefaultValue":false,
       "inputType": "input",
       "limit":"maxLength",
       "limitParam":"64",
-      "limitErrInfo":"区域超过64位",
+      "limitErrInfo":"催缴人不能为空",
       "show": true
     },
     {
-      "code": "logSwitch",
-      "cnCode":"日志",
-      "desc":"必填,请填写日志",
+      "code": "collectionWay",
+      "cnCode":"催缴方式",
+      "desc":"必填,请填写催缴方式",
       "required":true,
       "hasDefaultValue":false,
       "inputType": "select",
-      "selectValue":"ON,OFF",
-      "selectValueName":"记录,不记录",
+      "selectValue":"001,002,003",
+      "selectValueName":"仅短信方式,短信微信方式,仅微信方式",
       "limit":"maxLength",
-      "limitParam":"20",
-      "limitErrInfo":"日志格式有误",
+      "limitParam":"64",
+      "limitErrInfo":"催缴方式超过64位",
       "show": true
     },
     {

+ 4 - 3
service-fee/src/main/java/com/java110/fee/api/FeeCollectionOrderApi.java

@@ -14,7 +14,6 @@ import org.springframework.http.ResponseEntity;
 import org.springframework.web.bind.annotation.*;
 
 
-
 @RestController
 @RequestMapping(value = "/feeCollectionOrder")
 public class FeeCollectionOrderApi {
@@ -38,11 +37,13 @@ public class FeeCollectionOrderApi {
      * @path /app/feeCollectionOrder/saveFeeCollectionOrder
      */
     @RequestMapping(value = "/saveFeeCollectionOrder", method = RequestMethod.POST)
-    public ResponseEntity<String> saveFeeCollectionOrder(@RequestBody JSONObject reqJson) {
+    public ResponseEntity<String> saveFeeCollectionOrder(
+            @RequestHeader(value = "user-id") String userId,
+            @RequestBody JSONObject reqJson) {
 
         Assert.hasKeyAndValue(reqJson, "communityId", "请求报文中未包含communityId");
         Assert.hasKeyAndValue(reqJson, "collectionWay", "请求报文中未包含collectionWay");
-
+        reqJson.put("staffId", userId);
 
         FeeCollectionOrderPo feeCollectionOrderPo = BeanConvertUtil.covertBean(reqJson, FeeCollectionOrderPo.class);
         return saveFeeCollectionOrderBMOImpl.save(feeCollectionOrderPo);

+ 20 - 0
service-fee/src/main/java/com/java110/fee/bmo/feeCollectionOrder/impl/SaveFeeCollectionOrderBMOImpl.java

@@ -2,20 +2,30 @@ package com.java110.fee.bmo.feeCollectionOrder.impl;
 
 import com.java110.core.annotation.Java110Transactional;
 import com.java110.core.factory.GenerateCodeFactory;
+import com.java110.dto.feeCollectionOrder.FeeCollectionOrderDto;
+import com.java110.dto.user.UserDto;
 import com.java110.fee.bmo.feeCollectionOrder.ISaveFeeCollectionOrderBMO;
 import com.java110.intf.fee.IFeeCollectionOrderInnerServiceSMO;
+import com.java110.intf.user.IUserInnerServiceSMO;
 import com.java110.po.feeCollectionOrder.FeeCollectionOrderPo;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.DateUtil;
 import com.java110.vo.ResultVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 @Service("saveFeeCollectionOrderBMOImpl")
 public class SaveFeeCollectionOrderBMOImpl implements ISaveFeeCollectionOrderBMO {
 
     @Autowired
     private IFeeCollectionOrderInnerServiceSMO feeCollectionOrderInnerServiceSMOImpl;
 
+    @Autowired
+    private IUserInnerServiceSMO userInnerServiceSMOImpl;
+
     /**
      * 添加小区信息
      *
@@ -25,7 +35,17 @@ public class SaveFeeCollectionOrderBMOImpl implements ISaveFeeCollectionOrderBMO
     @Java110Transactional
     public ResponseEntity<String> save(FeeCollectionOrderPo feeCollectionOrderPo) {
 
+        //查询用户ID
+        UserDto userDto = new UserDto();
+        userDto.setUserId(feeCollectionOrderPo.getStaffId());
+        List<UserDto> userDtos = userInnerServiceSMOImpl.getUsers(userDto);
+
+        Assert.listOnlyOne(userDtos, "员工不存在");
+
         feeCollectionOrderPo.setOrderId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_orderId));
+        feeCollectionOrderPo.setCollectionName(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_B) + "催缴单");
+        feeCollectionOrderPo.setState(FeeCollectionOrderDto.STATE_WAIT);
+        feeCollectionOrderPo.setStaffName(userDtos.get(0).getStaffName());
         int flag = feeCollectionOrderInnerServiceSMOImpl.saveFeeCollectionOrder(feeCollectionOrderPo);
 
         if (flag > 0) {