Browse Source

采购申请

mrzcc 6 years ago
parent
commit
0fa737b3a1

+ 19 - 0
WebService/src/main/java/com/java110/web/smo/purchaseApply/IAddPurchaseApplySMO.java

@@ -0,0 +1,19 @@
+package com.java110.web.smo.purchaseApply;
+
+import com.java110.core.context.IPageData;
+import org.springframework.http.ResponseEntity;
+
+/**
+ * 添加采购申请接口
+ *
+ * add by wuxw 2019-06-30
+ */
+public interface IAddPurchaseApplySMO {
+
+    /**
+     * 添加采购申请
+     * @param pd 页面数据封装
+     * @return ResponseEntity 对象
+     */
+    ResponseEntity<String> savePurchaseApply(IPageData pd);
+}

+ 19 - 0
WebService/src/main/java/com/java110/web/smo/purchaseApply/IDeletePurchaseApplySMO.java

@@ -0,0 +1,19 @@
+package com.java110.web.smo.purchaseApply;
+
+import com.java110.core.context.IPageData;
+import org.springframework.http.ResponseEntity;
+
+/**
+ * 添加采购申请接口
+ *
+ * add by wuxw 2019-06-30
+ */
+public interface IDeletePurchaseApplySMO {
+
+    /**
+     * 添加采购申请
+     * @param pd 页面数据封装
+     * @return ResponseEntity 对象
+     */
+    ResponseEntity<String> deletePurchaseApply(IPageData pd);
+}

+ 19 - 0
WebService/src/main/java/com/java110/web/smo/purchaseApply/IEditPurchaseApplySMO.java

@@ -0,0 +1,19 @@
+package com.java110.web.smo.purchaseApply;
+
+import com.java110.core.context.IPageData;
+import org.springframework.http.ResponseEntity;
+
+/**
+ * 修改采购申请接口
+ *
+ * add by wuxw 2019-06-30
+ */
+public interface IEditPurchaseApplySMO {
+
+    /**
+     * 修改小区
+     * @param pd 页面数据封装
+     * @return ResponseEntity 对象
+     */
+    ResponseEntity<String> updatePurchaseApply(IPageData pd);
+}

+ 21 - 0
WebService/src/main/java/com/java110/web/smo/purchaseApply/IListPurchaseApplysSMO.java

@@ -0,0 +1,21 @@
+package com.java110.web.smo.purchaseApply;
+
+import com.java110.core.context.IPageData;
+import com.java110.utils.exception.SMOException;
+import org.springframework.http.ResponseEntity;
+
+/**
+ * 采购申请管理服务接口类
+ *
+ * add by wuxw 2019-06-29
+ */
+public interface IListPurchaseApplysSMO {
+
+    /**
+     * 查询采购申请信息
+     * @param pd 页面数据封装
+     * @return ResponseEntity 对象数据
+     * @throws SMOException 业务代码层
+     */
+    ResponseEntity<String> listPurchaseApplys(IPageData pd) throws SMOException;
+}

+ 62 - 0
WebService/src/main/java/com/java110/web/smo/purchaseApply/impl/AddPurchaseApplySMOImpl.java

@@ -0,0 +1,62 @@
+package com.java110.web.smo.purchaseApply.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.component.AbstractComponentSMO;
+import com.java110.core.context.IPageData;
+import com.java110.utils.constant.ServiceConstant;
+import com.java110.utils.util.Assert;
+import com.java110.web.smo.purchaseApply.IAddPurchaseApplySMO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+import org.springframework.web.client.RestTemplate;
+
+/**
+ * 添加小区服务实现类
+ * add by wuxw 2019-06-30
+ */
+@Service("addPurchaseApplySMOImpl")
+public class AddPurchaseApplySMOImpl extends AbstractComponentSMO implements IAddPurchaseApplySMO {
+
+    @Autowired
+    private RestTemplate restTemplate;
+
+    @Override
+    protected void validate(IPageData pd, JSONObject paramIn) {
+
+        //super.validatePageInfo(pd);
+
+        //Assert.hasKeyAndValue(paramIn, "xxx", "xxx");
+        Assert.hasKeyAndValue(paramIn, "state", "必填,请填订单状态");
+
+
+
+        //super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.AGENT_HAS_LIST_PURCHASEAPPLY);
+
+    }
+
+    @Override
+    protected ResponseEntity<String> doBusinessProcess(IPageData pd, JSONObject paramIn) {
+        ResponseEntity<String> responseEntity = null;
+        super.validateStoreStaffCommunityRelationship(pd, restTemplate);
+
+        responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(),
+                ServiceConstant.SERVICE_API_URL + "/api/purchaseApply.savePurchaseApply",
+                HttpMethod.POST);
+        return responseEntity;
+    }
+
+    @Override
+    public ResponseEntity<String> savePurchaseApply(IPageData pd) {
+        return super.businessProcess(pd);
+    }
+
+    public RestTemplate getRestTemplate() {
+        return restTemplate;
+    }
+
+    public void setRestTemplate(RestTemplate restTemplate) {
+        this.restTemplate = restTemplate;
+    }
+}

+ 62 - 0
WebService/src/main/java/com/java110/web/smo/purchaseApply/impl/DeletePurchaseApplySMOImpl.java

@@ -0,0 +1,62 @@
+package com.java110.web.smo.purchaseApply.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.component.AbstractComponentSMO;
+import com.java110.core.context.IPageData;
+import com.java110.utils.constant.ServiceConstant;
+import com.java110.utils.util.Assert;
+import com.java110.web.smo.purchaseApply.IDeletePurchaseApplySMO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+import org.springframework.web.client.RestTemplate;
+
+/**
+ * 添加小区服务实现类
+ * delete by wuxw 2019-06-30
+ */
+@Service("deletePurchaseApplySMOImpl")
+public class DeletePurchaseApplySMOImpl extends AbstractComponentSMO implements IDeletePurchaseApplySMO {
+
+    @Autowired
+    private RestTemplate restTemplate;
+
+    @Override
+    protected void validate(IPageData pd, JSONObject paramIn) {
+
+        //super.validatePageInfo(pd);
+
+        //Assert.hasKeyAndValue(paramIn, "xxx", "xxx");
+        Assert.hasKeyAndValue(paramIn, "applyOrderId", "订单号不能为空");
+
+
+
+        //super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.AGENT_HAS_LIST_PURCHASEAPPLY);
+
+    }
+
+    @Override
+    protected ResponseEntity<String> doBusinessProcess(IPageData pd, JSONObject paramIn) {
+        ResponseEntity<String> responseEntity = null;
+        super.validateStoreStaffCommunityRelationship(pd, restTemplate);
+
+        responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(),
+                ServiceConstant.SERVICE_API_URL + "/api/purchaseApply.deletePurchaseApply",
+                HttpMethod.POST);
+        return responseEntity;
+    }
+
+    @Override
+    public ResponseEntity<String> deletePurchaseApply(IPageData pd) {
+        return super.businessProcess(pd);
+    }
+
+    public RestTemplate getRestTemplate() {
+        return restTemplate;
+    }
+
+    public void setRestTemplate(RestTemplate restTemplate) {
+        this.restTemplate = restTemplate;
+    }
+}

+ 61 - 0
WebService/src/main/java/com/java110/web/smo/purchaseApply/impl/EditPurchaseApplySMOImpl.java

@@ -0,0 +1,61 @@
+package com.java110.web.smo.purchaseApply.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.component.AbstractComponentSMO;
+import com.java110.core.context.IPageData;
+import com.java110.utils.constant.ServiceConstant;
+import com.java110.utils.util.Assert;
+import com.java110.web.smo.purchaseApply.IEditPurchaseApplySMO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+import org.springframework.web.client.RestTemplate;
+
+/**
+ * 添加采购申请服务实现类
+ * add by wuxw 2019-06-30
+ */
+@Service("eidtPurchaseApplySMOImpl")
+public class EditPurchaseApplySMOImpl extends AbstractComponentSMO implements IEditPurchaseApplySMO {
+
+    @Autowired
+    private RestTemplate restTemplate;
+
+    @Override
+    protected void validate(IPageData pd, JSONObject paramIn) {
+
+        //super.validatePageInfo(pd);
+
+        Assert.hasKeyAndValue(paramIn, "applyOrderId", "订单号不能为空");
+        Assert.hasKeyAndValue(paramIn, "state", "必填,请填订单状态");
+
+
+        //super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.AGENT_HAS_LIST__PURCHASEAPPLY);
+
+    }
+
+    @Override
+    protected ResponseEntity<String> doBusinessProcess(IPageData pd, JSONObject paramIn) {
+        ResponseEntity<String> responseEntity = null;
+        super.validateStoreStaffCommunityRelationship(pd, restTemplate);
+
+        responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(),
+                ServiceConstant.SERVICE_API_URL + "/api/purchaseApply.updatePurchaseApply",
+                HttpMethod.POST);
+        return responseEntity;
+    }
+
+    @Override
+    public ResponseEntity<String> updatePurchaseApply(IPageData pd) {
+        return super.businessProcess(pd);
+    }
+
+    public RestTemplate getRestTemplate() {
+        return restTemplate;
+    }
+
+    public void setRestTemplate(RestTemplate restTemplate) {
+        this.restTemplate = restTemplate;
+    }
+}

+ 65 - 0
WebService/src/main/java/com/java110/web/smo/purchaseApply/impl/ListPurchaseApplysSMOImpl.java

@@ -0,0 +1,65 @@
+package com.java110.web.smo.purchaseApply.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.component.AbstractComponentSMO;
+import com.java110.core.context.IPageData;
+import com.java110.entity.component.ComponentValidateResult;
+import com.java110.utils.constant.ServiceConstant;
+import com.java110.utils.exception.SMOException;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.web.smo.purchaseApply.IListPurchaseApplysSMO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+import org.springframework.web.client.RestTemplate;
+
+import java.util.Map;
+
+/**
+ * 查询purchaseApply服务类
+ */
+@Service("listPurchaseApplysSMOImpl")
+public class ListPurchaseApplysSMOImpl extends AbstractComponentSMO implements IListPurchaseApplysSMO {
+
+    @Autowired
+    private RestTemplate restTemplate;
+
+    @Override
+    public ResponseEntity<String> listPurchaseApplys(IPageData pd) throws SMOException {
+        return businessProcess(pd);
+    }
+
+    @Override
+    protected void validate(IPageData pd, JSONObject paramIn) {
+
+        super.validatePageInfo(pd);
+
+        //super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.AGENT_HAS_LIST_PURCHASEAPPLY);
+    }
+
+    @Override
+    protected ResponseEntity<String> doBusinessProcess(IPageData pd, JSONObject paramIn) {
+        ComponentValidateResult result = super.validateStoreStaffCommunityRelationship(pd, restTemplate);
+
+        Map paramMap = BeanConvertUtil.beanCovertMap(result);
+        paramIn.putAll(paramMap);
+
+        String apiUrl = ServiceConstant.SERVICE_API_URL + "/api/purchaseApply.listPurchaseApplys" + mapToUrlParam(paramIn);
+
+
+        ResponseEntity<String> responseEntity = this.callCenterService(restTemplate, pd, "",
+                apiUrl,
+                HttpMethod.GET);
+
+        return responseEntity;
+    }
+
+    public RestTemplate getRestTemplate() {
+        return restTemplate;
+    }
+
+    public void setRestTemplate(RestTemplate restTemplate) {
+        this.restTemplate = restTemplate;
+    }
+}