java110 3 年 前
コミット
8a5cd53cbc

+ 3 - 1
java110-core/src/main/java/com/java110/core/smo/impl/ComputeFeeSMOImpl.java

@@ -1518,7 +1518,9 @@ public class ComputeFeeSMOImpl implements IComputeFeeSMO {
             //判断当前费用是不是导入费用
             //判断当前费用是不是导入费用
             oweMonth = 1.0;
             oweMonth = 1.0;
         }else if(FeeDto.FEE_FLAG_CYCLE_ONCE.equals(feeDto.getFeeFlag())){
         }else if(FeeDto.FEE_FLAG_CYCLE_ONCE.equals(feeDto.getFeeFlag())){
-            maxEndTime = feeDto.getDeadlineTime();
+            if(feeDto.getDeadlineTime() != null) {
+                maxEndTime = feeDto.getDeadlineTime();
+            }
             Date billEndTime = DateUtil.getCurrentDate();
             Date billEndTime = DateUtil.getCurrentDate();
             //建账时间
             //建账时间
             Date startDate = feeDto.getStartTime();
             Date startDate = feeDto.getStartTime();

+ 52 - 0
service-store/src/main/java/com/java110/store/cmd/store/UserHasStoreCmd.java

@@ -0,0 +1,52 @@
+package com.java110.store.cmd.store;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.Cmd;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.service.context.DataQuery;
+import com.java110.service.smo.IQueryServiceSMO;
+import com.java110.utils.exception.CmdException;
+import com.java110.utils.util.Assert;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+
+/**
+ * 查询用户是否存在 商户信息
+ */
+@Java110Cmd(serviceCode = "store.userHasStore")
+public class UserHasStoreCmd extends Cmd {
+    @Autowired
+    private IQueryServiceSMO queryServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
+
+    }
+
+    @Override
+    public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
+        String userId = event.getCmdDataFlowContext().getReqHeaders().get("user-id");
+
+        DataQuery dataQuery = new DataQuery();
+        dataQuery.setServiceCode("query.store.byuser");
+        JSONObject param = new JSONObject();
+        param.put("userId", userId);
+        dataQuery.setRequestParams(param);
+        queryServiceSMOImpl.commonQueryService(dataQuery);
+        ResponseEntity<String> responseEntity = dataQuery.getResponseEntity();
+        if (responseEntity.getStatusCode() != HttpStatus.OK) {
+            context.setResponseEntity(new ResponseEntity<>("初始化商户", HttpStatus.FORBIDDEN));
+            return;
+        }
+
+        String storeInfo = responseEntity.getBody();
+        if (Assert.isJsonObject(storeInfo) && JSONObject.parseObject(storeInfo).containsKey("storeId")) {
+            context.setResponseEntity(new ResponseEntity<>("有商户信息", HttpStatus.OK));
+            return;
+        }
+        context.setResponseEntity(new ResponseEntity<>("初始化商户", HttpStatus.FORBIDDEN));
+    }
+}

+ 0 - 38
springboot/src/main/java/com/java110/boot/components/company/HasCompanyComponent.java

@@ -1,38 +0,0 @@
-package com.java110.boot.components.company;
-
-
-import com.java110.boot.smo.IFlowServiceSMO;
-import com.java110.core.context.IPageData;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.stereotype.Component;
-
-
-/**
- * 小区组件管理类
- *
- * add by wuxw
- *
- * 2019-06-29
- */
-@Component("hasCompany")
-public class HasCompanyComponent {
-
-    @Autowired
-    private IFlowServiceSMO flowServiceSMOImpl;
-
-    /**
-     * 查询小区列表
-     * @param pd 页面数据封装ApiServiceSMOImpl
-     * @return 返回 ResponseEntity 对象
-     */
-    public ResponseEntity<String> check(IPageData pd){
-        if(flowServiceSMOImpl.hasStoreInfos(pd)){
-            return new ResponseEntity<>("有商户信息", HttpStatus.OK);
-        }
-         return new ResponseEntity<>("初始化商户",HttpStatus.FORBIDDEN);
-    }
-
-
-}