From 05683f2b2bdbdbe21cf17ad523c21ab338bd1c54 Mon Sep 17 00:00:00 2001
From: wuxw <928255095@qq.com>
Date: 星期二, 19 七月 2022 21:49:55 +0800
Subject: [PATCH] 优化添加设备 功能
---
service-api/src/main/java/com/java110/api/bmo/community/impl/CommunityBMOImpl.java | 91 +++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 86 insertions(+), 5 deletions(-)
diff --git a/service-api/src/main/java/com/java110/api/bmo/community/impl/CommunityBMOImpl.java b/service-api/src/main/java/com/java110/api/bmo/community/impl/CommunityBMOImpl.java
old mode 100644
new mode 100755
index 3ff637e..808b96f
--- a/service-api/src/main/java/com/java110/api/bmo/community/impl/CommunityBMOImpl.java
+++ b/service-api/src/main/java/com/java110/api/bmo/community/impl/CommunityBMOImpl.java
@@ -11,6 +11,7 @@
import com.java110.dto.workflow.WorkflowDto;
import com.java110.intf.common.IWorkflowInnerServiceSMO;
import com.java110.intf.community.ICommunityInnerServiceSMO;
+import com.java110.po.community.CommunityAttrPo;
import com.java110.po.community.CommunityMemberPo;
import com.java110.po.community.CommunityPo;
import com.java110.po.fee.PayFeeConfigPo;
@@ -25,6 +26,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
+import java.util.Calendar;
import java.util.List;
import java.util.Map;
@@ -39,10 +41,8 @@
@Service("communityBMOImpl")
public class CommunityBMOImpl extends ApiBaseBMO implements ICommunityBMO {
-
@Autowired
private ICommunityInnerServiceSMO communityInnerServiceSMOImpl;
-
@Autowired
private IWorkflowInnerServiceSMO workflowInnerServiceSMOImpl;
@@ -101,6 +101,13 @@
*/
public JSONObject addCommunityMember(JSONObject paramInJson) {
+ //鏌ヨ灏忓尯鏄惁瀛樺湪
+ CommunityDto communityDto = new CommunityDto();
+ communityDto.setCommunityId(paramInJson.getString("communityId"));
+ List<CommunityDto> communityDtos = communityInnerServiceSMOImpl.queryCommunitys(communityDto);
+
+ Assert.listOnlyOne(communityDtos, "灏忓尯涓嶅瓨鍦�");
+
JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_MEMBER_JOINED_COMMUNITY);
business.put(CommonConstant.HTTP_SEQ, 2);
@@ -110,6 +117,10 @@
businessCommunityMember.put("communityId", paramInJson.getString("communityId"));
businessCommunityMember.put("memberId", paramInJson.getString("memberId"));
businessCommunityMember.put("memberTypeCd", paramInJson.getString("memberTypeCd"));
+ businessCommunityMember.put("startTime", DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A));
+ Calendar endTime = Calendar.getInstance();
+ endTime.add(Calendar.MONTH, Integer.parseInt(communityDtos.get(0).getPayFeeMonth()));
+ businessCommunityMember.put("endTime", DateUtil.getFormatTimeString(endTime.getTime(), DateUtil.DATE_FORMATE_STRING_A));
String auditStatusCd = MappingCache.getValue(MappingConstant.DOMAIN_COMMUNITY_MEMBER_AUDIT, paramInJson.getString("memberTypeCd"));
auditStatusCd = StringUtils.isEmpty(auditStatusCd) ? StateConstant.AGREE_AUDIT : auditStatusCd;
businessCommunityMember.put("auditStatusCd", auditStatusCd);
@@ -124,15 +135,55 @@
* @param paramInJson 鎺ュ彛璇锋眰鏁版嵁灏佽
* @return 灏佽濂界殑 data鏁版嵁
*/
- public JSONObject updateComplaint(JSONObject paramInJson) {
+ public JSONObject updateWorkflow(JSONObject paramInJson,String flowType) {
WorkflowDto workflowDto = new WorkflowDto();
workflowDto.setCommunityId(paramInJson.getString("communityId"));
- workflowDto.setFlowType(WorkflowDto.FLOW_TYPE_COMPLAINT);
+ workflowDto.setFlowType(flowType);
List<WorkflowDto> workflowDtos = workflowInnerServiceSMOImpl.queryWorkflows(workflowDto);
if (workflowDtos == null || workflowDtos.size() < 1) {
return null;
}
+ return getBusiness(paramInJson, workflowDtos);
+ }
+
+ /**
+ * 淇敼鐗╁搧棰嗙敤
+ *
+ * @param paramInJson
+ * @return
+ */
+ public JSONObject updateComplaint2(JSONObject paramInJson) {
+ WorkflowDto workflowDto = new WorkflowDto();
+ workflowDto.setCommunityId(paramInJson.getString("communityId"));
+ workflowDto.setFlowType(WorkflowDto.FLOW_TYPE_COLLECTION);
+ List<WorkflowDto> workflowDtos = workflowInnerServiceSMOImpl.queryWorkflows(workflowDto);
+
+ if (workflowDtos == null || workflowDtos.size() < 1) {
+ return null;
+ }
+ return getBusiness(paramInJson, workflowDtos);
+ }
+
+ /**
+ * 淇敼鐗╁搧琚皟鎷�
+ *
+ * @param paramInJson
+ * @return
+ */
+ public JSONObject updateComplaint3(JSONObject paramInJson) {
+ WorkflowDto workflowDto = new WorkflowDto();
+ workflowDto.setCommunityId(paramInJson.getString("communityId"));
+ workflowDto.setFlowType(WorkflowDto.FLOW_TYPE_ALLOCATION_STOREHOUSE_GO);
+ List<WorkflowDto> workflowDtos = workflowInnerServiceSMOImpl.queryWorkflows(workflowDto);
+
+ if (workflowDtos == null || workflowDtos.size() < 1) {
+ return null;
+ }
+ return getBusiness(paramInJson, workflowDtos);
+ }
+
+ public JSONObject getBusiness(JSONObject paramInJson, List<WorkflowDto> workflowDtos) {
JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_WORKFLOW);
business.put(CommonConstant.HTTP_SEQ, 2);
@@ -146,6 +197,7 @@
business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put(WorkflowPo.class.getSimpleName(), data);
return business;
}
+
/**
* 娣诲姞灏忓尯鎴愬憳
@@ -477,6 +529,7 @@
*/
public void addCommunityMembers(JSONObject paramInJson, DataFlowContext dataFlowContext) {
+
JSONObject businessCommunityMember = new JSONObject();
businessCommunityMember.put("communityMemberId", "-1");
businessCommunityMember.put("communityId", paramInJson.getString("communityId"));
@@ -532,11 +585,39 @@
* @param dataFlowContext 鏁版嵁涓婁笅鏂�
* @return 璁㈠崟鏈嶅姟鑳藉鎺ュ彈鐨勬姤鏂�
*/
+ public void addAttr(JSONObject paramInJson, DataFlowContext dataFlowContext) {
+
+ paramInJson.put("attrId", GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_attrId));
+ CommunityAttrPo communityAttrPo = BeanConvertUtil.covertBean(paramInJson, CommunityAttrPo.class);
+ super.insert(dataFlowContext, communityAttrPo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_COMMUNITY_INFO);
+
+ }
+
+ /**
+ * 娣诲姞灏忓尯淇℃伅
+ *
+ * @param paramInJson 鎺ュ彛璋冪敤鏀句紶鍏ュ叆鍙�
+ * @param dataFlowContext 鏁版嵁涓婁笅鏂�
+ * @return 璁㈠崟鏈嶅姟鑳藉鎺ュ彈鐨勬姤鏂�
+ */
+ public void updateAttr(JSONObject paramInJson, DataFlowContext dataFlowContext) {
+
+ CommunityAttrPo communityAttrPo = BeanConvertUtil.covertBean(paramInJson, CommunityAttrPo.class);
+ super.insert(dataFlowContext, communityAttrPo, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_COMMUNITY_INFO);
+
+ }
+
+ /**
+ * 娣诲姞灏忓尯淇℃伅
+ *
+ * @param paramInJson 鎺ュ彛璋冪敤鏀句紶鍏ュ叆鍙�
+ * @param dataFlowContext 鏁版嵁涓婁笅鏂�
+ * @return 璁㈠崟鏈嶅姟鑳藉鎺ュ彈鐨勬姤鏂�
+ */
public void updateCommunityOne(JSONObject paramInJson, DataFlowContext dataFlowContext) {
CommunityPo communityPo = BeanConvertUtil.covertBean(paramInJson, CommunityPo.class);
super.update(dataFlowContext, communityPo, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_COMMUNITY_INFO);
-
}
}
--
Gitblit v1.8.0