| New file |
| | |
| | | package com.java110.dto.contractTypeTemplate; |
| | | |
| | | 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 ContractTypeTemplateDto extends PageDto implements Serializable { |
| | | |
| | | private String context; |
| | | private String storeId; |
| | | private String contractTypeId; |
| | | private String templateId; |
| | | |
| | | |
| | | private Date createTime; |
| | | |
| | | private String statusCd = "0"; |
| | | |
| | | |
| | | public String getContext() { |
| | | return context; |
| | | } |
| | | |
| | | public void setContext(String context) { |
| | | this.context = context; |
| | | } |
| | | |
| | | public String getStoreId() { |
| | | return storeId; |
| | | } |
| | | |
| | | public void setStoreId(String storeId) { |
| | | this.storeId = storeId; |
| | | } |
| | | |
| | | public String getContractTypeId() { |
| | | return contractTypeId; |
| | | } |
| | | |
| | | public void setContractTypeId(String contractTypeId) { |
| | | this.contractTypeId = contractTypeId; |
| | | } |
| | | |
| | | |
| | | 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; |
| | | } |
| | | |
| | | public String getTemplateId() { |
| | | return templateId; |
| | | } |
| | | |
| | | public void setTemplateId(String templateId) { |
| | | this.templateId = templateId; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.po.contractTypeTemplate; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | public class ContractTypeTemplatePo implements Serializable { |
| | | |
| | | private String context; |
| | | private String statusCd = "0"; |
| | | private String storeId; |
| | | private String contractTypeId; |
| | | private String templateId; |
| | | |
| | | public String getContext() { |
| | | return context; |
| | | } |
| | | |
| | | public void setContext(String context) { |
| | | this.context = context; |
| | | } |
| | | |
| | | public String getStatusCd() { |
| | | return statusCd; |
| | | } |
| | | |
| | | public void setStatusCd(String statusCd) { |
| | | this.statusCd = statusCd; |
| | | } |
| | | |
| | | public String getStoreId() { |
| | | return storeId; |
| | | } |
| | | |
| | | public void setStoreId(String storeId) { |
| | | this.storeId = storeId; |
| | | } |
| | | |
| | | public String getContractTypeId() { |
| | | return contractTypeId; |
| | | } |
| | | |
| | | public void setContractTypeId(String contractTypeId) { |
| | | this.contractTypeId = contractTypeId; |
| | | } |
| | | |
| | | public String getTemplateId() { |
| | | return templateId; |
| | | } |
| | | |
| | | public void setTemplateId(String templateId) { |
| | | this.templateId = templateId; |
| | | } |
| | | } |
| | |
| | | public static final String CODE_PREFIX_contractTypeId = "81"; |
| | | public static final String CODE_PREFIX_specCd = "82"; |
| | | public static final String CODE_PREFIX_loginId = "82"; |
| | | public static final String CODE_PREFIX_templateId = "82"; |
| | | |
| | | |
| | | |
| New file |
| | |
| | | <?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="contractTypeTemplateServiceDaoImpl"> |
| | | |
| | | |
| | | <!-- 保存合同属性信息 add by wuxw 2018-07-03 --> |
| | | <insert id="saveContractTypeTemplateInfo" parameterType="Map"> |
| | | insert into contract_type_template( |
| | | context,store_id,contract_type_id,template_id |
| | | ) values ( |
| | | #{context},#{storeId},#{contractTypeId},#{templateId} |
| | | ) |
| | | </insert> |
| | | |
| | | |
| | | <!-- 查询合同属性信息 add by wuxw 2018-07-03 --> |
| | | <select id="getContractTypeTemplateInfo" parameterType="Map" resultType="Map"> |
| | | select t.context,t.status_cd,t.status_cd statusCd,t.store_id,t.store_id |
| | | storeId,t.contract_type_id,t.contract_type_id contractTypeId,t.template_id templateId |
| | | from contract_type_template t |
| | | where 1 =1 |
| | | <if test="context !=null and context != ''"> |
| | | and t.context= #{context} |
| | | </if> |
| | | <if test="statusCd !=null and statusCd != ''"> |
| | | and t.status_cd= #{statusCd} |
| | | </if> |
| | | <if test="storeId !=null and storeId != ''"> |
| | | and t.store_id= #{storeId} |
| | | </if> |
| | | <if test="contractTypeId !=null and contractTypeId != ''"> |
| | | and t.contract_type_id= #{contractTypeId} |
| | | </if> |
| | | <if test="templateId !=null and templateId != ''"> |
| | | and t.template_id= #{templateId} |
| | | </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="updateContractTypeTemplateInfo" parameterType="Map"> |
| | | update contract_type_template t set t.status_cd = #{statusCd} |
| | | <if test="newBId != null and newBId != ''"> |
| | | ,t.b_id = #{newBId} |
| | | </if> |
| | | <if test="context !=null and context != ''"> |
| | | , t.context= #{context} |
| | | </if> |
| | | <if test="storeId !=null and storeId != ''"> |
| | | , t.store_id= #{storeId} |
| | | </if> |
| | | <if test="contractTypeId !=null and contractTypeId != ''"> |
| | | , t.contract_type_id= #{contractTypeId} |
| | | </if> |
| | | where 1=1 |
| | | <if test="templateId !=null and templateId != ''"> |
| | | and t.template_id= #{templateId} |
| | | </if> |
| | | </update> |
| | | |
| | | <!-- 查询合同属性数量 add by wuxw 2018-07-03 --> |
| | | <select id="queryContractTypeTemplatesCount" parameterType="Map" resultType="Map"> |
| | | select count(1) count |
| | | from contract_type_template t |
| | | where 1 =1 |
| | | <if test="context !=null and context != ''"> |
| | | and t.context= #{context} |
| | | </if> |
| | | <if test="statusCd !=null and statusCd != ''"> |
| | | and t.status_cd= #{statusCd} |
| | | </if> |
| | | <if test="storeId !=null and storeId != ''"> |
| | | and t.store_id= #{storeId} |
| | | </if> |
| | | <if test="contractTypeId !=null and contractTypeId != ''"> |
| | | and t.contract_type_id= #{contractTypeId} |
| | | </if> |
| | | <if test="templateId !=null and templateId != ''"> |
| | | and t.template_id= #{templateId} |
| | | </if> |
| | | |
| | | |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | { |
| | | "autoMove": true, |
| | | "id": "attrId", |
| | | "name": "contractAttr", |
| | | "id": "templateId", |
| | | "name": "contractTypeTemplate", |
| | | "desc": "合同属性", |
| | | "shareParam": "storeId", |
| | | "shareColumn": "store_id", |
| | | "shareName": "store", |
| | | "tableName": "contract_attr", |
| | | "tableName": "contract_type_template", |
| | | "param": { |
| | | "storeId": "store_id", |
| | | "contractId": "contract_id", |
| | | "attrId": "attr_id", |
| | | "specCd": "spec_cd", |
| | | "value": "value", |
| | | "contractTypeId": "contract_type_id", |
| | | "context": "context", |
| | | "statusCd": "status_cd" |
| | | }, |
| | | "required": [ |
| | | { |
| | | "code": "contractId", |
| | | "msg": "合同ID不能为空" |
| | | "code": "contractTypeId", |
| | | "msg": "合同类型不能为空" |
| | | }, |
| | | { |
| | | "code": "storeId", |
| | | "msg": "商户ID不能为空" |
| | | }, |
| | | { |
| | | "code": "specCd", |
| | | "msg": "用户规格不能为空" |
| | | "code": "context", |
| | | "msg": "内容不能为空" |
| | | } |
| | | ] |
| | | } |
| New file |
| | |
| | | { |
| | | "autoMove": true, |
| | | "id": "attrId", |
| | | "name": "contractAttr", |
| | | "desc": "合同属性", |
| | | "shareParam": "storeId", |
| | | "shareColumn": "store_id", |
| | | "shareName": "store", |
| | | "tableName": "contract_attr", |
| | | "param": { |
| | | "storeId": "store_id", |
| | | "contractId": "contract_id", |
| | | "attrId": "attr_id", |
| | | "specCd": "spec_cd", |
| | | "value": "value", |
| | | "statusCd": "status_cd" |
| | | }, |
| | | "required": [ |
| | | { |
| | | "code": "contractId", |
| | | "msg": "合同ID不能为空" |
| | | }, |
| | | { |
| | | "code": "storeId", |
| | | "msg": "商户ID不能为空" |
| | | }, |
| | | { |
| | | "code": "specCd", |
| | | "msg": "用户规格不能为空" |
| | | } |
| | | ] |
| | | } |
| | | |
| New file |
| | |
| | | package com.java110.intf; |
| | | |
| | | import com.java110.config.feign.FeignConfiguration; |
| | | import com.java110.dto.contractTypeTemplate.ContractTypeTemplateDto; |
| | | import com.java110.po.contractTypeTemplate.ContractTypeTemplatePo; |
| | | 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 IContractTypeTemplateInnerServiceSMO |
| | | * @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("/contractTypeTemplateApi") |
| | | public interface IContractTypeTemplateInnerServiceSMO { |
| | | |
| | | |
| | | @RequestMapping(value = "/saveContractTypeTemplate", method = RequestMethod.POST) |
| | | public int saveContractTypeTemplate(@RequestBody ContractTypeTemplatePo contractTypeTemplatePo); |
| | | |
| | | @RequestMapping(value = "/updateContractTypeTemplate", method = RequestMethod.POST) |
| | | public int updateContractTypeTemplate(@RequestBody ContractTypeTemplatePo contractTypeTemplatePo); |
| | | |
| | | @RequestMapping(value = "/deleteContractTypeTemplate", method = RequestMethod.POST) |
| | | public int deleteContractTypeTemplate(@RequestBody ContractTypeTemplatePo contractTypeTemplatePo); |
| | | |
| | | /** |
| | | * <p>查询小区楼信息</p> |
| | | * |
| | | * @param contractTypeTemplateDto 数据对象分享 |
| | | * @return ContractTypeTemplateDto 对象数据 |
| | | */ |
| | | @RequestMapping(value = "/queryContractTypeTemplates", method = RequestMethod.POST) |
| | | List<ContractTypeTemplateDto> queryContractTypeTemplates(@RequestBody ContractTypeTemplateDto contractTypeTemplateDto); |
| | | |
| | | /** |
| | | * 查询<p>小区楼</p>总记录数 |
| | | * |
| | | * @param contractTypeTemplateDto 数据对象分享 |
| | | * @return 小区下的小区楼记录数 |
| | | */ |
| | | @RequestMapping(value = "/queryContractTypeTemplatesCount", method = RequestMethod.POST) |
| | | int queryContractTypeTemplatesCount(@RequestBody ContractTypeTemplateDto contractTypeTemplateDto); |
| | | } |
| | |
| | | import com.java110.dto.contractAttr.ContractAttrDto; |
| | | import com.java110.dto.contractType.ContractTypeDto; |
| | | import com.java110.dto.contractTypeSpec.ContractTypeSpecDto; |
| | | import com.java110.dto.contractTypeTemplate.ContractTypeTemplateDto; |
| | | import com.java110.po.contract.ContractPo; |
| | | import com.java110.po.contractAttr.ContractAttrPo; |
| | | import com.java110.po.contractType.ContractTypePo; |
| | | import com.java110.po.contractTypeSpec.ContractTypeSpecPo; |
| | | import com.java110.po.contractTypeTemplate.ContractTypeTemplatePo; |
| | | import com.java110.store.bmo.contract.IDeleteContractBMO; |
| | | import com.java110.store.bmo.contract.IGetContractBMO; |
| | | import com.java110.store.bmo.contract.ISaveContractBMO; |
| | |
| | | import com.java110.store.bmo.contractTypeSpec.IGetContractTypeSpecBMO; |
| | | import com.java110.store.bmo.contractTypeSpec.ISaveContractTypeSpecBMO; |
| | | import com.java110.store.bmo.contractTypeSpec.IUpdateContractTypeSpecBMO; |
| | | import com.java110.store.bmo.contractTypeTemplate.IDeleteContractTypeTemplateBMO; |
| | | import com.java110.store.bmo.contractTypeTemplate.IGetContractTypeTemplateBMO; |
| | | import com.java110.store.bmo.contractTypeTemplate.ISaveContractTypeTemplateBMO; |
| | | import com.java110.store.bmo.contractTypeTemplate.IUpdateContractTypeTemplateBMO; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | @Autowired |
| | | private IGetContractAttrBMO getContractAttrBMOImpl; |
| | | |
| | | @Autowired |
| | | private ISaveContractTypeTemplateBMO saveContractTypeTemplateBMOImpl; |
| | | @Autowired |
| | | private IUpdateContractTypeTemplateBMO updateContractTypeTemplateBMOImpl; |
| | | @Autowired |
| | | private IDeleteContractTypeTemplateBMO deleteContractTypeTemplateBMOImpl; |
| | | |
| | | @Autowired |
| | | private IGetContractTypeTemplateBMO getContractTypeTemplateBMOImpl; |
| | | |
| | | /** |
| | | * 微信保存消息模板 |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 微信保存消息模板 |
| | | * |
| | | * @param reqJson |
| | | * @return |
| | | * @serviceCode /contract/saveContractTypeTemplate |
| | | * @path /app/contract/saveContractTypeTemplate |
| | | */ |
| | | @RequestMapping(value = "/saveContractTypeTemplate", method = RequestMethod.POST) |
| | | public ResponseEntity<String> saveContractTypeTemplate(@RequestBody JSONObject reqJson) { |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "contractTypeId", "请求报文中未包含contractTypeId"); |
| | | Assert.hasKeyAndValue(reqJson, "storeId", "请求报文中未包含storeId"); |
| | | Assert.hasKeyAndValue(reqJson, "context", "请求报文中未包含context"); |
| | | |
| | | |
| | | ContractTypeTemplatePo contractTypeTemplatePo = BeanConvertUtil.covertBean(reqJson, ContractTypeTemplatePo.class); |
| | | return saveContractTypeTemplateBMOImpl.save(contractTypeTemplatePo); |
| | | } |
| | | |
| | | /** |
| | | * 微信修改消息模板 |
| | | * |
| | | * @param reqJson |
| | | * @return |
| | | * @serviceCode /contract/updateContractTypeTemplate |
| | | * @path /app/contract/updateContractTypeTemplate |
| | | */ |
| | | @RequestMapping(value = "/updateContractTypeTemplate", method = RequestMethod.POST) |
| | | public ResponseEntity<String> updateContractTypeTemplate(@RequestBody JSONObject reqJson) { |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "contractTypeId", "请求报文中未包含contractTypeId"); |
| | | Assert.hasKeyAndValue(reqJson, "storeId", "请求报文中未包含storeId"); |
| | | Assert.hasKeyAndValue(reqJson, "context", "请求报文中未包含context"); |
| | | Assert.hasKeyAndValue(reqJson, "templateId", "templateId不能为空"); |
| | | |
| | | |
| | | ContractTypeTemplatePo contractTypeTemplatePo = BeanConvertUtil.covertBean(reqJson, ContractTypeTemplatePo.class); |
| | | return updateContractTypeTemplateBMOImpl.update(contractTypeTemplatePo); |
| | | } |
| | | |
| | | /** |
| | | * 微信删除消息模板 |
| | | * |
| | | * @param reqJson |
| | | * @return |
| | | * @serviceCode /contract/deleteContractTypeTemplate |
| | | * @path /app/contract/deleteContractTypeTemplate |
| | | */ |
| | | @RequestMapping(value = "/deleteContractTypeTemplate", method = RequestMethod.POST) |
| | | public ResponseEntity<String> deleteContractTypeTemplate(@RequestBody JSONObject reqJson) { |
| | | Assert.hasKeyAndValue(reqJson, "communityId", "小区ID不能为空"); |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "templateId", "templateId不能为空"); |
| | | |
| | | |
| | | ContractTypeTemplatePo contractTypeTemplatePo = BeanConvertUtil.covertBean(reqJson, ContractTypeTemplatePo.class); |
| | | return deleteContractTypeTemplateBMOImpl.delete(contractTypeTemplatePo); |
| | | } |
| | | |
| | | /** |
| | | * 微信删除消息模板 |
| | | * |
| | | * @param storeId 商户ID |
| | | * @return |
| | | * @serviceCode /contract/queryContractTypeTemplate |
| | | * @path /app/contract/queryContractTypeTemplate |
| | | */ |
| | | @RequestMapping(value = "/queryContractTypeTemplate", method = RequestMethod.GET) |
| | | public ResponseEntity<String> queryContractTypeTemplate(@RequestHeader(value = "store-id") String storeId, |
| | | @RequestParam(value = "page") int page, |
| | | @RequestParam(value = "row") int row) { |
| | | ContractTypeTemplateDto contractTypeTemplateDto = new ContractTypeTemplateDto(); |
| | | contractTypeTemplateDto.setPage(page); |
| | | contractTypeTemplateDto.setRow(row); |
| | | contractTypeTemplateDto.setStoreId(storeId); |
| | | return getContractTypeTemplateBMOImpl.get(contractTypeTemplateDto); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.store.bmo.contractTypeTemplate; |
| | | |
| | | import com.java110.po.contractTypeTemplate.ContractTypeTemplatePo; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | public interface IDeleteContractTypeTemplateBMO { |
| | | |
| | | |
| | | /** |
| | | * 修改合同属性 |
| | | * add by wuxw |
| | | * |
| | | * @param contractTypeTemplatePo |
| | | * @return |
| | | */ |
| | | ResponseEntity<String> delete(ContractTypeTemplatePo contractTypeTemplatePo); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.store.bmo.contractTypeTemplate; |
| | | |
| | | import com.java110.dto.contractTypeTemplate.ContractTypeTemplateDto; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | public interface IGetContractTypeTemplateBMO { |
| | | |
| | | |
| | | /** |
| | | * 查询合同属性 |
| | | * add by wuxw |
| | | * |
| | | * @param contractTypeTemplateDto |
| | | * @return |
| | | */ |
| | | ResponseEntity<String> get(ContractTypeTemplateDto contractTypeTemplateDto); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.store.bmo.contractTypeTemplate; |
| | | |
| | | import com.java110.po.contractTypeTemplate.ContractTypeTemplatePo; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | public interface ISaveContractTypeTemplateBMO { |
| | | |
| | | |
| | | /** |
| | | * 添加合同属性 |
| | | * add by wuxw |
| | | * |
| | | * @param contractTypeTemplatePo |
| | | * @return |
| | | */ |
| | | ResponseEntity<String> save(ContractTypeTemplatePo contractTypeTemplatePo); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.store.bmo.contractTypeTemplate; |
| | | |
| | | import com.java110.po.contractTypeTemplate.ContractTypeTemplatePo; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | public interface IUpdateContractTypeTemplateBMO { |
| | | |
| | | |
| | | /** |
| | | * 修改合同属性 |
| | | * add by wuxw |
| | | * |
| | | * @param contractTypeTemplatePo |
| | | * @return |
| | | */ |
| | | ResponseEntity<String> update(ContractTypeTemplatePo contractTypeTemplatePo); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.store.bmo.contractTypeTemplate.impl; |
| | | |
| | | import com.java110.core.annotation.Java110Transactional; |
| | | import com.java110.intf.IContractTypeTemplateInnerServiceSMO; |
| | | import com.java110.po.contractTypeTemplate.ContractTypeTemplatePo; |
| | | import com.java110.store.bmo.contractTypeTemplate.IDeleteContractTypeTemplateBMO; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("deleteContractTypeTemplateBMOImpl") |
| | | public class DeleteContractTypeTemplateBMOImpl implements IDeleteContractTypeTemplateBMO { |
| | | |
| | | @Autowired |
| | | private IContractTypeTemplateInnerServiceSMO contractTypeTemplateInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * @param contractTypeTemplatePo 数据 |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | @Java110Transactional |
| | | public ResponseEntity<String> delete(ContractTypeTemplatePo contractTypeTemplatePo) { |
| | | |
| | | int flag = contractTypeTemplateInnerServiceSMOImpl.deleteContractTypeTemplate(contractTypeTemplatePo); |
| | | |
| | | if (flag > 0) { |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功"); |
| | | } |
| | | |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存失败"); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.store.bmo.contractTypeTemplate.impl; |
| | | |
| | | import com.java110.dto.contractTypeTemplate.ContractTypeTemplateDto; |
| | | import com.java110.intf.IContractTypeTemplateInnerServiceSMO; |
| | | import com.java110.store.bmo.contractTypeTemplate.IGetContractTypeTemplateBMO; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Service("getContractTypeTemplateBMOImpl") |
| | | public class GetContractTypeTemplateBMOImpl implements IGetContractTypeTemplateBMO { |
| | | |
| | | @Autowired |
| | | private IContractTypeTemplateInnerServiceSMO contractTypeTemplateInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * @param contractTypeTemplateDto |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | public ResponseEntity<String> get(ContractTypeTemplateDto contractTypeTemplateDto) { |
| | | |
| | | |
| | | int count = contractTypeTemplateInnerServiceSMOImpl.queryContractTypeTemplatesCount(contractTypeTemplateDto); |
| | | |
| | | List<ContractTypeTemplateDto> contractTypeTemplateDtos = null; |
| | | if (count > 0) { |
| | | contractTypeTemplateDtos = contractTypeTemplateInnerServiceSMOImpl.queryContractTypeTemplates(contractTypeTemplateDto); |
| | | } else { |
| | | contractTypeTemplateDtos = new ArrayList<>(); |
| | | } |
| | | |
| | | ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) contractTypeTemplateDto.getRow()), count, contractTypeTemplateDtos); |
| | | |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK); |
| | | |
| | | return responseEntity; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.store.bmo.contractTypeTemplate.impl; |
| | | |
| | | import com.java110.core.annotation.Java110Transactional; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.intf.IContractTypeTemplateInnerServiceSMO; |
| | | import com.java110.po.contractTypeTemplate.ContractTypeTemplatePo; |
| | | import com.java110.store.bmo.contractTypeTemplate.ISaveContractTypeTemplateBMO; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("saveContractTypeTemplateBMOImpl") |
| | | public class SaveContractTypeTemplateBMOImpl implements ISaveContractTypeTemplateBMO { |
| | | |
| | | @Autowired |
| | | private IContractTypeTemplateInnerServiceSMO contractTypeTemplateInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * 添加小区信息 |
| | | * |
| | | * @param contractTypeTemplatePo |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | @Java110Transactional |
| | | public ResponseEntity<String> save(ContractTypeTemplatePo contractTypeTemplatePo) { |
| | | |
| | | contractTypeTemplatePo.setTemplateId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_templateId)); |
| | | int flag = contractTypeTemplateInnerServiceSMOImpl.saveContractTypeTemplate(contractTypeTemplatePo); |
| | | |
| | | if (flag > 0) { |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功"); |
| | | } |
| | | |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存失败"); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.store.bmo.contractTypeTemplate.impl; |
| | | |
| | | import com.java110.core.annotation.Java110Transactional; |
| | | import com.java110.intf.IContractTypeTemplateInnerServiceSMO; |
| | | import com.java110.po.contractTypeTemplate.ContractTypeTemplatePo; |
| | | import com.java110.store.bmo.contractTypeTemplate.IUpdateContractTypeTemplateBMO; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("updateContractTypeTemplateBMOImpl") |
| | | public class UpdateContractTypeTemplateBMOImpl implements IUpdateContractTypeTemplateBMO { |
| | | |
| | | @Autowired |
| | | private IContractTypeTemplateInnerServiceSMO contractTypeTemplateInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * @param contractTypeTemplatePo |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | @Java110Transactional |
| | | public ResponseEntity<String> update(ContractTypeTemplatePo contractTypeTemplatePo) { |
| | | |
| | | int flag = contractTypeTemplateInnerServiceSMOImpl.updateContractTypeTemplate(contractTypeTemplatePo); |
| | | |
| | | if (flag > 0) { |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功"); |
| | | } |
| | | |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存失败"); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.store.dao; |
| | | |
| | | |
| | | import com.java110.utils.exception.DAOException; |
| | | import com.java110.entity.merchant.BoMerchant; |
| | | import com.java110.entity.merchant.BoMerchantAttr; |
| | | import com.java110.entity.merchant.Merchant; |
| | | import com.java110.entity.merchant.MerchantAttr; |
| | | |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 合同属性组件内部之间使用,没有给外围系统提供服务能力 |
| | | * 合同属性服务接口类,要求全部以字符串传输,方便微服务化 |
| | | * 新建客户,修改客户,删除客户,查询客户等功能 |
| | | * |
| | | * Created by wuxw on 2016/12/27. |
| | | */ |
| | | public interface IContractTypeTemplateServiceDao { |
| | | |
| | | |
| | | /** |
| | | * 保存 合同属性信息 |
| | | * @param info |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | void saveContractTypeTemplateInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询合同属性信息(instance过程) |
| | | * 根据bId 查询合同属性信息 |
| | | * @param info bId 信息 |
| | | * @return 合同属性信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | List<Map> getContractTypeTemplateInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 修改合同属性信息 |
| | | * @param info 修改信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | void updateContractTypeTemplateInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | /** |
| | | * 查询合同属性总数 |
| | | * |
| | | * @param info 合同属性信息 |
| | | * @return 合同属性数量 |
| | | */ |
| | | int queryContractTypeTemplatesCount(Map info); |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.store.dao.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.base.dao.BaseServiceDao; |
| | | import com.java110.store.dao.IContractTypeTemplateServiceDao; |
| | | import com.java110.utils.constant.ResponseConstant; |
| | | import com.java110.utils.exception.DAOException; |
| | | 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("contractTypeTemplateServiceDaoImpl") |
| | | //@Transactional |
| | | public class ContractTypeTemplateServiceDaoImpl extends BaseServiceDao implements IContractTypeTemplateServiceDao { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(ContractTypeTemplateServiceDaoImpl.class); |
| | | |
| | | |
| | | /** |
| | | * 保存合同属性信息 到 instance |
| | | * |
| | | * @param info bId 信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public void saveContractTypeTemplateInfo(Map info) throws DAOException { |
| | | logger.debug("保存合同属性信息Instance 入参 info : {}", info); |
| | | |
| | | int saveFlag = sqlSessionTemplate.insert("contractTypeTemplateServiceDaoImpl.saveContractTypeTemplateInfo", 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> getContractTypeTemplateInfo(Map info) throws DAOException { |
| | | logger.debug("查询合同属性信息 入参 info : {}", info); |
| | | |
| | | List<Map> businessContractTypeTemplateInfos = sqlSessionTemplate.selectList("contractTypeTemplateServiceDaoImpl.getContractTypeTemplateInfo", info); |
| | | |
| | | return businessContractTypeTemplateInfos; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改合同属性信息 |
| | | * |
| | | * @param info 修改信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public void updateContractTypeTemplateInfo(Map info) throws DAOException { |
| | | logger.debug("修改合同属性信息Instance 入参 info : {}", info); |
| | | |
| | | int saveFlag = sqlSessionTemplate.update("contractTypeTemplateServiceDaoImpl.updateContractTypeTemplateInfo", info); |
| | | |
| | | if (saveFlag < 1) { |
| | | throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "修改合同属性信息Instance数据失败:" + JSONObject.toJSONString(info)); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 查询合同属性数量 |
| | | * |
| | | * @param info 合同属性信息 |
| | | * @return 合同属性数量 |
| | | */ |
| | | @Override |
| | | public int queryContractTypeTemplatesCount(Map info) { |
| | | logger.debug("查询合同属性数据 入参 info : {}", info); |
| | | |
| | | List<Map> businessContractTypeTemplateInfos = sqlSessionTemplate.selectList("contractTypeTemplateServiceDaoImpl.queryContractTypeTemplatesCount", info); |
| | | if (businessContractTypeTemplateInfos.size() < 1) { |
| | | return 0; |
| | | } |
| | | |
| | | return Integer.parseInt(businessContractTypeTemplateInfos.get(0).get("count").toString()); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.store.smo.impl; |
| | | |
| | | |
| | | import com.java110.core.base.smo.BaseServiceSMO; |
| | | import com.java110.dto.PageDto; |
| | | import com.java110.dto.contractTypeTemplate.ContractTypeTemplateDto; |
| | | import com.java110.intf.IContractTypeTemplateInnerServiceSMO; |
| | | import com.java110.po.contractTypeTemplate.ContractTypeTemplatePo; |
| | | import com.java110.store.dao.IContractTypeTemplateServiceDao; |
| | | 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.List; |
| | | |
| | | /** |
| | | * @ClassName FloorInnerServiceSMOImpl |
| | | * @Description 合同属性内部服务实现类 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 9:20 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | @RestController |
| | | public class ContractTypeTemplateInnerServiceSMOImpl extends BaseServiceSMO implements IContractTypeTemplateInnerServiceSMO { |
| | | |
| | | @Autowired |
| | | private IContractTypeTemplateServiceDao contractTypeTemplateServiceDaoImpl; |
| | | |
| | | |
| | | @Override |
| | | public int saveContractTypeTemplate(@RequestBody ContractTypeTemplatePo contractTypeTemplatePo) { |
| | | int saveFlag = 1; |
| | | contractTypeTemplateServiceDaoImpl.saveContractTypeTemplateInfo(BeanConvertUtil.beanCovertMap(contractTypeTemplatePo)); |
| | | return saveFlag; |
| | | } |
| | | |
| | | @Override |
| | | public int updateContractTypeTemplate(@RequestBody ContractTypeTemplatePo contractTypeTemplatePo) { |
| | | int saveFlag = 1; |
| | | contractTypeTemplateServiceDaoImpl.updateContractTypeTemplateInfo(BeanConvertUtil.beanCovertMap(contractTypeTemplatePo)); |
| | | return saveFlag; |
| | | } |
| | | |
| | | @Override |
| | | public int deleteContractTypeTemplate(@RequestBody ContractTypeTemplatePo contractTypeTemplatePo) { |
| | | int saveFlag = 1; |
| | | contractTypeTemplatePo.setStatusCd("1"); |
| | | contractTypeTemplateServiceDaoImpl.updateContractTypeTemplateInfo(BeanConvertUtil.beanCovertMap(contractTypeTemplatePo)); |
| | | return saveFlag; |
| | | } |
| | | |
| | | @Override |
| | | public List<ContractTypeTemplateDto> queryContractTypeTemplates(@RequestBody ContractTypeTemplateDto contractTypeTemplateDto) { |
| | | |
| | | //校验是否传了 分页信息 |
| | | |
| | | int page = contractTypeTemplateDto.getPage(); |
| | | |
| | | if (page != PageDto.DEFAULT_PAGE) { |
| | | contractTypeTemplateDto.setPage((page - 1) * contractTypeTemplateDto.getRow()); |
| | | } |
| | | |
| | | List<ContractTypeTemplateDto> contractTypeTemplates = BeanConvertUtil.covertBeanList(contractTypeTemplateServiceDaoImpl.getContractTypeTemplateInfo(BeanConvertUtil.beanCovertMap(contractTypeTemplateDto)), ContractTypeTemplateDto.class); |
| | | |
| | | return contractTypeTemplates; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public int queryContractTypeTemplatesCount(@RequestBody ContractTypeTemplateDto contractTypeTemplateDto) { |
| | | return contractTypeTemplateServiceDaoImpl.queryContractTypeTemplatesCount(BeanConvertUtil.beanCovertMap(contractTypeTemplateDto)); |
| | | } |
| | | |
| | | public IContractTypeTemplateServiceDao getContractTypeTemplateServiceDaoImpl() { |
| | | return contractTypeTemplateServiceDaoImpl; |
| | | } |
| | | |
| | | public void setContractTypeTemplateServiceDaoImpl(IContractTypeTemplateServiceDao contractTypeTemplateServiceDaoImpl) { |
| | | this.contractTypeTemplateServiceDaoImpl = contractTypeTemplateServiceDaoImpl; |
| | | } |
| | | } |