wuxw
2020-02-26 e60f89f66d9a1354c1776dec2bc085c51f62b923
Merge branch 'master' of https://github.com/java110/MicroCommunity
49个文件已添加
10个文件已修改
3798 ■■■■■ 已修改文件
Api/src/main/java/com/java110/api/listener/purchaseApply/DeletePurchaseApplyListener.java 91 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Api/src/main/java/com/java110/api/listener/purchaseApply/ListPurchaseApplysListener.java 88 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Api/src/main/java/com/java110/api/listener/purchaseApply/SavePurchaseApplyListener.java 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Api/src/main/java/com/java110/api/listener/purchaseApply/UpdatePurchaseApplyListener.java 91 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Api/src/main/java/com/java110/api/listener/user/QueryStaffServiceListener.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
StoreService/src/main/java/com/java110/store/dao/IPurchaseApplyServiceDao.java 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
StoreService/src/main/java/com/java110/store/dao/impl/PurchaseApplyServiceDaoImpl.java 129 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
StoreService/src/main/java/com/java110/store/listener/purchaseApply/AbstractPurchaseApplyBusinessServiceDataFlowListener.java 89 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
StoreService/src/main/java/com/java110/store/listener/purchaseApply/DeletePurchaseApplyInfoListener.java 177 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
StoreService/src/main/java/com/java110/store/listener/purchaseApply/SavePurchaseApplyInfoListener.java 175 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
StoreService/src/main/java/com/java110/store/listener/purchaseApply/UpdatePurchaseApplyInfoListener.java 190 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
StoreService/src/main/java/com/java110/store/smo/impl/PurchaseApplyInnerServiceSMOImpl.java 111 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/java/com/java110/web/components/purchaseApply/AddPurchaseApplyComponent.java 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/java/com/java110/web/components/purchaseApply/ChoosePurchaseApplyComponent.java 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/java/com/java110/web/components/purchaseApply/DeletePurchaseApplyComponent.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/java/com/java110/web/components/purchaseApply/EditPurchaseApplyComponent.java 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/java/com/java110/web/components/purchaseApply/PurchaseApplyManageComponent.java 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/java/com/java110/web/smo/purchaseApply/IAddPurchaseApplySMO.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/java/com/java110/web/smo/purchaseApply/IDeletePurchaseApplySMO.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/java/com/java110/web/smo/purchaseApply/IEditPurchaseApplySMO.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/java/com/java110/web/smo/purchaseApply/IListPurchaseApplysSMO.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/java/com/java110/web/smo/purchaseApply/impl/AddPurchaseApplySMOImpl.java 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/java/com/java110/web/smo/purchaseApply/impl/DeletePurchaseApplySMOImpl.java 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/java/com/java110/web/smo/purchaseApply/impl/EditPurchaseApplySMOImpl.java 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/java/com/java110/web/smo/purchaseApply/impl/ListPurchaseApplysSMOImpl.java 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/complaintPackage/addComplaintStep/addComplaintStep.html 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/ownerPackage/addOwnerRoomBinding/addOwnerRoomBinding.html 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/purchaseApplyPackage/add-purchaseApply/addPurchaseApply.html 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/purchaseApplyPackage/add-purchaseApply/addPurchaseApply.js 130 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/purchaseApplyPackage/choose-purchaseApply/choosePurchaseApply.html 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/purchaseApplyPackage/choose-purchaseApply/choosePurchaseApply.js 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/purchaseApplyPackage/delete-purchaseApply/deletePurchaseApply.html 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/purchaseApplyPackage/delete-purchaseApply/deletePurchaseApply.js 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/purchaseApplyPackage/edit-purchaseApply/editPurchaseApply.html 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/purchaseApplyPackage/edit-purchaseApply/editPurchaseApply.js 87 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/purchaseApplyPackage/purchaseApply-manage/purchaseApplyManage.html 113 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/purchaseApplyPackage/purchaseApply-manage/purchaseApplyManage.js 85 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/purchaseApplyPackage/view-purchaseApply-info/viewPurchaseApplyInfo.html 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/purchaseApplyPackage/view-purchaseApply-info/viewPurchaseApplyInfo.js 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/roomPackage/sell-room-select-room/sellRoomSelectRoom.html 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/roomPackage/sell-room/sellRoom.html 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/views/purchaseApplyFlow.html 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/document/services/purchaseApply/DeletePurchaseApplyInfo.md 114 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/document/services/purchaseApply/SavePurchaseApplyInfo.md 128 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/document/services/purchaseApply/UpdatePurchaseApplyInfo.md 128 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/dto/purchaseApply/PurchaseApplyDto.java 113 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/vo/api/purchaseApply/ApiPurchaseApplyDataVo.java 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/vo/api/purchaseApply/ApiPurchaseApplyVo.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/vo/api/staff/ApiStaffDataVo.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-code-generator/src/main/java/com/java110/PurchaseApplyGeneratorApplication.java 84 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-core/src/main/java/com/java110/core/factory/GenerateCodeFactory.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-core/src/main/java/com/java110/core/smo/purchaseApply/IPurchaseApplyInnerServiceSMO.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/db/StoreService/create_purchase_apply.sql 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/store/PurchaseApplyServiceDaoImplMapper.xml 217 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-utils/pom.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-utils/src/main/java/com/java110/utils/constant/BusinessTypeConstant.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-utils/src/main/java/com/java110/utils/constant/ServiceCodePurchaseApplyConstant.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-utils/src/main/java/com/java110/utils/util/PinYinUtil.java 95 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pom.xml 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Api/src/main/java/com/java110/api/listener/purchaseApply/DeletePurchaseApplyListener.java
New file
@@ -0,0 +1,91 @@
package com.java110.api.listener.purchaseApply;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.java110.api.listener.AbstractServiceApiListener;
import com.java110.core.annotation.Java110Listener;
import com.java110.core.context.DataFlowContext;
import com.java110.entity.center.AppService;
import com.java110.event.service.api.ServiceDataFlowEvent;
import com.java110.utils.constant.BusinessTypeConstant;
import com.java110.utils.constant.CommonConstant;
import com.java110.utils.constant.ServiceCodePurchaseApplyConstant;
import com.java110.utils.util.Assert;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
/**
 * 保存小区侦听
 * add by wuxw 2019-06-30
 */
@Java110Listener("deletePurchaseApplyListener")
public class DeletePurchaseApplyListener extends AbstractServiceApiListener {
    @Override
    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
        //Assert.hasKeyAndValue(reqJson, "xxx", "xxx");
        Assert.hasKeyAndValue(reqJson, "applyOrderId", "订单号不能为空");
    }
    @Override
    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
        HttpHeaders header = new HttpHeaders();
        context.getRequestCurrentHeaders().put(CommonConstant.HTTP_ORDER_TYPE_CD, "D");
        JSONArray businesses = new JSONArray();
        AppService service = event.getAppService();
        //添加单元信息
        businesses.add(deletePurchaseApply(reqJson, context));
        JSONObject paramInObj = super.restToCenterProtocol(businesses, context.getRequestCurrentHeaders());
        //将 rest header 信息传递到下层服务中去
        super.freshHttpHeader(header, context.getRequestCurrentHeaders());
        ResponseEntity<String> responseEntity = this.callService(context, service.getServiceCode(), paramInObj);
        context.setResponseEntity(responseEntity);
    }
    @Override
    public String getServiceCode() {
        return ServiceCodePurchaseApplyConstant.DELETE_PURCHASE_APPLY;
    }
    @Override
    public HttpMethod getHttpMethod() {
        return HttpMethod.POST;
    }
    @Override
    public int getOrder() {
        return DEFAULT_ORDER;
    }
    /**
     * 添加小区信息
     *
     * @param paramInJson     接口调用放传入入参
     * @param dataFlowContext 数据上下文
     * @return 订单服务能够接受的报文
     */
    private JSONObject deletePurchaseApply(JSONObject paramInJson, DataFlowContext dataFlowContext) {
        JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
        business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_DELETE_PURCHASE_APPLY);
        business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ);
        business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S);
        JSONObject businessPurchaseApply = new JSONObject();
        businessPurchaseApply.putAll(paramInJson);
        //计算 应收金额
        business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessPurchaseApply", businessPurchaseApply);
        return business;
    }
}
Api/src/main/java/com/java110/api/listener/purchaseApply/ListPurchaseApplysListener.java
New file
@@ -0,0 +1,88 @@
package com.java110.api.listener.purchaseApply;
import com.alibaba.fastjson.JSONObject;
import com.java110.api.listener.AbstractServiceApiListener;
import com.java110.core.annotation.Java110Listener;
import com.java110.core.context.DataFlowContext;
import com.java110.core.smo.purchaseApply.IPurchaseApplyInnerServiceSMO;
import com.java110.dto.purchaseApply.PurchaseApplyDto;
import com.java110.event.service.api.ServiceDataFlowEvent;
import com.java110.utils.constant.ServiceCodePurchaseApplyConstant;
import com.java110.utils.util.BeanConvertUtil;
import com.java110.vo.api.purchaseApply.ApiPurchaseApplyDataVo;
import com.java110.vo.api.purchaseApply.ApiPurchaseApplyVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import java.util.ArrayList;
import java.util.List;
/**
 * 查询小区侦听类
 */
@Java110Listener("listPurchaseApplysListener")
public class ListPurchaseApplysListener extends AbstractServiceApiListener {
    @Autowired
    private IPurchaseApplyInnerServiceSMO purchaseApplyInnerServiceSMOImpl;
    @Override
    public String getServiceCode() {
        return ServiceCodePurchaseApplyConstant.LIST_PURCHASE_APPLY;
    }
    @Override
    public HttpMethod getHttpMethod() {
        return HttpMethod.GET;
    }
    @Override
    public int getOrder() {
        return DEFAULT_ORDER;
    }
    public IPurchaseApplyInnerServiceSMO getPurchaseApplyInnerServiceSMOImpl() {
        return purchaseApplyInnerServiceSMOImpl;
    }
    public void setPurchaseApplyInnerServiceSMOImpl(IPurchaseApplyInnerServiceSMO purchaseApplyInnerServiceSMOImpl) {
        this.purchaseApplyInnerServiceSMOImpl = purchaseApplyInnerServiceSMOImpl;
    }
    @Override
    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
        super.validatePageInfo(reqJson);
    }
    @Override
    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
        PurchaseApplyDto purchaseApplyDto = BeanConvertUtil.covertBean(reqJson, PurchaseApplyDto.class);
        int count = purchaseApplyInnerServiceSMOImpl.queryPurchaseApplysCount(purchaseApplyDto);
        List<ApiPurchaseApplyDataVo> purchaseApplys = null;
        if (count > 0) {
            purchaseApplys = BeanConvertUtil.covertBeanList(purchaseApplyInnerServiceSMOImpl.queryPurchaseApplys(purchaseApplyDto), ApiPurchaseApplyDataVo.class);
        } else {
            purchaseApplys = new ArrayList<>();
        }
        ApiPurchaseApplyVo apiPurchaseApplyVo = new ApiPurchaseApplyVo();
        apiPurchaseApplyVo.setTotal(count);
        apiPurchaseApplyVo.setRecords((int) Math.ceil((double) count / (double) reqJson.getInteger("row")));
        apiPurchaseApplyVo.setPurchaseApplys(purchaseApplys);
        ResponseEntity<String> responseEntity = new ResponseEntity<String>(JSONObject.toJSONString(apiPurchaseApplyVo), HttpStatus.OK);
        context.setResponseEntity(responseEntity);
    }
}
Api/src/main/java/com/java110/api/listener/purchaseApply/SavePurchaseApplyListener.java
New file
@@ -0,0 +1,92 @@
package com.java110.api.listener.purchaseApply;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.java110.api.listener.AbstractServiceApiListener;
import com.java110.core.annotation.Java110Listener;
import com.java110.core.context.DataFlowContext;
import com.java110.entity.center.AppService;
import com.java110.event.service.api.ServiceDataFlowEvent;
import com.java110.utils.constant.BusinessTypeConstant;
import com.java110.utils.constant.CommonConstant;
import com.java110.utils.constant.ServiceCodePurchaseApplyConstant;
import com.java110.utils.util.Assert;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
/**
 * 保存小区侦听
 * add by wuxw 2019-06-30
 */
@Java110Listener("savePurchaseApplyListener")
public class SavePurchaseApplyListener extends AbstractServiceApiListener {
    @Override
    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
        //Assert.hasKeyAndValue(reqJson, "xxx", "xxx");
        Assert.hasKeyAndValue(reqJson, "state", "必填,请填订单状态");
    }
    @Override
    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
        HttpHeaders header = new HttpHeaders();
        context.getRequestCurrentHeaders().put(CommonConstant.HTTP_ORDER_TYPE_CD, "D");
        JSONArray businesses = new JSONArray();
        AppService service = event.getAppService();
        //添加单元信息
        businesses.add(addPurchaseApply(reqJson, context));
        JSONObject paramInObj = super.restToCenterProtocol(businesses, context.getRequestCurrentHeaders());
        //将 rest header 信息传递到下层服务中去
        super.freshHttpHeader(header, context.getRequestCurrentHeaders());
        ResponseEntity<String> responseEntity = this.callService(context, service.getServiceCode(), paramInObj);
        context.setResponseEntity(responseEntity);
    }
    @Override
    public String getServiceCode() {
        return ServiceCodePurchaseApplyConstant.ADD_PURCHASE_APPLY;
    }
    @Override
    public HttpMethod getHttpMethod() {
        return HttpMethod.POST;
    }
    @Override
    public int getOrder() {
        return DEFAULT_ORDER;
    }
    /**
     * 添加小区信息
     *
     * @param paramInJson     接口调用放传入入参
     * @param dataFlowContext 数据上下文
     * @return 订单服务能够接受的报文
     */
    private JSONObject addPurchaseApply(JSONObject paramInJson, DataFlowContext dataFlowContext) {
        JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
        business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_SAVE_PURCHASE_APPLY);
        business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ);
        business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S);
        JSONObject businessPurchaseApply = new JSONObject();
        businessPurchaseApply.putAll(paramInJson);
        businessPurchaseApply.put("applyOrderId", "-1");
        //计算 应收金额
        business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessPurchaseApply", businessPurchaseApply);
        return business;
    }
}
Api/src/main/java/com/java110/api/listener/purchaseApply/UpdatePurchaseApplyListener.java
New file
@@ -0,0 +1,91 @@
package com.java110.api.listener.purchaseApply;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.java110.api.listener.AbstractServiceApiListener;
import com.java110.core.annotation.Java110Listener;
import com.java110.core.context.DataFlowContext;
import com.java110.entity.center.AppService;
import com.java110.event.service.api.ServiceDataFlowEvent;
import com.java110.utils.constant.BusinessTypeConstant;
import com.java110.utils.constant.CommonConstant;
import com.java110.utils.constant.ServiceCodePurchaseApplyConstant;
import com.java110.utils.util.Assert;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
/**
 * 保存采购申请侦听
 * add by wuxw 2019-06-30
 */
@Java110Listener("updatePurchaseApplyListener")
public class UpdatePurchaseApplyListener extends AbstractServiceApiListener {
    @Override
    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
        Assert.hasKeyAndValue(reqJson, "applyOrderId", "订单号不能为空");
        Assert.hasKeyAndValue(reqJson, "state", "必填,请填订单状态");
    }
    @Override
    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
        HttpHeaders header = new HttpHeaders();
        context.getRequestCurrentHeaders().put(CommonConstant.HTTP_ORDER_TYPE_CD, "D");
        JSONArray businesses = new JSONArray();
        AppService service = event.getAppService();
        //添加单元信息
        businesses.add(updatePurchaseApply(reqJson, context));
        JSONObject paramInObj = super.restToCenterProtocol(businesses, context.getRequestCurrentHeaders());
        //将 rest header 信息传递到下层服务中去
        super.freshHttpHeader(header, context.getRequestCurrentHeaders());
        ResponseEntity<String> responseEntity = this.callService(context, service.getServiceCode(), paramInObj);
        context.setResponseEntity(responseEntity);
    }
    @Override
    public String getServiceCode() {
        return ServiceCodePurchaseApplyConstant.UPDATE_PURCHASE_APPLY;
    }
    @Override
    public HttpMethod getHttpMethod() {
        return HttpMethod.POST;
    }
    @Override
    public int getOrder() {
        return DEFAULT_ORDER;
    }
    /**
     * 添加采购申请信息
     *
     * @param paramInJson     接口调用放传入入参
     * @param dataFlowContext 数据上下文
     * @return 订单服务能够接受的报文
     */
    private JSONObject updatePurchaseApply(JSONObject paramInJson, DataFlowContext dataFlowContext) {
        JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
        business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_PURCHASE_APPLY);
        business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ);
        business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S);
        JSONObject businessPurchaseApply = new JSONObject();
        businessPurchaseApply.putAll(paramInJson);
        //计算 应收金额
        business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessPurchaseApply", businessPurchaseApply);
        return business;
    }
}
Api/src/main/java/com/java110/api/listener/user/QueryStaffServiceListener.java
@@ -9,6 +9,7 @@
import com.java110.utils.exception.ListenerExecuteException;
import com.java110.utils.util.Assert;
import com.java110.utils.util.BeanConvertUtil;
import com.java110.utils.util.PinYinUtil;
import com.java110.utils.util.StringUtil;
import com.java110.core.annotation.Java110Listener;
import com.java110.core.context.DataFlowContext;
@@ -67,6 +68,7 @@
        if (count > 0) {
            staffs = BeanConvertUtil.covertBeanList(userInnerServiceSMOImpl.getStaffs(userDto), ApiStaffDataVo.class);
            refreshInitials(staffs);
        } else {
            staffs = new ArrayList<>();
        }
@@ -83,6 +85,20 @@
    }
    /**
     * 刷入首字母
     * @param staffs
     */
    private void refreshInitials(List<ApiStaffDataVo> staffs) {
        for(ApiStaffDataVo staffDataVo : staffs){
            if(StringUtil.isEmpty(staffDataVo.getName())){
                continue;
            }
            staffDataVo.setInitials(PinYinUtil.getFirstSpell(staffDataVo.getName()).toUpperCase().charAt(0)+"");
        }
    }
    /**
     * 查询用户信息
     * @param tmpObj
     */
StoreService/src/main/java/com/java110/store/dao/IPurchaseApplyServiceDao.java
New file
@@ -0,0 +1,76 @@
package com.java110.store.dao;
import com.java110.utils.exception.DAOException;
import java.util.List;
import java.util.Map;
/**
 * 采购申请组件内部之间使用,没有给外围系统提供服务能力
 * 采购申请服务接口类,要求全部以字符串传输,方便微服务化
 * 新建客户,修改客户,删除客户,查询客户等功能
 *
 * Created by wuxw on 2016/12/27.
 */
public interface IPurchaseApplyServiceDao {
    /**
     * 保存 采购申请信息
     * @param businessPurchaseApplyInfo 采购申请信息 封装
     * @throws DAOException 操作数据库异常
     */
    void saveBusinessPurchaseApplyInfo(Map businessPurchaseApplyInfo) throws DAOException;
    /**
     * 查询采购申请信息(business过程)
     * 根据bId 查询采购申请信息
     * @param info bId 信息
     * @return 采购申请信息
     * @throws DAOException DAO异常
     */
    List<Map> getBusinessPurchaseApplyInfo(Map info) throws DAOException;
    /**
     * 保存 采购申请信息 Business数据到 Instance中
     * @param info
     * @throws DAOException DAO异常
     */
    void savePurchaseApplyInfoInstance(Map info) throws DAOException;
    /**
     * 查询采购申请信息(instance过程)
     * 根据bId 查询采购申请信息
     * @param info bId 信息
     * @return 采购申请信息
     * @throws DAOException DAO异常
     */
    List<Map> getPurchaseApplyInfo(Map info) throws DAOException;
    /**
     * 修改采购申请信息
     * @param info 修改信息
     * @throws DAOException DAO异常
     */
    void updatePurchaseApplyInfoInstance(Map info) throws DAOException;
    /**
     * 查询采购申请总数
     *
     * @param info 采购申请信息
     * @return 采购申请数量
     */
    int queryPurchaseApplysCount(Map info);
}
StoreService/src/main/java/com/java110/store/dao/impl/PurchaseApplyServiceDaoImpl.java
New file
@@ -0,0 +1,129 @@
package com.java110.store.dao.impl;
import com.alibaba.fastjson.JSONObject;
import com.java110.core.base.dao.BaseServiceDao;
import com.java110.store.dao.IPurchaseApplyServiceDao;
import com.java110.utils.constant.ResponseConstant;
import com.java110.utils.exception.DAOException;
import com.java110.utils.util.DateUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
 * 采购申请服务 与数据库交互
 * Created by wuxw on 2017/4/5.
 */
@Service("purchaseApplyServiceDaoImpl")
//@Transactional
public class PurchaseApplyServiceDaoImpl extends BaseServiceDao implements IPurchaseApplyServiceDao {
    private static Logger logger = LoggerFactory.getLogger(PurchaseApplyServiceDaoImpl.class);
    /**
     * 采购申请信息封装
     * @param businessPurchaseApplyInfo 采购申请信息 封装
     * @throws DAOException DAO异常
     */
    @Override
    public void saveBusinessPurchaseApplyInfo(Map businessPurchaseApplyInfo) throws DAOException {
        businessPurchaseApplyInfo.put("month", DateUtil.getCurrentMonth());
        // 查询business_user 数据是否已经存在
        logger.debug("保存采购申请信息 入参 businessPurchaseApplyInfo : {}",businessPurchaseApplyInfo);
        int saveFlag = sqlSessionTemplate.insert("purchaseApplyServiceDaoImpl.saveBusinessPurchaseApplyInfo",businessPurchaseApplyInfo);
        if(saveFlag < 1){
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存采购申请数据失败:"+ JSONObject.toJSONString(businessPurchaseApplyInfo));
        }
    }
    /**
     * 查询采购申请信息
     * @param info bId 信息
     * @return 采购申请信息
     * @throws DAOException DAO异常
     */
    @Override
    public List<Map> getBusinessPurchaseApplyInfo(Map info) throws DAOException {
        logger.debug("查询采购申请信息 入参 info : {}",info);
        List<Map> businessPurchaseApplyInfos = sqlSessionTemplate.selectList("purchaseApplyServiceDaoImpl.getBusinessPurchaseApplyInfo",info);
        return businessPurchaseApplyInfos;
    }
    /**
     * 保存采购申请信息 到 instance
     * @param info   bId 信息
     * @throws DAOException DAO异常
     */
    @Override
    public void savePurchaseApplyInfoInstance(Map info) throws DAOException {
        logger.debug("保存采购申请信息Instance 入参 info : {}",info);
        int saveFlag = sqlSessionTemplate.insert("purchaseApplyServiceDaoImpl.savePurchaseApplyInfoInstance",info);
        if(saveFlag < 1){
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存采购申请信息Instance数据失败:"+ JSONObject.toJSONString(info));
        }
    }
    /**
     * 查询采购申请信息(instance)
     * @param info bId 信息
     * @return List<Map>
     * @throws DAOException DAO异常
     */
    @Override
    public List<Map> getPurchaseApplyInfo(Map info) throws DAOException {
        logger.debug("查询采购申请信息 入参 info : {}",info);
        List<Map> businessPurchaseApplyInfos = sqlSessionTemplate.selectList("purchaseApplyServiceDaoImpl.getPurchaseApplyInfo",info);
        return businessPurchaseApplyInfos;
    }
    /**
     * 修改采购申请信息
     * @param info 修改信息
     * @throws DAOException DAO异常
     */
    @Override
    public void updatePurchaseApplyInfoInstance(Map info) throws DAOException {
        logger.debug("修改采购申请信息Instance 入参 info : {}",info);
        int saveFlag = sqlSessionTemplate.update("purchaseApplyServiceDaoImpl.updatePurchaseApplyInfoInstance",info);
        if(saveFlag < 1){
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改采购申请信息Instance数据失败:"+ JSONObject.toJSONString(info));
        }
    }
     /**
     * 查询采购申请数量
     * @param info 采购申请信息
     * @return 采购申请数量
     */
    @Override
    public int queryPurchaseApplysCount(Map info) {
        logger.debug("查询采购申请数据 入参 info : {}",info);
        List<Map> businessPurchaseApplyInfos = sqlSessionTemplate.selectList("purchaseApplyServiceDaoImpl.queryPurchaseApplysCount", info);
        if (businessPurchaseApplyInfos.size() < 1) {
            return 0;
        }
        return Integer.parseInt(businessPurchaseApplyInfos.get(0).get("count").toString());
    }
}
StoreService/src/main/java/com/java110/store/listener/purchaseApply/AbstractPurchaseApplyBusinessServiceDataFlowListener.java
New file
@@ -0,0 +1,89 @@
package com.java110.store.listener.purchaseApply;
import com.alibaba.fastjson.JSONObject;
import com.java110.store.dao.IPurchaseApplyServiceDao;
import com.java110.utils.constant.ResponseConstant;
import com.java110.utils.constant.StatusConstant;
import com.java110.utils.exception.ListenerExecuteException;
import com.java110.entity.center.Business;
import com.java110.event.service.AbstractBusinessServiceDataFlowListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * 采购申请 服务侦听 父类
 * Created by wuxw on 2018/7/4.
 */
public abstract class AbstractPurchaseApplyBusinessServiceDataFlowListener extends AbstractBusinessServiceDataFlowListener {
    private static Logger logger = LoggerFactory.getLogger(AbstractPurchaseApplyBusinessServiceDataFlowListener.class);
    /**
     * 获取 DAO工具类
     *
     * @return
     */
    public abstract IPurchaseApplyServiceDao getPurchaseApplyServiceDaoImpl();
    /**
     * 刷新 businessPurchaseApplyInfo 数据
     * 主要将 数据库 中字段和 接口传递字段建立关系
     *
     * @param businessPurchaseApplyInfo
     */
    protected void flushBusinessPurchaseApplyInfo(Map businessPurchaseApplyInfo, String statusCd) {
        businessPurchaseApplyInfo.put("newBId", businessPurchaseApplyInfo.get("b_id"));
        businessPurchaseApplyInfo.put("operate", businessPurchaseApplyInfo.get("operate"));
        businessPurchaseApplyInfo.put("applyDetailId", businessPurchaseApplyInfo.get("apply_detail_id"));
        businessPurchaseApplyInfo.put("resOrderType", businessPurchaseApplyInfo.get("res_order_type"));
        businessPurchaseApplyInfo.put("description", businessPurchaseApplyInfo.get("description"));
        businessPurchaseApplyInfo.put("applyOrderId", businessPurchaseApplyInfo.get("apply_order_id"));
        businessPurchaseApplyInfo.put("state", businessPurchaseApplyInfo.get("state"));
        businessPurchaseApplyInfo.put("storeId", businessPurchaseApplyInfo.get("store_id"));
        businessPurchaseApplyInfo.put("entryPerson", businessPurchaseApplyInfo.get("entry_person"));
        businessPurchaseApplyInfo.put("userId", businessPurchaseApplyInfo.get("user_id"));
        businessPurchaseApplyInfo.remove("bId");
        businessPurchaseApplyInfo.put("statusCd", statusCd);
    }
    /**
     * 当修改数据时,查询instance表中的数据 自动保存删除数据到business中
     *
     * @param businessPurchaseApply 采购申请信息
     */
    protected void autoSaveDelBusinessPurchaseApply(Business business, JSONObject businessPurchaseApply) {
//自动插入DEL
        Map info = new HashMap();
        info.put("applyOrderId", businessPurchaseApply.getString("applyOrderId"));
        info.put("statusCd", StatusConstant.STATUS_CD_VALID);
        List<Map> currentPurchaseApplyInfos = getPurchaseApplyServiceDaoImpl().getPurchaseApplyInfo(info);
        if (currentPurchaseApplyInfos == null || currentPurchaseApplyInfos.size() != 1) {
            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR, "未找到需要修改数据信息,入参错误或数据有问题,请检查" + info);
        }
        Map currentPurchaseApplyInfo = currentPurchaseApplyInfos.get(0);
        currentPurchaseApplyInfo.put("bId", business.getbId());
        currentPurchaseApplyInfo.put("operate", currentPurchaseApplyInfo.get("operate"));
        currentPurchaseApplyInfo.put("applyDetailId", currentPurchaseApplyInfo.get("apply_detail_id"));
        currentPurchaseApplyInfo.put("resOrderType", currentPurchaseApplyInfo.get("res_order_type"));
        currentPurchaseApplyInfo.put("description", currentPurchaseApplyInfo.get("description"));
        currentPurchaseApplyInfo.put("applyOrderId", currentPurchaseApplyInfo.get("apply_order_id"));
        currentPurchaseApplyInfo.put("state", currentPurchaseApplyInfo.get("state"));
        currentPurchaseApplyInfo.put("storeId", currentPurchaseApplyInfo.get("store_id"));
        currentPurchaseApplyInfo.put("entryPerson", currentPurchaseApplyInfo.get("entry_person"));
        currentPurchaseApplyInfo.put("userId", currentPurchaseApplyInfo.get("user_id"));
        currentPurchaseApplyInfo.put("operate", StatusConstant.OPERATE_DEL);
        getPurchaseApplyServiceDaoImpl().saveBusinessPurchaseApplyInfo(currentPurchaseApplyInfo);
    }
}
StoreService/src/main/java/com/java110/store/listener/purchaseApply/DeletePurchaseApplyInfoListener.java
New file
@@ -0,0 +1,177 @@
package com.java110.store.listener.purchaseApply;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.java110.core.annotation.Java110Listener;
import com.java110.core.context.DataFlowContext;
import com.java110.entity.center.Business;
import com.java110.store.dao.IPurchaseApplyServiceDao;
import com.java110.utils.constant.BusinessTypeConstant;
import com.java110.utils.constant.ResponseConstant;
import com.java110.utils.constant.StatusConstant;
import com.java110.utils.exception.ListenerExecuteException;
import com.java110.utils.util.Assert;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * 删除采购申请信息 侦听
 *
 * 处理节点
 * 1、businessPurchaseApply:{} 采购申请基本信息节点
 * 2、businessPurchaseApplyAttr:[{}] 采购申请属性信息节点
 * 3、businessPurchaseApplyPhoto:[{}] 采购申请照片信息节点
 * 4、businessPurchaseApplyCerdentials:[{}] 采购申请证件信息节点
 * 协议地址 :https://github.com/java110/MicroCommunity/wiki/%E5%88%A0%E9%99%A4%E5%95%86%E6%88%B7%E4%BF%A1%E6%81%AF-%E5%8D%8F%E8%AE%AE
 * Created by wuxw on 2018/5/18.
 */
@Java110Listener("deletePurchaseApplyInfoListener")
@Transactional
public class DeletePurchaseApplyInfoListener extends AbstractPurchaseApplyBusinessServiceDataFlowListener {
    private final static Logger logger = LoggerFactory.getLogger(DeletePurchaseApplyInfoListener.class);
    @Autowired
    IPurchaseApplyServiceDao purchaseApplyServiceDaoImpl;
    @Override
    public int getOrder() {
        return 3;
    }
    @Override
    public String getBusinessTypeCd() {
        return BusinessTypeConstant.BUSINESS_TYPE_DELETE_PURCHASE_APPLY;
    }
    /**
     * 根据删除信息 查出Instance表中数据 保存至business表 (状态写DEL) 方便撤单时直接更新回去
     * @param dataFlowContext 数据对象
     * @param business 当前业务对象
     */
    @Override
    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
        JSONObject data = business.getDatas();
        Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理");
        //处理 businessPurchaseApply 节点
        if(data.containsKey("businessPurchaseApply")){
            //处理 businessPurchaseApply 节点
            if(data.containsKey("businessPurchaseApply")){
                Object _obj = data.get("businessPurchaseApply");
                JSONArray businessPurchaseApplys = null;
                if(_obj instanceof JSONObject){
                    businessPurchaseApplys = new JSONArray();
                    businessPurchaseApplys.add(_obj);
                }else {
                    businessPurchaseApplys = (JSONArray)_obj;
                }
                //JSONObject businessPurchaseApply = data.getJSONObject("businessPurchaseApply");
                for (int _purchaseApplyIndex = 0; _purchaseApplyIndex < businessPurchaseApplys.size();_purchaseApplyIndex++) {
                    JSONObject businessPurchaseApply = businessPurchaseApplys.getJSONObject(_purchaseApplyIndex);
                    doBusinessPurchaseApply(business, businessPurchaseApply);
                    if(_obj instanceof JSONObject) {
                        dataFlowContext.addParamOut("applyOrderId", businessPurchaseApply.getString("applyOrderId"));
                    }
                }
            }
        }
    }
    /**
     * 删除 instance数据
     * @param dataFlowContext 数据对象
     * @param business 当前业务对象
     */
    @Override
    protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) {
        String bId = business.getbId();
        //Assert.hasLength(bId,"请求报文中没有包含 bId");
        //采购申请信息
        Map info = new HashMap();
        info.put("bId",business.getbId());
        info.put("operate",StatusConstant.OPERATE_DEL);
        //采购申请信息
        List<Map> businessPurchaseApplyInfos = purchaseApplyServiceDaoImpl.getBusinessPurchaseApplyInfo(info);
        if( businessPurchaseApplyInfos != null && businessPurchaseApplyInfos.size() >0) {
            for (int _purchaseApplyIndex = 0; _purchaseApplyIndex < businessPurchaseApplyInfos.size();_purchaseApplyIndex++) {
                Map businessPurchaseApplyInfo = businessPurchaseApplyInfos.get(_purchaseApplyIndex);
                flushBusinessPurchaseApplyInfo(businessPurchaseApplyInfo,StatusConstant.STATUS_CD_INVALID);
                purchaseApplyServiceDaoImpl.updatePurchaseApplyInfoInstance(businessPurchaseApplyInfo);
                dataFlowContext.addParamOut("applyOrderId",businessPurchaseApplyInfo.get("apply_order_id"));
            }
        }
    }
    /**
     * 撤单
     * 从business表中查询到DEL的数据 将instance中的数据更新回来
     * @param dataFlowContext 数据对象
     * @param business 当前业务对象
     */
    @Override
    protected void doRecover(DataFlowContext dataFlowContext, Business business) {
        String bId = business.getbId();
        //Assert.hasLength(bId,"请求报文中没有包含 bId");
        Map info = new HashMap();
        info.put("bId",bId);
        info.put("statusCd",StatusConstant.STATUS_CD_INVALID);
        Map delInfo = new HashMap();
        delInfo.put("bId",business.getbId());
        delInfo.put("operate",StatusConstant.OPERATE_DEL);
        //采购申请信息
        List<Map> purchaseApplyInfo = purchaseApplyServiceDaoImpl.getPurchaseApplyInfo(info);
        if(purchaseApplyInfo != null && purchaseApplyInfo.size() > 0){
            //采购申请信息
            List<Map> businessPurchaseApplyInfos = purchaseApplyServiceDaoImpl.getBusinessPurchaseApplyInfo(delInfo);
            //除非程序出错了,这里不会为空
            if(businessPurchaseApplyInfos == null ||  businessPurchaseApplyInfos.size() == 0){
                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(purchaseApply),程序内部异常,请检查! "+delInfo);
            }
            for (int _purchaseApplyIndex = 0; _purchaseApplyIndex < businessPurchaseApplyInfos.size();_purchaseApplyIndex++) {
                Map businessPurchaseApplyInfo = businessPurchaseApplyInfos.get(_purchaseApplyIndex);
                flushBusinessPurchaseApplyInfo(businessPurchaseApplyInfo,StatusConstant.STATUS_CD_VALID);
                purchaseApplyServiceDaoImpl.updatePurchaseApplyInfoInstance(businessPurchaseApplyInfo);
            }
        }
    }
    /**
     * 处理 businessPurchaseApply 节点
     * @param business 总的数据节点
     * @param businessPurchaseApply 采购申请节点
     */
    private void doBusinessPurchaseApply(Business business,JSONObject businessPurchaseApply){
        Assert.jsonObjectHaveKey(businessPurchaseApply,"applyOrderId","businessPurchaseApply 节点下没有包含 applyOrderId 节点");
        if(businessPurchaseApply.getString("applyOrderId").startsWith("-")){
            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"applyOrderId 错误,不能自动生成(必须已经存在的applyOrderId)"+businessPurchaseApply);
        }
        //自动插入DEL
        autoSaveDelBusinessPurchaseApply(business,businessPurchaseApply);
    }
    public IPurchaseApplyServiceDao getPurchaseApplyServiceDaoImpl() {
        return purchaseApplyServiceDaoImpl;
    }
    public void setPurchaseApplyServiceDaoImpl(IPurchaseApplyServiceDao purchaseApplyServiceDaoImpl) {
        this.purchaseApplyServiceDaoImpl = purchaseApplyServiceDaoImpl;
    }
}
StoreService/src/main/java/com/java110/store/listener/purchaseApply/SavePurchaseApplyInfoListener.java
New file
@@ -0,0 +1,175 @@
package com.java110.store.listener.purchaseApply;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.java110.core.annotation.Java110Listener;
import com.java110.core.context.DataFlowContext;
import com.java110.core.factory.GenerateCodeFactory;
import com.java110.entity.center.Business;
import com.java110.store.dao.IPurchaseApplyServiceDao;
import com.java110.utils.constant.BusinessTypeConstant;
import com.java110.utils.constant.StatusConstant;
import com.java110.utils.util.Assert;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * 保存 采购申请信息 侦听
 * Created by wuxw on 2018/5/18.
 */
@Java110Listener("savePurchaseApplyInfoListener")
@Transactional
public class SavePurchaseApplyInfoListener extends AbstractPurchaseApplyBusinessServiceDataFlowListener{
    private static Logger logger = LoggerFactory.getLogger(SavePurchaseApplyInfoListener.class);
    @Autowired
    private IPurchaseApplyServiceDao purchaseApplyServiceDaoImpl;
    @Override
    public int getOrder() {
        return 0;
    }
    @Override
    public String getBusinessTypeCd() {
        return BusinessTypeConstant.BUSINESS_TYPE_SAVE_PURCHASE_APPLY;
    }
    /**
     * 保存采购申请信息 business 表中
     * @param dataFlowContext 数据对象
     * @param business 当前业务对象
     */
    @Override
    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
        JSONObject data = business.getDatas();
        Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理");
        //处理 businessPurchaseApply 节点
        if(data.containsKey("businessPurchaseApply")){
            Object bObj = data.get("businessPurchaseApply");
            JSONArray businessPurchaseApplys = null;
            if(bObj instanceof JSONObject){
                businessPurchaseApplys = new JSONArray();
                businessPurchaseApplys.add(bObj);
            }else {
                businessPurchaseApplys = (JSONArray)bObj;
            }
            //JSONObject businessPurchaseApply = data.getJSONObject("businessPurchaseApply");
            for (int bPurchaseApplyIndex = 0; bPurchaseApplyIndex < businessPurchaseApplys.size();bPurchaseApplyIndex++) {
                JSONObject businessPurchaseApply = businessPurchaseApplys.getJSONObject(bPurchaseApplyIndex);
                doBusinessPurchaseApply(business, businessPurchaseApply);
                if(bObj instanceof JSONObject) {
                    dataFlowContext.addParamOut("applyOrderId", businessPurchaseApply.getString("applyOrderId"));
                }
            }
        }
    }
    /**
     * business 数据转移到 instance
     * @param dataFlowContext 数据对象
     * @param business 当前业务对象
     */
    @Override
    protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) {
        JSONObject data = business.getDatas();
        Map info = new HashMap();
        info.put("bId",business.getbId());
        info.put("operate",StatusConstant.OPERATE_ADD);
        //采购申请信息
        List<Map> businessPurchaseApplyInfo = purchaseApplyServiceDaoImpl.getBusinessPurchaseApplyInfo(info);
        if( businessPurchaseApplyInfo != null && businessPurchaseApplyInfo.size() >0) {
            reFreshShareColumn(info, businessPurchaseApplyInfo.get(0));
            purchaseApplyServiceDaoImpl.savePurchaseApplyInfoInstance(info);
            if(businessPurchaseApplyInfo.size() == 1) {
                dataFlowContext.addParamOut("applyOrderId", businessPurchaseApplyInfo.get(0).get("apply_order_id"));
            }
        }
    }
    /**
     * 刷 分片字段
     *
     * @param info         查询对象
     * @param businessInfo 小区ID
     */
    private void reFreshShareColumn(Map info, Map businessInfo) {
        if (info.containsKey("storeId")) {
            return;
        }
        if (!businessInfo.containsKey("store_id")) {
            return;
        }
        info.put("storeId", businessInfo.get("store_id"));
    }
    /**
     * 撤单
     * @param dataFlowContext 数据对象
     * @param business 当前业务对象
     */
    @Override
    protected void doRecover(DataFlowContext dataFlowContext, Business business) {
        String bId = business.getbId();
        //Assert.hasLength(bId,"请求报文中没有包含 bId");
        Map info = new HashMap();
        info.put("bId",bId);
        info.put("statusCd",StatusConstant.STATUS_CD_VALID);
        Map paramIn = new HashMap();
        paramIn.put("bId",bId);
        paramIn.put("statusCd",StatusConstant.STATUS_CD_INVALID);
        //采购申请信息
        List<Map> purchaseApplyInfo = purchaseApplyServiceDaoImpl.getPurchaseApplyInfo(info);
        if(purchaseApplyInfo != null && purchaseApplyInfo.size() > 0){
            reFreshShareColumn(paramIn, purchaseApplyInfo.get(0));
            purchaseApplyServiceDaoImpl.updatePurchaseApplyInfoInstance(paramIn);
        }
    }
    /**
     * 处理 businessPurchaseApply 节点
     * @param business 总的数据节点
     * @param businessPurchaseApply 采购申请节点
     */
    private void doBusinessPurchaseApply(Business business,JSONObject businessPurchaseApply){
        Assert.jsonObjectHaveKey(businessPurchaseApply,"applyOrderId","businessPurchaseApply 节点下没有包含 applyOrderId 节点");
        if(businessPurchaseApply.getString("applyOrderId").startsWith("-")){
            //刷新缓存
            //flushPurchaseApplyId(business.getDatas());
            businessPurchaseApply.put("applyOrderId",GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_applyOrderId));
        }
        businessPurchaseApply.put("bId",business.getbId());
        businessPurchaseApply.put("operate", StatusConstant.OPERATE_ADD);
        //保存采购申请信息
        purchaseApplyServiceDaoImpl.saveBusinessPurchaseApplyInfo(businessPurchaseApply);
    }
    public IPurchaseApplyServiceDao getPurchaseApplyServiceDaoImpl() {
        return purchaseApplyServiceDaoImpl;
    }
    public void setPurchaseApplyServiceDaoImpl(IPurchaseApplyServiceDao purchaseApplyServiceDaoImpl) {
        this.purchaseApplyServiceDaoImpl = purchaseApplyServiceDaoImpl;
    }
}
StoreService/src/main/java/com/java110/store/listener/purchaseApply/UpdatePurchaseApplyInfoListener.java
New file
@@ -0,0 +1,190 @@
package com.java110.store.listener.purchaseApply;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.java110.core.annotation.Java110Listener;
import com.java110.core.context.DataFlowContext;
import com.java110.entity.center.Business;
import com.java110.store.dao.IPurchaseApplyServiceDao;
import com.java110.utils.constant.BusinessTypeConstant;
import com.java110.utils.constant.ResponseConstant;
import com.java110.utils.constant.StatusConstant;
import com.java110.utils.exception.ListenerExecuteException;
import com.java110.utils.util.Assert;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * 修改采购申请信息 侦听
 *
 * 处理节点
 * 1、businessPurchaseApply:{} 采购申请基本信息节点
 * 2、businessPurchaseApplyAttr:[{}] 采购申请属性信息节点
 * 3、businessPurchaseApplyPhoto:[{}] 采购申请照片信息节点
 * 4、businessPurchaseApplyCerdentials:[{}] 采购申请证件信息节点
 * 协议地址 :https://github.com/java110/MicroCommunity/wiki/%E4%BF%AE%E6%94%B9%E5%95%86%E6%88%B7%E4%BF%A1%E6%81%AF-%E5%8D%8F%E8%AE%AE
 * Created by wuxw on 2018/5/18.
 */
@Java110Listener("updatePurchaseApplyInfoListener")
@Transactional
public class UpdatePurchaseApplyInfoListener extends AbstractPurchaseApplyBusinessServiceDataFlowListener {
    private static Logger logger = LoggerFactory.getLogger(UpdatePurchaseApplyInfoListener.class);
    @Autowired
    private IPurchaseApplyServiceDao purchaseApplyServiceDaoImpl;
    @Override
    public int getOrder() {
        return 2;
    }
    @Override
    public String getBusinessTypeCd() {
        return BusinessTypeConstant.BUSINESS_TYPE_UPDATE_PURCHASE_APPLY;
    }
    /**
     * business过程
     * @param dataFlowContext 上下文对象
     * @param business 业务对象
     */
    @Override
    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
        JSONObject data = business.getDatas();
        Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理");
        //处理 businessPurchaseApply 节点
        if(data.containsKey("businessPurchaseApply")){
            //处理 businessPurchaseApply 节点
            if(data.containsKey("businessPurchaseApply")){
                Object _obj = data.get("businessPurchaseApply");
                JSONArray businessPurchaseApplys = null;
                if(_obj instanceof JSONObject){
                    businessPurchaseApplys = new JSONArray();
                    businessPurchaseApplys.add(_obj);
                }else {
                    businessPurchaseApplys = (JSONArray)_obj;
                }
                //JSONObject businessPurchaseApply = data.getJSONObject("businessPurchaseApply");
                for (int _purchaseApplyIndex = 0; _purchaseApplyIndex < businessPurchaseApplys.size();_purchaseApplyIndex++) {
                    JSONObject businessPurchaseApply = businessPurchaseApplys.getJSONObject(_purchaseApplyIndex);
                    doBusinessPurchaseApply(business, businessPurchaseApply);
                    if(_obj instanceof JSONObject) {
                        dataFlowContext.addParamOut("applyOrderId", businessPurchaseApply.getString("applyOrderId"));
                    }
                }
            }
        }
    }
    /**
     * business to instance 过程
     * @param dataFlowContext 数据对象
     * @param business 当前业务对象
     */
    @Override
    protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) {
        JSONObject data = business.getDatas();
        Map info = new HashMap();
        info.put("bId",business.getbId());
        info.put("operate",StatusConstant.OPERATE_ADD);
        //采购申请信息
        List<Map> businessPurchaseApplyInfos = purchaseApplyServiceDaoImpl.getBusinessPurchaseApplyInfo(info);
        if( businessPurchaseApplyInfos != null && businessPurchaseApplyInfos.size() >0) {
            for (int _purchaseApplyIndex = 0; _purchaseApplyIndex < businessPurchaseApplyInfos.size();_purchaseApplyIndex++) {
                Map businessPurchaseApplyInfo = businessPurchaseApplyInfos.get(_purchaseApplyIndex);
                flushBusinessPurchaseApplyInfo(businessPurchaseApplyInfo,StatusConstant.STATUS_CD_VALID);
                purchaseApplyServiceDaoImpl.updatePurchaseApplyInfoInstance(businessPurchaseApplyInfo);
                if(businessPurchaseApplyInfo.size() == 1) {
                    dataFlowContext.addParamOut("applyOrderId", businessPurchaseApplyInfo.get("apply_order_id"));
                }
            }
        }
    }
    /**
     * 撤单
     * @param dataFlowContext 数据对象
     * @param business 当前业务对象
     */
    @Override
    protected void doRecover(DataFlowContext dataFlowContext, Business business) {
        String bId = business.getbId();
        //Assert.hasLength(bId,"请求报文中没有包含 bId");
        Map info = new HashMap();
        info.put("bId",bId);
        info.put("statusCd",StatusConstant.STATUS_CD_VALID);
        Map delInfo = new HashMap();
        delInfo.put("bId",business.getbId());
        delInfo.put("operate",StatusConstant.OPERATE_DEL);
        //采购申请信息
        List<Map> purchaseApplyInfo = purchaseApplyServiceDaoImpl.getPurchaseApplyInfo(info);
        if(purchaseApplyInfo != null && purchaseApplyInfo.size() > 0){
            //采购申请信息
            List<Map> businessPurchaseApplyInfos = purchaseApplyServiceDaoImpl.getBusinessPurchaseApplyInfo(delInfo);
            //除非程序出错了,这里不会为空
            if(businessPurchaseApplyInfos == null || businessPurchaseApplyInfos.size() == 0){
                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(purchaseApply),程序内部异常,请检查! "+delInfo);
            }
            for (int _purchaseApplyIndex = 0; _purchaseApplyIndex < businessPurchaseApplyInfos.size();_purchaseApplyIndex++) {
                Map businessPurchaseApplyInfo = businessPurchaseApplyInfos.get(_purchaseApplyIndex);
                flushBusinessPurchaseApplyInfo(businessPurchaseApplyInfo,StatusConstant.STATUS_CD_VALID);
                purchaseApplyServiceDaoImpl.updatePurchaseApplyInfoInstance(businessPurchaseApplyInfo);
            }
        }
    }
    /**
     * 处理 businessPurchaseApply 节点
     * @param business 总的数据节点
     * @param businessPurchaseApply 采购申请节点
     */
    private void doBusinessPurchaseApply(Business business,JSONObject businessPurchaseApply){
        Assert.jsonObjectHaveKey(businessPurchaseApply,"applyOrderId","businessPurchaseApply 节点下没有包含 applyOrderId 节点");
        if(businessPurchaseApply.getString("applyOrderId").startsWith("-")){
            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"applyOrderId 错误,不能自动生成(必须已经存在的applyOrderId)"+businessPurchaseApply);
        }
        //自动保存DEL
        autoSaveDelBusinessPurchaseApply(business,businessPurchaseApply);
        businessPurchaseApply.put("bId",business.getbId());
        businessPurchaseApply.put("operate", StatusConstant.OPERATE_ADD);
        //保存采购申请信息
        purchaseApplyServiceDaoImpl.saveBusinessPurchaseApplyInfo(businessPurchaseApply);
    }
    public IPurchaseApplyServiceDao getPurchaseApplyServiceDaoImpl() {
        return purchaseApplyServiceDaoImpl;
    }
    public void setPurchaseApplyServiceDaoImpl(IPurchaseApplyServiceDao purchaseApplyServiceDaoImpl) {
        this.purchaseApplyServiceDaoImpl = purchaseApplyServiceDaoImpl;
    }
}
StoreService/src/main/java/com/java110/store/smo/impl/PurchaseApplyInnerServiceSMOImpl.java
New file
@@ -0,0 +1,111 @@
package com.java110.store.smo.impl;
import com.java110.core.base.smo.BaseServiceSMO;
import com.java110.core.smo.purchaseApply.IPurchaseApplyInnerServiceSMO;
import com.java110.core.smo.user.IUserInnerServiceSMO;
import com.java110.dto.PageDto;
import com.java110.dto.purchaseApply.PurchaseApplyDto;
import com.java110.dto.user.UserDto;
import com.java110.store.dao.IPurchaseApplyServiceDao;
import com.java110.utils.util.BeanConvertUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
/**
 * @ClassName FloorInnerServiceSMOImpl
 * @Description 采购申请内部服务实现类
 * @Author wuxw
 * @Date 2019/4/24 9:20
 * @Version 1.0
 * add by wuxw 2019/4/24
 **/
@RestController
public class PurchaseApplyInnerServiceSMOImpl extends BaseServiceSMO implements IPurchaseApplyInnerServiceSMO {
    @Autowired
    private IPurchaseApplyServiceDao purchaseApplyServiceDaoImpl;
    @Autowired
    private IUserInnerServiceSMO userInnerServiceSMOImpl;
    @Override
    public List<PurchaseApplyDto> queryPurchaseApplys(@RequestBody  PurchaseApplyDto purchaseApplyDto) {
        //校验是否传了 分页信息
        int page = purchaseApplyDto.getPage();
        if (page != PageDto.DEFAULT_PAGE) {
            purchaseApplyDto.setPage((page - 1) * purchaseApplyDto.getRow());
        }
        List<PurchaseApplyDto> purchaseApplys = BeanConvertUtil.covertBeanList(purchaseApplyServiceDaoImpl.getPurchaseApplyInfo(BeanConvertUtil.beanCovertMap(purchaseApplyDto)), PurchaseApplyDto.class);
        if (purchaseApplys == null || purchaseApplys.size() == 0) {
            return purchaseApplys;
        }
        String[] userIds = getUserIds(purchaseApplys);
        //根据 userId 查询用户信息
        List<UserDto> users = userInnerServiceSMOImpl.getUserInfo(userIds);
        for (PurchaseApplyDto purchaseApply : purchaseApplys) {
            refreshPurchaseApply(purchaseApply, users);
        }
        return purchaseApplys;
    }
    /**
     * 从用户列表中查询用户,将用户中的信息 刷新到 floor对象中
     *
     * @param purchaseApply 小区采购申请信息
     * @param users 用户列表
     */
    private void refreshPurchaseApply(PurchaseApplyDto purchaseApply, List<UserDto> users) {
        for (UserDto user : users) {
            if (purchaseApply.getUserId().equals(user.getUserId())) {
                BeanConvertUtil.covertBean(user, purchaseApply);
            }
        }
    }
    /**
     * 获取批量userId
     *
     * @param purchaseApplys 小区楼信息
     * @return 批量userIds 信息
     */
    private String[] getUserIds(List<PurchaseApplyDto> purchaseApplys) {
        List<String> userIds = new ArrayList<String>();
        for (PurchaseApplyDto purchaseApply : purchaseApplys) {
            userIds.add(purchaseApply.getUserId());
        }
        return userIds.toArray(new String[userIds.size()]);
    }
    @Override
    public int queryPurchaseApplysCount(@RequestBody PurchaseApplyDto purchaseApplyDto) {
        return purchaseApplyServiceDaoImpl.queryPurchaseApplysCount(BeanConvertUtil.beanCovertMap(purchaseApplyDto));    }
    public IPurchaseApplyServiceDao getPurchaseApplyServiceDaoImpl() {
        return purchaseApplyServiceDaoImpl;
    }
    public void setPurchaseApplyServiceDaoImpl(IPurchaseApplyServiceDao purchaseApplyServiceDaoImpl) {
        this.purchaseApplyServiceDaoImpl = purchaseApplyServiceDaoImpl;
    }
    public IUserInnerServiceSMO getUserInnerServiceSMOImpl() {
        return userInnerServiceSMOImpl;
    }
    public void setUserInnerServiceSMOImpl(IUserInnerServiceSMO userInnerServiceSMOImpl) {
        this.userInnerServiceSMOImpl = userInnerServiceSMOImpl;
    }
}
WebService/src/main/java/com/java110/web/components/purchaseApply/AddPurchaseApplyComponent.java
New file
@@ -0,0 +1,34 @@
package com.java110.web.components.purchaseApply;
import com.java110.core.context.IPageData;
import com.java110.web.smo.purchaseApply.IAddPurchaseApplySMO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
/**
 * 添加采购申请组件
 */
@Component("addPurchaseApply")
public class AddPurchaseApplyComponent {
    @Autowired
    private IAddPurchaseApplySMO addPurchaseApplySMOImpl;
    /**
     * 添加采购申请数据
     * @param pd 页面数据封装
     * @return ResponseEntity 对象
     */
    public ResponseEntity<String> save(IPageData pd){
        return addPurchaseApplySMOImpl.savePurchaseApply(pd);
    }
    public IAddPurchaseApplySMO getAddPurchaseApplySMOImpl() {
        return addPurchaseApplySMOImpl;
    }
    public void setAddPurchaseApplySMOImpl(IAddPurchaseApplySMO addPurchaseApplySMOImpl) {
        this.addPurchaseApplySMOImpl = addPurchaseApplySMOImpl;
    }
}
WebService/src/main/java/com/java110/web/components/purchaseApply/ChoosePurchaseApplyComponent.java
New file
@@ -0,0 +1,41 @@
package com.java110.web.components.purchaseApply;
import com.java110.core.context.IPageData;
import com.java110.web.smo.purchaseApply.IListPurchaseApplysSMO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
/**
 * 应用组件管理类
 * <p>
 * add by wuxw
 * <p>
 * 2019-06-29
 */
@Component("choosePurchaseApply")
public class ChoosePurchaseApplyComponent {
    @Autowired
    private IListPurchaseApplysSMO listPurchaseApplysSMOImpl;
    /**
     * 查询应用列表
     *
     * @param pd 页面数据封装
     * @return 返回 ResponseEntity 对象
     */
    public ResponseEntity<String> list(IPageData pd) {
        return listPurchaseApplysSMOImpl.listPurchaseApplys(pd);
    }
    public IListPurchaseApplysSMO getListPurchaseApplysSMOImpl() {
        return listPurchaseApplysSMOImpl;
    }
    public void setListPurchaseApplysSMOImpl(IListPurchaseApplysSMO listPurchaseApplysSMOImpl) {
        this.listPurchaseApplysSMOImpl = listPurchaseApplysSMOImpl;
    }
}
WebService/src/main/java/com/java110/web/components/purchaseApply/DeletePurchaseApplyComponent.java
New file
@@ -0,0 +1,35 @@
package com.java110.web.components.purchaseApply;
import com.java110.core.context.IPageData;
import com.java110.web.smo.purchaseApply.IDeletePurchaseApplySMO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
/**
 * 添加采购申请组件
 */
@Component("deletePurchaseApply")
public class DeletePurchaseApplyComponent {
    @Autowired
    private IDeletePurchaseApplySMO deletePurchaseApplySMOImpl;
    /**
     * 添加采购申请数据
     *
     * @param pd 页面数据封装
     * @return ResponseEntity 对象
     */
    public ResponseEntity<String> delete(IPageData pd) {
        return deletePurchaseApplySMOImpl.deletePurchaseApply(pd);
    }
    public IDeletePurchaseApplySMO getDeletePurchaseApplySMOImpl() {
        return deletePurchaseApplySMOImpl;
    }
    public void setDeletePurchaseApplySMOImpl(IDeletePurchaseApplySMO deletePurchaseApplySMOImpl) {
        this.deletePurchaseApplySMOImpl = deletePurchaseApplySMOImpl;
    }
}
WebService/src/main/java/com/java110/web/components/purchaseApply/EditPurchaseApplyComponent.java
New file
@@ -0,0 +1,34 @@
package com.java110.web.components.purchaseApply;
import com.java110.core.context.IPageData;
import com.java110.web.smo.purchaseApply.IEditPurchaseApplySMO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
/**
 * 编辑小区组件
 */
@Component("editPurchaseApply")
public class EditPurchaseApplyComponent {
    @Autowired
    private IEditPurchaseApplySMO editPurchaseApplySMOImpl;
    /**
     * 添加小区数据
     * @param pd 页面数据封装
     * @return ResponseEntity 对象
     */
    public ResponseEntity<String> update(IPageData pd){
        return editPurchaseApplySMOImpl.updatePurchaseApply(pd);
    }
    public IEditPurchaseApplySMO getEditPurchaseApplySMOImpl() {
        return editPurchaseApplySMOImpl;
    }
    public void setEditPurchaseApplySMOImpl(IEditPurchaseApplySMO editPurchaseApplySMOImpl) {
        this.editPurchaseApplySMOImpl = editPurchaseApplySMOImpl;
    }
}
WebService/src/main/java/com/java110/web/components/purchaseApply/PurchaseApplyManageComponent.java
New file
@@ -0,0 +1,40 @@
package com.java110.web.components.purchaseApply;
import com.java110.core.context.IPageData;
import com.java110.web.smo.purchaseApply.IListPurchaseApplysSMO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
/**
 * 采购申请组件管理类
 *
 * add by wuxw
 *
 * 2019-06-29
 */
@Component("purchaseApplyManage")
public class PurchaseApplyManageComponent {
    @Autowired
    private IListPurchaseApplysSMO listPurchaseApplysSMOImpl;
    /**
     * 查询采购申请列表
     * @param pd 页面数据封装
     * @return 返回 ResponseEntity 对象
     */
    public ResponseEntity<String> list(IPageData pd){
        return listPurchaseApplysSMOImpl.listPurchaseApplys(pd);
    }
    public IListPurchaseApplysSMO getListPurchaseApplysSMOImpl() {
        return listPurchaseApplysSMOImpl;
    }
    public void setListPurchaseApplysSMOImpl(IListPurchaseApplysSMO listPurchaseApplysSMOImpl) {
        this.listPurchaseApplysSMOImpl = listPurchaseApplysSMOImpl;
    }
}
WebService/src/main/java/com/java110/web/smo/purchaseApply/IAddPurchaseApplySMO.java
New file
@@ -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);
}
WebService/src/main/java/com/java110/web/smo/purchaseApply/IDeletePurchaseApplySMO.java
New file
@@ -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);
}
WebService/src/main/java/com/java110/web/smo/purchaseApply/IEditPurchaseApplySMO.java
New file
@@ -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);
}
WebService/src/main/java/com/java110/web/smo/purchaseApply/IListPurchaseApplysSMO.java
New file
@@ -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;
}
WebService/src/main/java/com/java110/web/smo/purchaseApply/impl/AddPurchaseApplySMOImpl.java
New file
@@ -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;
    }
}
WebService/src/main/java/com/java110/web/smo/purchaseApply/impl/DeletePurchaseApplySMOImpl.java
New file
@@ -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;
    }
}
WebService/src/main/java/com/java110/web/smo/purchaseApply/impl/EditPurchaseApplySMOImpl.java
New file
@@ -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;
    }
}
WebService/src/main/java/com/java110/web/smo/purchaseApply/impl/ListPurchaseApplysSMOImpl.java
New file
@@ -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;
    }
}
WebService/src/main/resources/components/complaintPackage/addComplaintStep/addComplaintStep.html
@@ -17,6 +17,11 @@
                   callBackListener="addComplaintStep"
                   callBackFunction="notify"
        ></vc:create>
        <vc:create name="searchRoom"
                   emitChooseRoom="sellRoomSelectRoom"
                   emitLoadData="sellRoomOther"
                   roomFlag="1"
        ></vc:create>
    </div>
    <div v-if="addComplaintStepInfo.index == 2">
        <vc:create name="addComplainView"
WebService/src/main/resources/components/ownerPackage/addOwnerRoomBinding/addOwnerRoomBinding.html
@@ -17,6 +17,11 @@
                   callBackListener="addOwnerRoomBinding"
                   callBackFunction="notify"
        ></vc:create>
        <vc:create name="searchRoom"
                   emitChooseRoom="sellRoomSelectRoom"
                   emitLoadData="sellRoomOther"
                   roomFlag="2"
        ></vc:create>
    </div>
    <div v-if="addOwnerRoomBindingInfo.index == 2">
        <vc:create name="viewOwnerInfo"
@@ -26,6 +31,7 @@
    </div>
    <div class="row">
        <div class="col-md-10"></div>
        <div class="col-md-2 " style="margin-bottom:10px; text-align:right">
WebService/src/main/resources/components/purchaseApplyPackage/add-purchaseApply/addPurchaseApply.html
New file
@@ -0,0 +1,64 @@
<div id="addPurchaseApplyModel" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
     aria-hidden="true">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-body">
                <h3 class="m-t-none m-b ">添加采购申请</h3>
                <div class="ibox-content">
                    <div>
                        <div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">使用人</label>
                                <div class="col-sm-3">
                                    <vc:create name="orgSelect2"
                                               parentModal="addInspectionPlanModel"
                                               callBackListener="addInspectionPlanInfo"
                                               callBackFunction="notify"
                                               namespace="addInspectionPlan"
                                    ></vc:create>
                                </div>
                                <div class="col-sm-3">
                                    <vc:create name="departmentSelect2"
                                               parentModal="addInspectionPlanModel"
                                               callBackListener="addInspectionPlanInfo"
                                               callBackFunction="notify"
                                               namespace="addInspectionPlan"
                                    ></vc:create>
                                </div>
                                <div class="col-sm-3">
                                    <vc:create name="staffSelect2"
                                               parentModal="addInspectionPlanModel"
                                               callBackListener="addInspectionPlanInfo"
                                               callBackFunction="notify"
                                               namespace="addInspectionPlan"
                                    ></vc:create>
                                </div>
                            </div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">申请说明</label>
                                <div class="col-sm-10">
                                    <textarea v-model="addPurchaseApplyInfo.description" type="text" placeholder="选填,请填写申请说明"
                                              class="form-control">
                                    </textarea>
                                </div>
                            </div>
                            <ul class="nav nav-list"><li class="divider"></li></ul>
                            <table id="resource_table"></table>
                            <div class="ibox-content">
                                <button class="btn btn-primary float-right" type="button"
                                        v-on:click="savePurchaseApplyInfo()"><i class="fa fa-check"></i>&nbsp;保存
                                </button>
                                <button type="button" class="btn btn-warning float-right" style="margin-right:20px;"
                                        data-dismiss="modal">取消
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
WebService/src/main/resources/components/purchaseApplyPackage/add-purchaseApply/addPurchaseApply.js
New file
@@ -0,0 +1,130 @@
(function(vc){
    vc.extends({
        propTypes: {
               callBackListener:vc.propTypes.string, //父组件名称
               callBackFunction:vc.propTypes.string //父组件监听方法
        },
        data:{
            addPurchaseApplyInfo:{
                applyOrderId:'',
                state:'',
                description:''
            }
        },
         _initMethod:function(){
            //初始化物品表格
             vc.component.initResourceTable();
         },
         _initEvent:function(){
            vc.on('addPurchaseApply','openAddPurchaseApplyModal',function(){
                $('#addPurchaseApplyModel').modal('show');
            });
        },
        methods:{
            addPurchaseApplyValidate(){
                return vc.validate.validate({
                    addPurchaseApplyInfo:vc.component.addPurchaseApplyInfo
                },{
                    'addPurchaseApplyInfo.state':[
{
                            limit:"required",
                            param:"",
                            errInfo:"订单状态不能为空"
                        },
 {
                            limit:"num",
                            param:"",
                            errInfo:"计算公式格式错误"
                        },
                    ],
                });
            },
            savePurchaseApplyInfo:function(){
                if(!vc.component.addPurchaseApplyValidate()){
                    vc.toast(vc.validate.errInfo);
                    return ;
                }
                vc.component.addPurchaseApplyInfo.communityId = vc.getCurrentCommunity().communityId;
                //不提交数据将数据 回调给侦听处理
                if(vc.notNull($props.callBackListener)){
                    vc.emit($props.callBackListener,$props.callBackFunction,vc.component.addPurchaseApplyInfo);
                    $('#addPurchaseApplyModel').modal('hide');
                    return ;
                }
                vc.http.post(
                    'addPurchaseApply',
                    'save',
                    JSON.stringify(vc.component.addPurchaseApplyInfo),
                    {
                        emulateJSON:true
                     },
                     function(json,res){
                        //vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
                        if(res.status == 200){
                            //关闭model
                            $('#addPurchaseApplyModel').modal('hide');
                            vc.component.clearAddPurchaseApplyInfo();
                            vc.emit('purchaseApplyManage','listPurchaseApply',{});
                            return ;
                        }
                        vc.message(json);
                     },
                     function(errInfo,error){
                        console.log('请求失败处理');
                        vc.message(errInfo);
                     });
            },
            clearAddPurchaseApplyInfo:function(){
                vc.component.addPurchaseApplyInfo = {
                    state:'',
                };
            },
            //初始化表格
            initResourceTable:function(){
                $('#resource_table').bootstrapTable({
                    height: 500,
                    columns: [
                        {
                            field:'resId',
                            title:'资源ID',
                        },
                        {
                            field:'resName',
                            title:'资源名称',
                        },{
                            field:'resCode',
                            title:'物品编码',
                        },{
                            field:'price',
                            title:'单价',
                        },{
                            field:'stock',
                            title:'库存'
                        },{
                            field:'quantity',
                            title:'采购数量'
                        },
                        {
                            field:'remark',
                            title:'备注'
                        }
                    ],
                });
            }
        }
    });
})(window.vc);
WebService/src/main/resources/components/purchaseApplyPackage/choose-purchaseApply/choosePurchaseApply.html
New file
@@ -0,0 +1,56 @@
<div id = "choosePurchaseApplyModel" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="choosePurchaseApplyModelLabel" aria-hidden="true" >
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <h3 class="modal-title" id="choosePurchaseApplyModelLabel">选择采购申请</h3>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <div class=" row">
                    <div class="col-lg-12">
                        <div class="ibox ">
                            <div class="row">
                                <div class="col-sm-7 m-b-xs">
                                </div>
                                <div class="col-sm-5">
                                    <div class="input-group">
                                        <input placeholder="输入采购申请名称" type="text" v-model="choosePurchaseApplyInfo._currentPurchaseApplyName" class="form-control form-control-sm">
                                        <span class="input-group-append">
                                                <button type="button" class="btn btn-sm btn-primary" v-on:click="queryPurchaseApplys()">查询</button>
                                            </span>
                                    </div>
                                </div>
                            </div>
                            <div class="table-responsive" style="margin-top:15px">
                                <table class="table table-striped">
                                    <thead>
                                        <tr>
                                                                        <th class="text-center">订单号</th>
                            <th class="text-center">订单状态</th>
                            <th class="text-center">操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr v-for="purchaseApply in choosePurchaseApplyInfo.purchaseApplys">
                                                                        <td class="text-center">{{purchaseApply.applyOrderId}}</td>
                            <td class="text-center">{{purchaseApply.state}}</td>
                                            <td>
                                                <button class="btn btn-primary btn-xs" v-on:click="choosePurchaseApply(purchaseApply)">选择</button>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
WebService/src/main/resources/components/purchaseApplyPackage/choose-purchaseApply/choosePurchaseApply.js
New file
@@ -0,0 +1,64 @@
(function(vc){
    vc.extends({
        propTypes: {
           emitChoosePurchaseApply:vc.propTypes.string,
           emitLoadData:vc.propTypes.string
        },
        data:{
            choosePurchaseApplyInfo:{
                purchaseApplys:[],
                _currentPurchaseApplyName:'',
            }
        },
        _initMethod:function(){
        },
        _initEvent:function(){
            vc.on('choosePurchaseApply','openChoosePurchaseApplyModel',function(_param){
                $('#choosePurchaseApplyModel').modal('show');
                vc.component._refreshChoosePurchaseApplyInfo();
                vc.component._loadAllPurchaseApplyInfo(1,10,'');
            });
        },
        methods:{
            _loadAllPurchaseApplyInfo:function(_page,_row,_name){
                var param = {
                    params:{
                        page:_page,
                        row:_row,
                        communityId:vc.getCurrentCommunity().communityId,
                        name:_name
                    }
                };
                //发送get请求
               vc.http.get('choosePurchaseApply',
                            'list',
                             param,
                             function(json){
                                var _purchaseApplyInfo = JSON.parse(json);
                                vc.component.choosePurchaseApplyInfo.purchaseApplys = _purchaseApplyInfo.purchaseApplys;
                             },function(){
                                console.log('请求失败处理');
                             }
                           );
            },
            choosePurchaseApply:function(_purchaseApply){
                if(_purchaseApply.hasOwnProperty('name')){
                     _purchaseApply.purchaseApplyName = _purchaseApply.name;
                }
                vc.emit($props.emitChoosePurchaseApply,'choosePurchaseApply',_purchaseApply);
                vc.emit($props.emitLoadData,'listPurchaseApplyData',{
                    purchaseApplyId:_purchaseApply.purchaseApplyId
                });
                $('#choosePurchaseApplyModel').modal('hide');
            },
            queryPurchaseApplys:function(){
                vc.component._loadAllPurchaseApplyInfo(1,10,vc.component.choosePurchaseApplyInfo._currentPurchaseApplyName);
            },
            _refreshChoosePurchaseApplyInfo:function(){
                vc.component.choosePurchaseApplyInfo._currentPurchaseApplyName = "";
            }
        }
    });
})(window.vc);
WebService/src/main/resources/components/purchaseApplyPackage/delete-purchaseApply/deletePurchaseApply.html
New file
@@ -0,0 +1,19 @@
<div class="modal fade" id="deletePurchaseApplyModel" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="exampleModalLabel">请确认您的操作!</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <tr align="center"><th>确定删除采购申请</th></tr>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal" v-on:click="closeDeletePurchaseApplyModel()">点错了</button>
                <button type="button" class="btn btn-primary" v-on:click="deletePurchaseApply()">确认删除</button>
            </div>
        </div>
    </div>
</div>
WebService/src/main/resources/components/purchaseApplyPackage/delete-purchaseApply/deletePurchaseApply.js
New file
@@ -0,0 +1,52 @@
(function(vc,vm){
    vc.extends({
        data:{
            deletePurchaseApplyInfo:{
            }
        },
         _initMethod:function(){
         },
         _initEvent:function(){
             vc.on('deletePurchaseApply','openDeletePurchaseApplyModal',function(_params){
                vc.component.deletePurchaseApplyInfo = _params;
                $('#deletePurchaseApplyModel').modal('show');
            });
        },
        methods:{
            deletePurchaseApply:function(){
                vc.component.deletePurchaseApplyInfo.communityId=vc.getCurrentCommunity().communityId;
                vc.http.post(
                    'deletePurchaseApply',
                    'delete',
                    JSON.stringify(vc.component.deletePurchaseApplyInfo),
                    {
                        emulateJSON:true
                     },
                     function(json,res){
                        //vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
                        if(res.status == 200){
                            //关闭model
                            $('#deletePurchaseApplyModel').modal('hide');
                            vc.emit('purchaseApplyManage','listPurchaseApply',{});
                            return ;
                        }
                        vc.message(json);
                     },
                     function(errInfo,error){
                        console.log('请求失败处理');
                        vc.message(json);
                     });
            },
            closeDeletePurchaseApplyModel:function(){
                $('#deletePurchaseApplyModel').modal('hide');
            }
        }
    });
})(window.vc,window.vc.component);
WebService/src/main/resources/components/purchaseApplyPackage/edit-purchaseApply/editPurchaseApply.html
New file
@@ -0,0 +1,29 @@
<div id = "editPurchaseApplyModel" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true" >
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-body">
                <h3 class="m-t-none m-b ">修改采购申请</h3>
                <div class="ibox-content">
                    <div>
                        <div>
                            <div class="form-group row">
         <label class="col-sm-2 col-form-label">订单状态</label>
         <div class="col-sm-10">
<select class="custom-select" v-model="editPurchaseApplyInfo.state">
         <option selected  disabled value="">必填,请选择订单状态</option>
         <option  value="1001">面积*单价+附加费</option>
<option  value="2002">固定费用</option>
  </select>         </div>
</div>
                            <div class="ibox-content">
                                <button class="btn btn-primary float-right" type="button" v-on:click="editPurchaseApply()" ><i class="fa fa-check"></i>&nbsp;保存</button>
                                <button type="button" class="btn btn-warning float-right" style="margin-right:20px;" data-dismiss="modal">取消</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
WebService/src/main/resources/components/purchaseApplyPackage/edit-purchaseApply/editPurchaseApply.js
New file
@@ -0,0 +1,87 @@
(function(vc,vm){
    vc.extends({
        data:{
            editPurchaseApplyInfo:{
                applyOrderId:'',
state:'',
            }
        },
         _initMethod:function(){
         },
         _initEvent:function(){
             vc.on('editPurchaseApply','openEditPurchaseApplyModal',function(_params){
                vc.component.refreshEditPurchaseApplyInfo();
                $('#editPurchaseApplyModel').modal('show');
                vc.copyObject(_params, vc.component.editPurchaseApplyInfo );
                vc.component.editPurchaseApplyInfo.communityId = vc.getCurrentCommunity().communityId;
            });
        },
        methods:{
            editPurchaseApplyValidate:function(){
                        return vc.validate.validate({
                            editPurchaseApplyInfo:vc.component.editPurchaseApplyInfo
                        },{
                            'editPurchaseApplyInfo.state':[
{
                            limit:"required",
                            param:"",
                            errInfo:"订单状态不能为空"
                        },
 {
                            limit:"num",
                            param:"",
                            errInfo:"计算公式格式错误"
                        },
                    ],
'editPurchaseApplyInfo.applyOrderId':[
{
                            limit:"required",
                            param:"",
                            errInfo:"订单号不能为空"
                        }]
                        });
             },
            editPurchaseApply:function(){
                if(!vc.component.editPurchaseApplyValidate()){
                    vc.toast(vc.validate.errInfo);
                    return ;
                }
                vc.http.post(
                    'editPurchaseApply',
                    'update',
                    JSON.stringify(vc.component.editPurchaseApplyInfo),
                    {
                        emulateJSON:true
                     },
                     function(json,res){
                        //vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
                        if(res.status == 200){
                            //关闭model
                            $('#editPurchaseApplyModel').modal('hide');
                             vc.emit('purchaseApplyManage','listPurchaseApply',{});
                            return ;
                        }
                        vc.message(json);
                     },
                     function(errInfo,error){
                        console.log('请求失败处理');
                        vc.message(errInfo);
                     });
            },
            refreshEditPurchaseApplyInfo:function(){
                vc.component.editPurchaseApplyInfo= {
                  applyOrderId:'',
state:'',
                }
            }
        }
    });
})(window.vc,window.vc.component);
WebService/src/main/resources/components/purchaseApplyPackage/purchaseApply-manage/purchaseApplyManage.html
New file
@@ -0,0 +1,113 @@
<div id="component" class="wrapper wrapper-content animated fadeInRight ecommerce">
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox ">
                <div class="ibox-title">
                    <h5>查询条件</h5>
                    <div class="ibox-tools" style="top:10px;">
                    </div>
                </div>
                <div class="ibox-content">
                    <div class="row">
                        <div class="col-sm-4">
                            <select class="custom-select" v-model="purchaseApplyManageInfo.conditions.state">
                                <option selected value="">请选择订单状态</option>
                                <option value="1003006">未审核</option>
                                <option value="2006012">已审核</option>
                            </select></div>
                        <div class="col-sm-4">
                            <div class="form-group">
                                <input type="text" placeholder="请输入订单号"
                                       v-model="purchaseApplyManageInfo.conditions.applyOrderId" class=" form-control">
                            </div>
                        </div>
                        <div class="col-sm-1">
                            <button type="button" class="btn btn-primary btn-sm"
                                    v-on:click="_queryInspectionPlanMethod()">
                                <i class="glyphicon glyphicon-search"></i> 查询
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox">
                <div class="ibox-title">
                    <h5>采购申请信息</h5>
                    <div class="ibox-tools" style="top:10px;">
                        <button type="button" class="btn btn-primary btn-sm" v-on:click="_openAddPurchaseApplyModal()">
                            <i class="glyphicon glyphicon-plus"></i>
                            添加采购申请
                        </button>
                    </div>
                </div>
                <div class="ibox-content">
                    <table class="footable table table-stripped toggle-arrow-tiny"
                           data-page-size="15"
                    >
                        <thead>
                        <tr>
                            <th class="text-center">审批状态</th>
                            <th class="text-center">使用人</th>
                            <th class="text-center">申请时间</th>
                            <th class="text-center">物品名称</th>
                            <th class="text-center">总计价格</th>
                            <th class="text-center">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr v-for="purchaseApply in purchaseApplyManageInfo.purchaseApplys">
                            <td class="text-center">{{purchaseApply.state}}</td>
                            <td class="text-center">{{purchaseApply.userName}}</td>
                            <td class="text-center">{{purchaseApply.createTime}}</td>
                            <td class="text-center">{{purchaseApply.resourceNames}}</td>
                            <td class="text-center">{{purchaseApply.totalPrice}}</td>
                            <td class="text-center">
                                <div class="btn-group">
                                    <button class="btn-white btn btn-xs"
                                            v-on:click="_openEditPurchaseApplyModel(purchaseApply)">查看
                                    </button>
                                </div>
                                <div class="btn-group">
                                    <button class="btn-white btn btn-xs"
                                            v-on:click="_openEditPurchaseApplyModel(purchaseApply)">修改
                                    </button>
                                </div>
                                <div class="btn-group">
                                    <button class="btn-white btn btn-xs"
                                            v-on:click="_openDeletePurchaseApplyModel(purchaseApply)">删除
                                    </button>
                                </div>
                            </td>
                        </tr>
                        </tbody>
                        <tfoot>
                        <tr>
                            <td colspan="7">
                                <ul class="pagination float-right"></ul>
                            </td>
                        </tr>
                        </tfoot>
                    </table>
                    <!-- 分页 -->
                    <vc:create name="pagination"></vc:create>
                </div>
            </div>
        </div>
    </div>
    <vc:create name="addPurchaseApply"
               callBackListener=""
               callBackFunction=""
    ></vc:create>
    <vc:create name="editPurchaseApply"></vc:create>
    <vc:create name="deletePurchaseApply"></vc:create>
</div>
WebService/src/main/resources/components/purchaseApplyPackage/purchaseApply-manage/purchaseApplyManage.js
New file
@@ -0,0 +1,85 @@
/**
    入驻小区
**/
(function(vc){
    var DEFAULT_PAGE = 1;
    var DEFAULT_ROWS = 10;
    vc.extends({
        data:{
            purchaseApplyManageInfo:{
                purchaseApplys:[],
                total:0,
                records:1,
                moreCondition:false,
                applyOrderId:'',
                conditions:{
                    state:'',
applyOrderId:'',
                }
            }
        },
        _initMethod:function(){
            vc.component._listPurchaseApplys(DEFAULT_PAGE, DEFAULT_ROWS);
        },
        _initEvent:function(){
            vc.on('purchaseApplyManage','listPurchaseApply',function(_param){
                  vc.component._listPurchaseApplys(DEFAULT_PAGE, DEFAULT_ROWS);
            });
             vc.on('pagination','page_event',function(_currentPage){
                vc.component._listPurchaseApplys(_currentPage,DEFAULT_ROWS);
            });
        },
        methods:{
            _listPurchaseApplys:function(_page, _rows){
                vc.component.purchaseApplyManageInfo.conditions.page = _page;
                vc.component.purchaseApplyManageInfo.conditions.row = _rows;
                var param = {
                    params:vc.component.purchaseApplyManageInfo.conditions
               };
               //发送get请求
               vc.http.get('purchaseApplyManage',
                            'list',
                             param,
                             function(json,res){
                                var _purchaseApplyManageInfo=JSON.parse(json);
                                vc.component.purchaseApplyManageInfo.total = _purchaseApplyManageInfo.total;
                                vc.component.purchaseApplyManageInfo.records = _purchaseApplyManageInfo.records;
                                vc.component.purchaseApplyManageInfo.purchaseApplys = _purchaseApplyManageInfo.purchaseApplys;
                                vc.emit('pagination','init',{
                                     total:vc.component.purchaseApplyManageInfo.records,
                                     currentPage:_page
                                 });
                             },function(errInfo,error){
                                console.log('请求失败处理');
                             }
                           );
            },
            _openAddPurchaseApplyModal:function(){
                vc.emit('addPurchaseApply','openAddPurchaseApplyModal',{});
            },
            _openEditPurchaseApplyModel:function(_purchaseApply){
                vc.emit('editPurchaseApply','openEditPurchaseApplyModal',_purchaseApply);
            },
            _openDeletePurchaseApplyModel:function(_purchaseApply){
                vc.emit('deletePurchaseApply','openDeletePurchaseApplyModal',_purchaseApply);
            },
            _queryPurchaseApplyMethod:function(){
                vc.component._listPurchaseApplys(DEFAULT_PAGE, DEFAULT_ROWS);
            },
            _moreCondition:function(){
                if(vc.component.purchaseApplyManageInfo.moreCondition){
                    vc.component.purchaseApplyManageInfo.moreCondition = false;
                }else{
                    vc.component.purchaseApplyManageInfo.moreCondition = true;
                }
            }
        }
    });
})(window.vc);
WebService/src/main/resources/components/purchaseApplyPackage/view-purchaseApply-info/viewPurchaseApplyInfo.html
New file
@@ -0,0 +1,38 @@
<div class="row">
    <div class="col-lg-12">
        <div class="ibox ">
            <div class="ibox-title">
                <h5>采购申请信息</h5>
                <div class="ibox-tools" style="top:10px;">
                    <button type="button" v-if="viewPurchaseApplyInfo.index != 2" class="btn btn-primary btn-sm" style="margin-right:10px;"  v-on:click="_openSelectPurchaseApplyInfoModel()">
                        <i class="glyphicon glyphicon-search"></i> 选择采购申请</button>
                    <button type="button" v-if="viewPurchaseApplyInfo.index != 2" class="btn btn-primary btn-sm" v-on:click="_openAddPurchaseApplyInfoModel()">
                        <i class="glyphicon glyphicon-plus"></i> 添加采购申请</button>
                </div>
            </div>
            <div class="ibox-content">
                <div class="row">
<div class="col-sm-4">
                        <div class="form-group">
                            <label class="col-form-label" >订单状态:</label>
                            <label class="">{{viewPurchaseApplyInfo.state}}</label>
                        </div>
</div>
</div>
            </div>
        </div>
    </div>
    <vc:create name="addPurchaseApply"
               callBackListener="viewPurchaseApplyInfo"
               callBackFunction="choosePurchaseApply"
    ></vc:create>
    <vc:create name="choosePurchaseApply"
               emitChoosePurchaseApply="viewPurchaseApplyInfo"
               emitLoadData="viewPurchaseApplyInfo"
    ></vc:create>
</div>
WebService/src/main/resources/components/purchaseApplyPackage/view-purchaseApply-info/viewPurchaseApplyInfo.js
New file
@@ -0,0 +1,48 @@
/**
    采购申请 组件
**/
(function(vc){
    vc.extends({
        propTypes: {
           callBackListener:vc.propTypes.string, //父组件名称
           callBackFunction:vc.propTypes.string //父组件监听方法
        },
        data:{
            viewPurchaseApplyInfo:{
                index:0,
                flowComponent:'viewPurchaseApplyInfo',
                state:'',
            }
        },
        _initMethod:function(){
            //根据请求参数查询 查询 业主信息
            vc.component._loadPurchaseApplyInfoData();
        },
        _initEvent:function(){
            vc.on('viewPurchaseApplyInfo','choosePurchaseApply',function(_app){
                vc.copyObject(_app, vc.component.viewPurchaseApplyInfo);
                vc.emit($props.callBackListener,$props.callBackFunction,vc.component.viewPurchaseApplyInfo);
            });
            vc.on('viewPurchaseApplyInfo', 'onIndex', function(_index){
                vc.component.viewPurchaseApplyInfo.index = _index;
            });
        },
        methods:{
            _openSelectPurchaseApplyInfoModel(){
                vc.emit('choosePurchaseApply','openChoosePurchaseApplyModel',{});
            },
            _openAddPurchaseApplyInfoModel(){
                vc.emit('addPurchaseApply','openAddPurchaseApplyModal',{});
            },
            _loadPurchaseApplyInfoData:function(){
            }
        }
    });
})(window.vc);
WebService/src/main/resources/components/roomPackage/sell-room-select-room/sellRoomSelectRoom.html
@@ -76,9 +76,10 @@
            </div>
        </div>
    </div>
    <vc:create name="searchRoom"
    <!-- 这里取消 -->
   <!-- <vc:create name="searchRoom"
               emitChooseRoom="sellRoomSelectRoom"
               emitLoadData="sellRoomOther"
               roomFlag="1"
    ></vc:create>
    ></vc:create>-->
</div>
WebService/src/main/resources/components/roomPackage/sell-room/sellRoom.html
@@ -7,6 +7,11 @@
               callBackListener="sellRoom"
               callBackFunction="notify"
    ></vc:create>
    <vc:create name="searchRoom"
               emitChooseRoom="sellRoomSelectRoom"
               emitLoadData="sellRoomOther"
               roomFlag="2"
    ></vc:create>
    <vc:create name="sellRoomOther"
    ></vc:create>
WebService/src/main/resources/views/purchaseApplyFlow.html
New file
@@ -0,0 +1,36 @@
<!DOCTYPE html>
<html lang="en"
      xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org"
      xmlns:vc="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8"/>
    <title>采购申请初始化|java110</title>
    <vc:create name="commonTop"></vc:create>
</head>
<body>
<vc:create name="bodyTop"></vc:create>
<div id="wrapper">
    <vc:create name="menu"></vc:create>
    <div id="page-wrapper" class="gray-bg dashbard-1">
        <div class="row border-bottom">
            <vc:create name="nav"></vc:create>
        </div>
        <div class="wrapper wrapper-content" style="padding-bottom: 0px;">
            <vc:create name="breadcrumb"></vc:create>
        </div>
        <!-- id="component" -->
        <div class="wrapper wrapper-content animated fadeInRight">
            <vc:create name="purchaseApplyManage"></vc:create>
        </div>
        <vc:create name="copyright"></vc:create>
    </div>
</div>
<vc:create name="commonBottom"></vc:create>
</body>
</html>
docs/document/services/purchaseApply/DeletePurchaseApplyInfo.md
New file
@@ -0,0 +1,114 @@
**1\. 删除采购申请**
###### 接口功能
> API服务做删除采购申请时调用该接口
###### URL
> [http://purchaseApply-service/purchaseApplyApi/service](http://purchaseApply-service/purchaseApplyApi/service)
###### 支持格式
> JSON
###### HTTP请求方式
> POST
###### 协议接口
|父元素名称|参数名称|约束|类型|长度|描述|取值说明|
| :-: | :-: | :-: | :-: | :-: | :-: | :-:|
|-|orders|1|Object|-|订单节点|-|
|-|business|1|Array|-|业务节点|-|
###### orders
|父元素名称|参数名称|约束|类型|长度|描述|取值说明|
| :-: | :-: | :-: | :-: | :-: | :-: | :-: |
|-|orders|1|Object|-|订单节点|-|
|orders|appId|1|String|10|系统ID|由中心服务提供|
|orders|transactionId|1|String|30|交互流水|appId+'00'+YYYYMMDD+10位序列|
|orders|userId|1|String|30|用户ID|已有用户ID|
|orders|orderTypeCd|1|String|4|订单类型|查看订单类型说明|
|orders|requestTime|1|String|14|请求时间|YYYYMMDDhhmmss|
|orders|remark|1|String|200|备注|备注|
|orders|sign|?|String|64|签名|查看加密说明|
|orders|attrs|?|Array|-|订单属性|-|
|attrs|specCd|1|String|12|规格编码|由中心服务提供|
|attrs|value|1|String|50|属性值|-|
|orders|response|1|Object|-|返回结果节点|-|
|response|code|1|String|4|返回状态|查看状态说明|
|response|message|1|String|200|返回状态描述|-|
###### business
|父元素名称|参数名称|约束|类型|长度|描述|取值说明|
| :-: | :-: | :-: | :-: | :-: | :-: | :-: |
|-|business|?|Array|-|业务节点|-|
|business|businessTypeCd|1|String|12|业务类型编码|500100030002|
|business|datas|1|Object|-|数据节点|不同的服务下的节点不一样|
|datas|businessPurchaseApplyInfo|1|Object|-|小区成员|小区成员|
|businessPurchaseApplyInfo|applyOrderId|1|String|30|-|-|
###### 返回协议
当http返回状态不为200 时请求处理失败 body内容为失败的原因
当http返回状态为200时请求处理成功,body内容为返回内容,
###### 举例
> 地址:[http://purchaseApply-service/purchaseApplyApi/service](http://purchaseApply-service/purchaseApplyApi/service)
``` javascript
请求头信息:
Content-Type:application/json
请求报文:
{
  "orders": {
    "appId": "外系统ID,分配得到",
    "transactionId": "100000000020180409224736000001",
    "userId": "用户ID",
    "orderTypeCd": "订单类型,查询,受理",
    "requestTime": "20180409224736",
    "remark": "备注",
    "sign": "这个服务是否要求MD5签名",
    "businessType":"I",
    "attrs": [{
      "specCd": "配置的字段ID",
      "value": "具体值"
    }]
  },
  "business": {
    "businessTypeCd": "210100050001",
    "bId":"1234567892",
    "remark": "备注",
    "datas": {
      "businessPurchaseApplyInfo": {
                "applyOrderId":"填写存在的值"
      }
    },
    "attrs": [{
      "specCd": "配置的字段ID",
      "value": "具体值"
    }]
  }
}
返回报文:
 {
    "orderTypeCd": "D",
    "response": {
        "code": "0000",
        "message": "成功"
    },
    "responseTime": "20190418102004",
    "bId": "202019041810750003",
    "businessType": "B",
    "transactionId": "3a5a411ec65a4c3f895935638aa1d2bc",
    "dataFlowId": "44fde86d39ce46f4b4aab5f6b14f3947"
}
```
docs/document/services/purchaseApply/SavePurchaseApplyInfo.md
New file
@@ -0,0 +1,128 @@
**1\. 保存采购申请**
###### 接口功能
> API服务做保存采购申请时调用该接口
###### URL
> [http://purchaseApply-service/purchaseApplyApi/service](http://purchaseApply-service/purchaseApplyApi/service)
###### 支持格式
> JSON
###### HTTP请求方式
> POST
###### 协议接口
|父元素名称|参数名称|约束|类型|长度|描述|取值说明|
| :-: | :-: | :-: | :-: | :-: | :-: | :-:|
|-|orders|1|Object|-|订单节点|-|
|-|business|1|Array|-|业务节点|-|
###### orders
|父元素名称|参数名称|约束|类型|长度|描述|取值说明|
| :-: | :-: | :-: | :-: | :-: | :-: | :-: |
|-|orders|1|Object|-|订单节点|-|
|orders|appId|1|String|10|系统ID|由中心服务提供|
|orders|transactionId|1|String|30|交互流水|appId+'00'+YYYYMMDD+10位序列|
|orders|userId|1|String|30|用户ID|已有用户ID|
|orders|orderTypeCd|1|String|4|订单类型|查看订单类型说明|
|orders|requestTime|1|String|14|请求时间|YYYYMMDDhhmmss|
|orders|remark|1|String|200|备注|备注|
|orders|sign|?|String|64|签名|查看加密说明|
|orders|attrs|?|Array|-|订单属性|-|
|attrs|specCd|1|String|12|规格编码|由中心服务提供|
|attrs|value|1|String|50|属性值|-|
|orders|response|1|Object|-|返回结果节点|-|
|response|code|1|String|4|返回状态|查看状态说明|
|response|message|1|String|200|返回状态描述|-|
###### business
|父元素名称|参数名称|约束|类型|长度|描述|取值说明|
| :-: | :-: | :-: | :-: | :-: | :-: | :-: |
|-|business|?|Array|-|业务节点|-|
|business|businessTypeCd|1|String|12|业务类型编码|500100030002|
|business|datas|1|Object|-|数据节点|不同的服务下的节点不一样|
|datas|businessPurchaseApplyInfo|1|Object|-|小区成员|小区成员|
|businessPurchaseApplyInfo|applyDetailId|1|String|30|-|-|
|businessPurchaseApplyInfo|resOrderType|1|String|30|-|-|
|businessPurchaseApplyInfo|description|1|String|30|-|-|
|businessPurchaseApplyInfo|applyOrderId|1|String|30|-|-|
|businessPurchaseApplyInfo|state|1|String|30|-|-|
|businessPurchaseApplyInfo|storeId|1|String|30|-|-|
|businessPurchaseApplyInfo|entryPerson|1|String|30|-|-|
|businessPurchaseApplyInfo|userId|1|String|30|-|-|
###### 返回协议
当http返回状态不为200 时请求处理失败 body内容为失败的原因
当http返回状态为200时请求处理成功,body内容为返回内容,
###### 举例
> 地址:[http://purchaseApply-service/purchaseApplyApi/service](http://purchaseApply-service/purchaseApplyApi/service)
``` javascript
请求头信息:
Content-Type:application/json
请求报文:
{
  "orders": {
    "appId": "外系统ID,分配得到",
    "transactionId": "100000000020180409224736000001",
    "userId": "用户ID",
    "orderTypeCd": "订单类型,查询,受理",
    "requestTime": "20180409224736",
    "remark": "备注",
    "sign": "这个服务是否要求MD5签名",
    "businessType":"I",
    "attrs": [{
      "specCd": "配置的字段ID",
      "value": "具体值"
    }]
  },
  "business": {
    "businessTypeCd": "210100030001",
    "bId":"1234567892",
    "remark": "备注",
    "datas": {
      "businessPurchaseApplyInfo": {
                "applyDetailId":"填写具体值",
        "resOrderType":"填写具体值",
        "description":"填写具体值",
        "applyOrderId":"填写具体值",
        "state":"填写具体值",
        "storeId":"填写具体值",
        "entryPerson":"填写具体值",
        "userId":"填写具体值"
      }
    },
    "attrs": [{
      "specCd": "配置的字段ID",
      "value": "具体值"
    }]
  }
}
返回报文:
 {
    "orderTypeCd": "D",
    "response": {
        "code": "0000",
        "message": "成功"
    },
    "responseTime": "20190418102004",
    "bId": "202019041810750003",
    "businessType": "B",
    "transactionId": "3a5a411ec65a4c3f895935638aa1d2bc",
    "dataFlowId": "44fde86d39ce46f4b4aab5f6b14f3947"
}
```
docs/document/services/purchaseApply/UpdatePurchaseApplyInfo.md
New file
@@ -0,0 +1,128 @@
**1\. 修改采购申请**
###### 接口功能
> API服务做修改采购申请时调用该接口
###### URL
> [http://purchaseApply-service/purchaseApplyApi/service](http://purchaseApply-service/purchaseApplyApi/service)
###### 支持格式
> JSON
###### HTTP请求方式
> POST
###### 协议接口
|父元素名称|参数名称|约束|类型|长度|描述|取值说明|
| :-: | :-: | :-: | :-: | :-: | :-: | :-:|
|-|orders|1|Object|-|订单节点|-|
|-|business|1|Array|-|业务节点|-|
###### orders
|父元素名称|参数名称|约束|类型|长度|描述|取值说明|
| :-: | :-: | :-: | :-: | :-: | :-: | :-: |
|-|orders|1|Object|-|订单节点|-|
|orders|appId|1|String|10|系统ID|由中心服务提供|
|orders|transactionId|1|String|30|交互流水|appId+'00'+YYYYMMDD+10位序列|
|orders|userId|1|String|30|用户ID|已有用户ID|
|orders|orderTypeCd|1|String|4|订单类型|查看订单类型说明|
|orders|requestTime|1|String|14|请求时间|YYYYMMDDhhmmss|
|orders|remark|1|String|200|备注|备注|
|orders|sign|?|String|64|签名|查看加密说明|
|orders|attrs|?|Array|-|订单属性|-|
|attrs|specCd|1|String|12|规格编码|由中心服务提供|
|attrs|value|1|String|50|属性值|-|
|orders|response|1|Object|-|返回结果节点|-|
|response|code|1|String|4|返回状态|查看状态说明|
|response|message|1|String|200|返回状态描述|-|
###### business
|父元素名称|参数名称|约束|类型|长度|描述|取值说明|
| :-: | :-: | :-: | :-: | :-: | :-: | :-: |
|-|business|?|Array|-|业务节点|-|
|business|businessTypeCd|1|String|12|业务类型编码|500100030002|
|business|datas|1|Object|-|数据节点|不同的服务下的节点不一样|
|datas|businessPurchaseApplyInfo|1|Object|-|小区成员|小区成员|
|businessPurchaseApplyInfo|applyDetailId|1|String|30|-|-|
|businessPurchaseApplyInfo|resOrderType|1|String|30|-|-|
|businessPurchaseApplyInfo|description|1|String|30|-|-|
|businessPurchaseApplyInfo|applyOrderId|1|String|30|-|-|
|businessPurchaseApplyInfo|state|1|String|30|-|-|
|businessPurchaseApplyInfo|storeId|1|String|30|-|-|
|businessPurchaseApplyInfo|entryPerson|1|String|30|-|-|
|businessPurchaseApplyInfo|userId|1|String|30|-|-|
###### 返回协议
当http返回状态不为200 时请求处理失败 body内容为失败的原因
当http返回状态为200时请求处理成功,body内容为返回内容,
###### 举例
> 地址:[http://purchaseApply-service/purchaseApplyApi/service](http://purchaseApply-service/purchaseApplyApi/service)
``` javascript
请求头信息:
Content-Type:application/json
请求报文:
{
  "orders": {
    "appId": "外系统ID,分配得到",
    "transactionId": "100000000020180409224736000001",
    "userId": "用户ID",
    "orderTypeCd": "订单类型,查询,受理",
    "requestTime": "20180409224736",
    "remark": "备注",
    "sign": "这个服务是否要求MD5签名",
    "businessType":"I",
    "attrs": [{
      "specCd": "配置的字段ID",
      "value": "具体值"
    }]
  },
  "business": {
    "businessTypeCd": "210100040001",
    "bId":"1234567892",
    "remark": "备注",
    "datas": {
      "businessPurchaseApplyInfo": {
                "applyDetailId":"填写具体值",
        "resOrderType":"填写具体值",
        "description":"填写具体值",
        "applyOrderId":"填写具体值",
        "state":"填写具体值",
        "storeId":"填写具体值",
        "entryPerson":"填写具体值",
        "userId":"填写具体值"
      }
    },
    "attrs": [{
      "specCd": "配置的字段ID",
      "value": "具体值"
    }]
  }
}
返回报文:
 {
    "orderTypeCd": "D",
    "response": {
        "code": "0000",
        "message": "成功"
    },
    "responseTime": "20190418102004",
    "bId": "202019041810750003",
    "businessType": "B",
    "transactionId": "3a5a411ec65a4c3f895935638aa1d2bc",
    "dataFlowId": "44fde86d39ce46f4b4aab5f6b14f3947"
}
```
java110-bean/src/main/java/com/java110/dto/purchaseApply/PurchaseApplyDto.java
New file
@@ -0,0 +1,113 @@
package com.java110.dto.purchaseApply;
import com.java110.dto.PageDto;
import java.io.Serializable;
import java.util.Date;
/**
 * @ClassName FloorDto
 * @Description 采购申请数据层封装
 * @Author wuxw
 * @Date 2019/4/24 8:52
 * @Version 1.0
 * add by wuxw 2019/4/24
 **/
public class PurchaseApplyDto extends PageDto implements Serializable {
    private String applyDetailId;
    private String resOrderType;
    private String description;
    private String applyOrderId;
    private String state;
    private String storeId;
    private String entryPerson;
    private String userId;
    private Date createTime;
    private String statusCd = "0";
    public String getApplyDetailId() {
        return applyDetailId;
    }
    public void setApplyDetailId(String applyDetailId) {
        this.applyDetailId = applyDetailId;
    }
    public String getResOrderType() {
        return resOrderType;
    }
    public void setResOrderType(String resOrderType) {
        this.resOrderType = resOrderType;
    }
    public String getDescription() {
        return description;
    }
    public void setDescription(String description) {
        this.description = description;
    }
    public String getApplyOrderId() {
        return applyOrderId;
    }
    public void setApplyOrderId(String applyOrderId) {
        this.applyOrderId = applyOrderId;
    }
    public String getState() {
        return state;
    }
    public void setState(String state) {
        this.state = state;
    }
    public String getStoreId() {
        return storeId;
    }
    public void setStoreId(String storeId) {
        this.storeId = storeId;
    }
    public String getEntryPerson() {
        return entryPerson;
    }
    public void setEntryPerson(String entryPerson) {
        this.entryPerson = entryPerson;
    }
    public String getUserId() {
        return userId;
    }
    public void setUserId(String userId) {
        this.userId = userId;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public String getStatusCd() {
        return statusCd;
    }
    public void setStatusCd(String statusCd) {
        this.statusCd = statusCd;
    }
}
java110-bean/src/main/java/com/java110/vo/api/purchaseApply/ApiPurchaseApplyDataVo.java
New file
@@ -0,0 +1,66 @@
package com.java110.vo.api.purchaseApply;
import java.io.Serializable;
import java.util.Date;
public class ApiPurchaseApplyDataVo implements Serializable {
    private String applyOrderId;
    private String state;
    private String userName;
    //申请时间
    private Date createTime;
    //物品名称是
    private String resourceNames;
    //累计价格
    private String totalPrice;
    public String getApplyOrderId() {
        return applyOrderId;
    }
    public void setApplyOrderId(String applyOrderId) {
        this.applyOrderId = applyOrderId;
    }
    public String getState() {
        return state;
    }
    public void setState(String state) {
        this.state = state;
    }
    public String getUserName() {
        return userName;
    }
    public void setUserName(String userName) {
        this.userName = userName;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public String getResourceNames() {
        return resourceNames;
    }
    public void setResourceNames(String resourceNames) {
        this.resourceNames = resourceNames;
    }
    public String getTotalPrice() {
        return totalPrice;
    }
    public void setTotalPrice(String totalPrice) {
        this.totalPrice = totalPrice;
    }
}
java110-bean/src/main/java/com/java110/vo/api/purchaseApply/ApiPurchaseApplyVo.java
New file
@@ -0,0 +1,19 @@
package com.java110.vo.api.purchaseApply;
import com.java110.vo.MorePageVo;
import java.io.Serializable;
import java.util.List;
public class ApiPurchaseApplyVo extends MorePageVo implements Serializable {
    List<ApiPurchaseApplyDataVo> purchaseApplys;
    public List<ApiPurchaseApplyDataVo> getPurchaseApplys() {
        return purchaseApplys;
    }
    public void setPurchaseApplys(List<ApiPurchaseApplyDataVo> purchaseApplys) {
        this.purchaseApplys = purchaseApplys;
    }
}
java110-bean/src/main/java/com/java110/vo/api/staff/ApiStaffDataVo.java
@@ -7,6 +7,7 @@
    private String userId;
    private String userName;
    private String initials;
    private String name;
    private String tel;
@@ -134,4 +135,12 @@
    public void setName(String name) {
        this.name = name;
    }
    public String getInitials() {
        return initials;
    }
    public void setInitials(String initials) {
        this.initials = initials;
    }
}
java110-code-generator/src/main/java/com/java110/PurchaseApplyGeneratorApplication.java
New file
@@ -0,0 +1,84 @@
package com.java110;
import com.java110.code.*;
import java.util.HashMap;
import java.util.Map;
/**
 * Hello world!
 */
public class PurchaseApplyGeneratorApplication {
    protected PurchaseApplyGeneratorApplication() {
        // prevents calls from subclass
        throw new UnsupportedOperationException();
    }
    /**
     * 代码生成器 入口方法
     *  此处生成的mapper文件包含过程表和实例表的sql,所以要求两张表的特殊字段也要写上
     *   BusinessTypeCd
     * @param args 参数
     */
    public static void main(String[] args) {
        Data data = new Data();
        data.setId("applyOrderId");
        data.setName("purchaseApply");
        data.setDesc("采购申请");
        data.setShareParam("storeId");
        data.setShareColumn("store_id");
        data.setNewBusinessTypeCd("BUSINESS_TYPE_SAVE_PURCHASE_APPLY");
        data.setUpdateBusinessTypeCd("BUSINESS_TYPE_UPDATE_PURCHASE_APPLY");
        data.setDeleteBusinessTypeCd("BUSINESS_TYPE_DELETE_PURCHASE_APPLY");
        data.setNewBusinessTypeCdValue("210100030001");
        data.setUpdateBusinessTypeCdValue("210100040001");
        data.setDeleteBusinessTypeCdValue("210100050001");
        data.setBusinessTableName("business_purchase_apply");
        data.setTableName("purchase_apply");
        Map<String, String> param = new HashMap<String, String>();
        param.put("applyOrderId", "apply_order_id");       //map的key为你自定义的字段名就是驼峰命名法的那个,value为数据库表的字段名
        param.put("storeId", "store_id");
        param.put("userId", "user_id");
        param.put("entryPerson", "entry_person");
        param.put("applyDetailId", "apply_detail_id");
        param.put("description", "description");
        param.put("resOrderType", "res_order_type");
        param.put("state", "state");
        param.put("statusCd", "status_cd");
        param.put("operate", "operate");
        param.put("bId", "b_id");
        data.setParams(param);
        GeneratorSaveInfoListener generatorSaveInfoListener = new GeneratorSaveInfoListener();
        generatorSaveInfoListener.generator(data);
        GeneratorAbstractBussiness generatorAbstractBussiness = new GeneratorAbstractBussiness();
        generatorAbstractBussiness.generator(data);
        GeneratorIServiceDaoListener generatorIServiceDaoListener = new GeneratorIServiceDaoListener();
        generatorIServiceDaoListener.generator(data);
        GeneratorServiceDaoImplListener generatorServiceDaoImplListener = new GeneratorServiceDaoImplListener();
        generatorServiceDaoImplListener.generator(data);
        GeneratorServiceDaoImplMapperListener generatorServiceDaoImplMapperListener = null;
        generatorServiceDaoImplMapperListener = new GeneratorServiceDaoImplMapperListener();
        generatorServiceDaoImplMapperListener.generator(data);
        GeneratorUpdateInfoListener generatorUpdateInfoListener = new GeneratorUpdateInfoListener();
        generatorUpdateInfoListener.generator(data);
        GeneratorDeleteInfoListener generatorDeleteInfoListener = new GeneratorDeleteInfoListener();
        generatorDeleteInfoListener.generator(data);
        GeneratorInnerServiceSMOImpl generatorInnerServiceSMOImpl = new GeneratorInnerServiceSMOImpl();
        generatorInnerServiceSMOImpl.generator(data);
        GeneratorDtoBean generatorDtoBean = new GeneratorDtoBean();
        generatorDtoBean.generator(data);
        GeneratorIInnerServiceSMO generatorIInnerServiceSMO = new GeneratorIInnerServiceSMO();
        generatorIInnerServiceSMO.generator(data);
    }
}
java110-core/src/main/java/com/java110/core/factory/GenerateCodeFactory.java
@@ -118,6 +118,7 @@
    public static final String CODE_PREFIX_inspectionId = "13";
    public static final String CODE_PREFIX_inspectionRouteId = "50";
    public static final String CODE_PREFIX_inspectionPlanId = "14";
    public static final String CODE_PREFIX_applyOrderId = "15";
java110-core/src/main/java/com/java110/core/smo/purchaseApply/IPurchaseApplyInnerServiceSMO.java
New file
@@ -0,0 +1,42 @@
package com.java110.core.smo.purchaseApply;
import com.java110.core.feign.FeignConfiguration;
import com.java110.dto.purchaseApply.PurchaseApplyDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import java.util.List;
/**
 * @ClassName IPurchaseApplyInnerServiceSMO
 * @Description 采购申请接口类
 * @Author wuxw
 * @Date 2019/4/24 9:04
 * @Version 1.0
 * add by wuxw 2019/4/24
 **/
@FeignClient(name = "store-service", configuration = {FeignConfiguration.class})
@RequestMapping("/purchaseApplyApi")
public interface IPurchaseApplyInnerServiceSMO {
    /**
     * <p>查询小区楼信息</p>
     *
     *
     * @param purchaseApplyDto 数据对象分享
     * @return PurchaseApplyDto 对象数据
     */
    @RequestMapping(value = "/queryPurchaseApplys", method = RequestMethod.POST)
    List<PurchaseApplyDto> queryPurchaseApplys(@RequestBody PurchaseApplyDto purchaseApplyDto);
    /**
     * 查询<p>小区楼</p>总记录数
     *
     * @param purchaseApplyDto 数据对象分享
     * @return 小区下的小区楼记录数
     */
    @RequestMapping(value = "/queryPurchaseApplysCount", method = RequestMethod.POST)
    int queryPurchaseApplysCount(@RequestBody PurchaseApplyDto purchaseApplyDto);
}
java110-db/db/StoreService/create_purchase_apply.sql
New file
@@ -0,0 +1,41 @@
-- 采购申请表
create table purchase_apply(
    `apply_order_id` varchar(30) NOT NULL COMMENT '订单号',
    `b_id` varchar(30) NOT NULL COMMENT '业务Id',
    `store_id` varchar(30) NOT NULL COMMENT '商户ID',
    `user_id` varchar(30) NOT NULL COMMENT '使用人ID',
    `entry_person` varchar(30) NOT NULL COMMENT '录入人ID',
    `apply_detail_id` varchar(30) NOT NULL COMMENT '领用物资明细表id',
    `description` varchar(200) NOT NULL COMMENT '申请说明',
    `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `res_order_type` varchar(8) not null comment '出库类型 10000 入库 20000 出库 在t_dict表查看',
    `state` varchar(12) NOT NULL COMMENT '申请状态',
    `status_cd` varchar(2) NOT NULL DEFAULT '0' COMMENT '数据状态,详细参考t_dict表,0, 在用 1失效',
    KEY `idx_apply_id` (`order_id`)
);
CREATE TABLE `business_purchase_apply` (
   `apply_order_id` varchar(30) NOT NULL COMMENT '订单号',
    `b_id` varchar(30) NOT NULL COMMENT '业务Id',
    `store_id` varchar(30) NOT NULL COMMENT '商户ID',
    `user_id` varchar(30) NOT NULL COMMENT '使用人ID',
    `entry_person` varchar(30) NOT NULL COMMENT '录入人ID',
    `apply_detail_id` varchar(30) NOT NULL COMMENT '领用物资明细表id',
    `description` varchar(200) NOT NULL COMMENT '申请说明',
    `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `res_order_type` varchar(8) not null comment '出库类型 10000 入库 20000 出库 在t_dict表查看',
    `state` varchar(12) NOT NULL COMMENT '申请状态',
    `status_cd` varchar(2) NOT NULL DEFAULT '0' COMMENT '数据状态,详细参考t_dict表,0, 在用 1失效',
    `operate` varchar(4) NOT NULL COMMENT '数据状态,添加ADD,修改MOD 删除DEL',
);
-- 采购明细表
create table purchase_apply_detail(
    `apply_order_id` varchar(30) not null comment '订单号',
    `res_id` varchar(30) NOT NULL COMMENT '资源ID',
    `quantity` varchar(100) NOT NULL COMMENT '数量',
    `remark` varchar(100) NOT NULL COMMENT '备注',
    KEY `idx_apply_detail_id` (`detail_id`)
);
java110-db/src/main/resources/mapper/store/PurchaseApplyServiceDaoImplMapper.xml
New file
@@ -0,0 +1,217 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="purchaseApplyServiceDaoImpl">
    <!-- 保存采购申请信息 add by wuxw 2018-07-03 -->
       <insert id="saveBusinessPurchaseApplyInfo" parameterType="Map">
           insert into business_purchase_apply(
operate,apply_detail_id,res_order_type,description,apply_order_id,state,store_id,entry_person,b_id,user_id
) values (
#{operate},#{applyDetailId},#{resOrderType},#{description},#{applyOrderId},#{state},#{storeId},#{entryPerson},#{bId},#{userId}
)
       </insert>
       <!-- 查询采购申请信息(Business) add by wuxw 2018-07-03 -->
       <select id="getBusinessPurchaseApplyInfo" parameterType="Map" resultType="Map">
           select  t.operate,t.apply_detail_id,t.apply_detail_id applyDetailId,t.res_order_type,t.res_order_type resOrderType,t.description,t.apply_order_id,t.apply_order_id applyOrderId,t.state,t.store_id,t.store_id storeId,t.entry_person,t.entry_person entryPerson,t.b_id,t.b_id bId,t.user_id,t.user_id userId
from business_purchase_apply t
where 1 =1
<if test="operate !=null and operate != ''">
   and t.operate= #{operate}
</if>
<if test="applyDetailId !=null and applyDetailId != ''">
   and t.apply_detail_id= #{applyDetailId}
</if>
<if test="resOrderType !=null and resOrderType != ''">
   and t.res_order_type= #{resOrderType}
</if>
<if test="description !=null and description != ''">
   and t.description= #{description}
</if>
<if test="applyOrderId !=null and applyOrderId != ''">
   and t.apply_order_id= #{applyOrderId}
</if>
<if test="state !=null and state != ''">
   and t.state= #{state}
</if>
<if test="storeId !=null and storeId != ''">
   and t.store_id= #{storeId}
</if>
<if test="entryPerson !=null and entryPerson != ''">
   and t.entry_person= #{entryPerson}
</if>
<if test="bId !=null and bId != ''">
   and t.b_id= #{bId}
</if>
<if test="userId !=null and userId != ''">
   and t.user_id= #{userId}
</if>
       </select>
    <!-- 保存采购申请信息至 instance表中 add by wuxw 2018-07-03 -->
    <insert id="savePurchaseApplyInfoInstance" parameterType="Map">
        insert into purchase_apply(
apply_detail_id,res_order_type,description,apply_order_id,status_cd,state,store_id,entry_person,b_id,user_id
) select t.apply_detail_id,t.res_order_type,t.description,t.apply_order_id,'0',t.state,t.store_id,t.entry_person,t.b_id,t.user_id from business_purchase_apply t where 1=1
   and t.operate= 'ADD'
<if test="applyDetailId !=null and applyDetailId != ''">
   and t.apply_detail_id= #{applyDetailId}
</if>
<if test="resOrderType !=null and resOrderType != ''">
   and t.res_order_type= #{resOrderType}
</if>
<if test="description !=null and description != ''">
   and t.description= #{description}
</if>
<if test="applyOrderId !=null and applyOrderId != ''">
   and t.apply_order_id= #{applyOrderId}
</if>
<if test="state !=null and state != ''">
   and t.state= #{state}
</if>
<if test="storeId !=null and storeId != ''">
   and t.store_id= #{storeId}
</if>
<if test="entryPerson !=null and entryPerson != ''">
   and t.entry_person= #{entryPerson}
</if>
<if test="bId !=null and bId != ''">
   and t.b_id= #{bId}
</if>
<if test="userId !=null and userId != ''">
   and t.user_id= #{userId}
</if>
    </insert>
    <!-- 查询采购申请信息 add by wuxw 2018-07-03 -->
    <select id="getPurchaseApplyInfo" parameterType="Map" resultType="Map">
        select  t.apply_detail_id,t.apply_detail_id applyDetailId,t.res_order_type,t.res_order_type resOrderType,t.description,t.apply_order_id,t.apply_order_id applyOrderId,t.status_cd,t.status_cd statusCd,t.state,t.store_id,t.store_id storeId,t.entry_person,t.entry_person entryPerson,t.b_id,t.b_id bId,t.user_id,t.user_id userId
from purchase_apply t
where 1 =1
<if test="applyDetailId !=null and applyDetailId != ''">
   and t.apply_detail_id= #{applyDetailId}
</if>
<if test="resOrderType !=null and resOrderType != ''">
   and t.res_order_type= #{resOrderType}
</if>
<if test="description !=null and description != ''">
   and t.description= #{description}
</if>
<if test="applyOrderId !=null and applyOrderId != ''">
   and t.apply_order_id= #{applyOrderId}
</if>
<if test="statusCd !=null and statusCd != ''">
   and t.status_cd= #{statusCd}
</if>
<if test="state !=null and state != ''">
   and t.state= #{state}
</if>
<if test="storeId !=null and storeId != ''">
   and t.store_id= #{storeId}
</if>
<if test="entryPerson !=null and entryPerson != ''">
   and t.entry_person= #{entryPerson}
</if>
<if test="bId !=null and bId != ''">
   and t.b_id= #{bId}
</if>
<if test="userId !=null and userId != ''">
   and t.user_id= #{userId}
</if>
order by t.create_time desc
<if test="page != -1 and page != null ">
   limit #{page}, #{row}
</if>
    </select>
    <!-- 修改采购申请信息 add by wuxw 2018-07-03 -->
    <update id="updatePurchaseApplyInfoInstance" parameterType="Map">
        update  purchase_apply t set t.status_cd = #{statusCd}
<if test="newBId != null and newBId != ''">
,t.b_id = #{newBId}
</if>
<if test="applyDetailId !=null and applyDetailId != ''">
, t.apply_detail_id= #{applyDetailId}
</if>
<if test="resOrderType !=null and resOrderType != ''">
, t.res_order_type= #{resOrderType}
</if>
<if test="description !=null and description != ''">
, t.description= #{description}
</if>
<if test="state !=null and state != ''">
, t.state= #{state}
</if>
<if test="storeId !=null and storeId != ''">
, t.store_id= #{storeId}
</if>
<if test="entryPerson !=null and entryPerson != ''">
, t.entry_person= #{entryPerson}
</if>
<if test="userId !=null and userId != ''">
, t.user_id= #{userId}
</if>
 where 1=1 <if test="applyOrderId !=null and applyOrderId != ''">
and t.apply_order_id= #{applyOrderId}
</if>
<if test="bId !=null and bId != ''">
and t.b_id= #{bId}
</if>
    </update>
    <!-- 查询采购申请数量 add by wuxw 2018-07-03 -->
     <select id="queryPurchaseApplysCount" parameterType="Map" resultType="Map">
        select  count(1) count
from purchase_apply t
where 1 =1
<if test="applyDetailId !=null and applyDetailId != ''">
   and t.apply_detail_id= #{applyDetailId}
</if>
<if test="resOrderType !=null and resOrderType != ''">
   and t.res_order_type= #{resOrderType}
</if>
<if test="description !=null and description != ''">
   and t.description= #{description}
</if>
<if test="applyOrderId !=null and applyOrderId != ''">
   and t.apply_order_id= #{applyOrderId}
</if>
<if test="statusCd !=null and statusCd != ''">
   and t.status_cd= #{statusCd}
</if>
<if test="state !=null and state != ''">
   and t.state= #{state}
</if>
<if test="storeId !=null and storeId != ''">
   and t.store_id= #{storeId}
</if>
<if test="entryPerson !=null and entryPerson != ''">
   and t.entry_person= #{entryPerson}
</if>
<if test="bId !=null and bId != ''">
   and t.b_id= #{bId}
</if>
<if test="userId !=null and userId != ''">
   and t.user_id= #{userId}
</if>
     </select>
</mapper>
java110-utils/pom.xml
@@ -148,5 +148,10 @@
            <groupId>org.apache.poi</groupId>
            <artifactId>poi</artifactId>
        </dependency>
        <dependency>
            <groupId>com.belerweb</groupId>
            <artifactId>pinyin4j</artifactId>
        </dependency>
    </dependencies>
</project>
java110-utils/src/main/java/com/java110/utils/constant/BusinessTypeConstant.java
@@ -170,6 +170,25 @@
    /**
     * 保存采购申请
     */
    public static final String BUSINESS_TYPE_SAVE_PURCHASE_APPLY = "210100030001";
    /**
     * 修改采购申请
     */
    public static final String BUSINESS_TYPE_UPDATE_PURCHASE_APPLY = "210100040001";
    /**
     * 删除采购申请
     */
    public static final String BUSINESS_TYPE_DELETE_PURCHASE_APPLY = "210100050001";
    /**
     * 保存商品信息
     */
    public static final String BUSINESS_TYPE_SAVE_SHOP_INFO = "300100030001";
java110-utils/src/main/java/com/java110/utils/constant/ServiceCodePurchaseApplyConstant.java
New file
@@ -0,0 +1,31 @@
package com.java110.utils.constant;
/**
 * 采购申请常量类
 * Created by wuxw on 2017/5/20.
 */
public class ServiceCodePurchaseApplyConstant {
    /**
     * 添加 采购申请
     */
    public static final String ADD_PURCHASE_APPLY = "purchaseApply.savePurchaseApply";
    /**
     * 修改 采购申请
     */
    public static final String UPDATE_PURCHASE_APPLY = "purchaseApply.updatePurchaseApply";
    /**
     * 删除 采购申请
     */
    public static final String DELETE_PURCHASE_APPLY = "purchaseApply.deletePurchaseApply";
    /**
     * 查询 采购申请
     */
    public static final String LIST_PURCHASE_APPLY = "purchaseApply.listPurchaseApplys";
}
java110-utils/src/main/java/com/java110/utils/util/PinYinUtil.java
New file
@@ -0,0 +1,95 @@
package com.java110.utils.util;
import net.sourceforge.pinyin4j.PinyinHelper;
import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType;
import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat;
import net.sourceforge.pinyin4j.format.HanyuPinyinToneType;
import net.sourceforge.pinyin4j.format.HanyuPinyinVCharType;
import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination;
/**
 * 拼音工具类
 */
public class PinYinUtil {
    /**
     * 将字符串中的中文转化为拼音,其他字符不变
     *
     * @param inputString
     * @return
     */
    public static String getPingYin(String inputString) {
        HanyuPinyinOutputFormat format = new HanyuPinyinOutputFormat();
        format.setCaseType(HanyuPinyinCaseType.LOWERCASE);
        format.setToneType(HanyuPinyinToneType.WITHOUT_TONE);
        format.setVCharType(HanyuPinyinVCharType.WITH_V);
        char[] input = inputString.trim().toCharArray();
        String output = "";
        try {
            for (int i = 0; i < input.length; i++) {
                if (java.lang.Character.toString(input[i]).matches("[\\u4E00-\\u9FA5]+")) {
                    String[] temp = PinyinHelper.toHanyuPinyinStringArray(input[i], format);
                    output += temp[0];
                } else
                    output += java.lang.Character.toString(input[i]);
            }
        } catch (BadHanyuPinyinOutputFormatCombination e) {
            e.printStackTrace();
        }
        return output;
    }
    /**
     * 获取汉字串拼音首字母,英文字符不变
     * @param chinese 汉字串
     * @return 汉语拼音首字母
     */
    public static String getFirstSpell(String chinese) {
        StringBuffer pybf = new StringBuffer();
        char[] arr = chinese.toCharArray();
        HanyuPinyinOutputFormat defaultFormat = new HanyuPinyinOutputFormat();
        defaultFormat.setCaseType(HanyuPinyinCaseType.LOWERCASE);
        defaultFormat.setToneType(HanyuPinyinToneType.WITHOUT_TONE);
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] > 128) {
                try {
                    String[] temp = PinyinHelper.toHanyuPinyinStringArray(arr[i], defaultFormat);
                    if (temp != null) {
                        pybf.append(temp[0].charAt(0));
                    }
                } catch (BadHanyuPinyinOutputFormatCombination e) {
                    e.printStackTrace();
                }
            } else {
                pybf.append(arr[i]);
            }
        }
        return pybf.toString().replaceAll("\\W", "").trim();
    }
    /**
     * 获取汉字串拼音,英文字符不变
     * @param chinese 汉字串
     * @return 汉语拼音
     */
    public static String getFullSpell(String chinese) {
        StringBuffer pybf = new StringBuffer();
        char[] arr = chinese.toCharArray();
        HanyuPinyinOutputFormat defaultFormat = new HanyuPinyinOutputFormat();
        defaultFormat.setCaseType(HanyuPinyinCaseType.LOWERCASE);
        defaultFormat.setToneType(HanyuPinyinToneType.WITHOUT_TONE);
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] > 128) {
                try {
                    pybf.append(PinyinHelper.toHanyuPinyinStringArray(arr[i], defaultFormat)[0]);
                } catch (BadHanyuPinyinOutputFormatCombination e) {
                    e.printStackTrace();
                }
            } else {
                pybf.append(arr[i]);
            }
        }
        return pybf.toString();
    }
}
pom.xml
@@ -82,6 +82,7 @@
        <spring.version>5.0.8.RELEASE</spring.version>
        <zookeeper.version>3.4.14</zookeeper.version>
        <swagger.version>2.5.0</swagger.version>
        <pinyin4j.version>2.5.0</pinyin4j.version>
    </properties>
    <dependencyManagement>
@@ -101,7 +102,11 @@
                <version>${spring.version}</version>
            </dependency>
            <dependency>
                <groupId>com.belerweb</groupId>
                <artifactId>pinyin4j</artifactId>
                <version>${pinyin4j.version}</version>
            </dependency>
            <dependency>
                <groupId>com.alibaba</groupId>
                <artifactId>fastjson</artifactId>