| New file |
| | |
| | | package com.java110.dto.contract; |
| | | |
| | | 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 ContractDto extends PageDto implements Serializable { |
| | | |
| | | private String aLink; |
| | | private String aContacts; |
| | | private String amount; |
| | | private String contractType; |
| | | private String storeId; |
| | | private String operator; |
| | | private String signingTime; |
| | | private String bContacts; |
| | | private String partyA; |
| | | private String bLink; |
| | | private String partyB; |
| | | private String contractId; |
| | | private String objId; |
| | | private String contractName; |
| | | private String startTime; |
| | | private String endTime; |
| | | private String state; |
| | | private String contractCode; |
| | | private String objType; |
| | | private String operatorLink; |
| | | |
| | | |
| | | private Date createTime; |
| | | |
| | | private String statusCd = "0"; |
| | | |
| | | public String getaLink() { |
| | | return aLink; |
| | | } |
| | | |
| | | public void setaLink(String aLink) { |
| | | this.aLink = aLink; |
| | | } |
| | | |
| | | public String getaContacts() { |
| | | return aContacts; |
| | | } |
| | | |
| | | public void setaContacts(String aContacts) { |
| | | this.aContacts = aContacts; |
| | | } |
| | | |
| | | public String getAmount() { |
| | | return amount; |
| | | } |
| | | |
| | | public void setAmount(String amount) { |
| | | this.amount = amount; |
| | | } |
| | | |
| | | public String getContractType() { |
| | | return contractType; |
| | | } |
| | | |
| | | public void setContractType(String contractType) { |
| | | this.contractType = contractType; |
| | | } |
| | | |
| | | public String getStoreId() { |
| | | return storeId; |
| | | } |
| | | |
| | | public void setStoreId(String storeId) { |
| | | this.storeId = storeId; |
| | | } |
| | | |
| | | public String getOperator() { |
| | | return operator; |
| | | } |
| | | |
| | | public void setOperator(String operator) { |
| | | this.operator = operator; |
| | | } |
| | | |
| | | public String getSigningTime() { |
| | | return signingTime; |
| | | } |
| | | |
| | | public void setSigningTime(String signingTime) { |
| | | this.signingTime = signingTime; |
| | | } |
| | | |
| | | public String getbContacts() { |
| | | return bContacts; |
| | | } |
| | | |
| | | public void setbContacts(String bContacts) { |
| | | this.bContacts = bContacts; |
| | | } |
| | | |
| | | public String getPartyA() { |
| | | return partyA; |
| | | } |
| | | |
| | | public void setPartyA(String partyA) { |
| | | this.partyA = partyA; |
| | | } |
| | | |
| | | public String getbLink() { |
| | | return bLink; |
| | | } |
| | | |
| | | public void setbLink(String bLink) { |
| | | this.bLink = bLink; |
| | | } |
| | | |
| | | public String getPartyB() { |
| | | return partyB; |
| | | } |
| | | |
| | | public void setPartyB(String partyB) { |
| | | this.partyB = partyB; |
| | | } |
| | | |
| | | public String getContractId() { |
| | | return contractId; |
| | | } |
| | | |
| | | public void setContractId(String contractId) { |
| | | this.contractId = contractId; |
| | | } |
| | | |
| | | public String getObjId() { |
| | | return objId; |
| | | } |
| | | |
| | | public void setObjId(String objId) { |
| | | this.objId = objId; |
| | | } |
| | | |
| | | public String getContractName() { |
| | | return contractName; |
| | | } |
| | | |
| | | public void setContractName(String contractName) { |
| | | this.contractName = contractName; |
| | | } |
| | | |
| | | public String getStartTime() { |
| | | return startTime; |
| | | } |
| | | |
| | | public void setStartTime(String startTime) { |
| | | this.startTime = startTime; |
| | | } |
| | | |
| | | public String getEndTime() { |
| | | return endTime; |
| | | } |
| | | |
| | | public void setEndTime(String endTime) { |
| | | this.endTime = endTime; |
| | | } |
| | | |
| | | public String getState() { |
| | | return state; |
| | | } |
| | | |
| | | public void setState(String state) { |
| | | this.state = state; |
| | | } |
| | | |
| | | public String getContractCode() { |
| | | return contractCode; |
| | | } |
| | | |
| | | public void setContractCode(String contractCode) { |
| | | this.contractCode = contractCode; |
| | | } |
| | | |
| | | public String getObjType() { |
| | | return objType; |
| | | } |
| | | |
| | | public void setObjType(String objType) { |
| | | this.objType = objType; |
| | | } |
| | | |
| | | public String getOperatorLink() { |
| | | return operatorLink; |
| | | } |
| | | |
| | | public void setOperatorLink(String operatorLink) { |
| | | this.operatorLink = operatorLink; |
| | | } |
| | | |
| | | 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; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.po.contract; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | public class ContractPo implements Serializable { |
| | | |
| | | private String aLink; |
| | | private String aContacts; |
| | | private String amount; |
| | | private String contractType; |
| | | private String statusCd = "0"; |
| | | private String storeId; |
| | | private String operator; |
| | | private String signingTime; |
| | | private String bContacts; |
| | | private String partyA; |
| | | private String bLink; |
| | | private String partyB; |
| | | private String contractId; |
| | | private String objId; |
| | | private String contractName; |
| | | private String startTime; |
| | | private String endTime; |
| | | private String state; |
| | | private String contractCode; |
| | | private String objType; |
| | | private String operatorLink; |
| | | |
| | | public String getaLink() { |
| | | return aLink; |
| | | } |
| | | |
| | | public void setaLink(String aLink) { |
| | | this.aLink = aLink; |
| | | } |
| | | |
| | | public String getaContacts() { |
| | | return aContacts; |
| | | } |
| | | |
| | | public void setaContacts(String aContacts) { |
| | | this.aContacts = aContacts; |
| | | } |
| | | |
| | | public String getAmount() { |
| | | return amount; |
| | | } |
| | | |
| | | public void setAmount(String amount) { |
| | | this.amount = amount; |
| | | } |
| | | |
| | | public String getContractType() { |
| | | return contractType; |
| | | } |
| | | |
| | | public void setContractType(String contractType) { |
| | | this.contractType = contractType; |
| | | } |
| | | |
| | | 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 getOperator() { |
| | | return operator; |
| | | } |
| | | |
| | | public void setOperator(String operator) { |
| | | this.operator = operator; |
| | | } |
| | | |
| | | public String getSigningTime() { |
| | | return signingTime; |
| | | } |
| | | |
| | | public void setSigningTime(String signingTime) { |
| | | this.signingTime = signingTime; |
| | | } |
| | | |
| | | public String getbContacts() { |
| | | return bContacts; |
| | | } |
| | | |
| | | public void setbContacts(String bContacts) { |
| | | this.bContacts = bContacts; |
| | | } |
| | | |
| | | public String getPartyA() { |
| | | return partyA; |
| | | } |
| | | |
| | | public void setPartyA(String partyA) { |
| | | this.partyA = partyA; |
| | | } |
| | | |
| | | public String getbLink() { |
| | | return bLink; |
| | | } |
| | | |
| | | public void setbLink(String bLink) { |
| | | this.bLink = bLink; |
| | | } |
| | | |
| | | public String getPartyB() { |
| | | return partyB; |
| | | } |
| | | |
| | | public void setPartyB(String partyB) { |
| | | this.partyB = partyB; |
| | | } |
| | | |
| | | public String getContractId() { |
| | | return contractId; |
| | | } |
| | | |
| | | public void setContractId(String contractId) { |
| | | this.contractId = contractId; |
| | | } |
| | | |
| | | public String getObjId() { |
| | | return objId; |
| | | } |
| | | |
| | | public void setObjId(String objId) { |
| | | this.objId = objId; |
| | | } |
| | | |
| | | public String getContractName() { |
| | | return contractName; |
| | | } |
| | | |
| | | public void setContractName(String contractName) { |
| | | this.contractName = contractName; |
| | | } |
| | | |
| | | public String getStartTime() { |
| | | return startTime; |
| | | } |
| | | |
| | | public void setStartTime(String startTime) { |
| | | this.startTime = startTime; |
| | | } |
| | | |
| | | public String getEndTime() { |
| | | return endTime; |
| | | } |
| | | |
| | | public void setEndTime(String endTime) { |
| | | this.endTime = endTime; |
| | | } |
| | | |
| | | public String getState() { |
| | | return state; |
| | | } |
| | | |
| | | public void setState(String state) { |
| | | this.state = state; |
| | | } |
| | | |
| | | public String getContractCode() { |
| | | return contractCode; |
| | | } |
| | | |
| | | public void setContractCode(String contractCode) { |
| | | this.contractCode = contractCode; |
| | | } |
| | | |
| | | public String getObjType() { |
| | | return objType; |
| | | } |
| | | |
| | | public void setObjType(String objType) { |
| | | this.objType = objType; |
| | | } |
| | | |
| | | public String getOperatorLink() { |
| | | return operatorLink; |
| | | } |
| | | |
| | | public void setOperatorLink(String operatorLink) { |
| | | this.operatorLink = operatorLink; |
| | | } |
| | | } |
| | |
| | | public static final String CODE_PREFIX_prestoreFeeId = "78"; |
| | | public static final String CODE_PREFIX_formulaId = "79"; |
| | | public static final String CODE_PREFIX_appointmentId = "80"; |
| | | public static final String CODE_PREFIX_contractId = "81"; |
| | | |
| | | |
| | | /** |
| | |
| | | <if test="newBId != null and newBId != ''"> |
| | | ,t.b_id = #{newBId} |
| | | </if> |
| | | <if test="feeCoefficient !=null and feeCoefficient != ''"> |
| | | <if test="feeCoefficient !=null"> |
| | | , t.fee_coefficient= #{feeCoefficient} |
| | | </if> |
| | | <if test="section !=null and section != ''"> |
| 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="contractServiceDaoImpl"> |
| | | |
| | | |
| | | <!-- 保存合同管理信息 add by wuxw 2018-07-03 --> |
| | | <insert id="saveContractInfo" parameterType="Map"> |
| | | insert into contract( |
| | | a_link,a_contacts,amount,contract_type,store_id,operator,signing_time,b_contacts,party_a,b_link,party_b,contract_id,obj_id,contract_name,start_time,end_time,state,contract_code,obj_type,operator_link |
| | | ) values ( |
| | | #{aLink},#{aContacts},#{amount},#{contractType},#{storeId},#{operator},#{signingTime},#{bContacts},#{partyA},#{bLink},#{partyB},#{contractId},#{objId},#{contractName},#{startTime},#{endTime},#{state},#{contractCode},#{objType},#{operatorLink} |
| | | ) |
| | | </insert> |
| | | |
| | | |
| | | <!-- 查询合同管理信息 add by wuxw 2018-07-03 --> |
| | | <select id="getContractInfo" parameterType="Map" resultType="Map"> |
| | | select t.a_link,t.a_link aLink,t.a_contacts,t.a_contacts aContacts,t.amount,t.contract_type,t.contract_type |
| | | contractType,t.status_cd,t.status_cd statusCd,t.store_id,t.store_id |
| | | storeId,t.operator,t.signing_time,t.signing_time signingTime,t.b_contacts,t.b_contacts |
| | | bContacts,t.party_a,t.party_a partyA,t.b_link,t.b_link bLink,t.party_b,t.party_b |
| | | partyB,t.contract_id,t.contract_id contractId,t.obj_id,t.obj_id objId,t.contract_name,t.contract_name |
| | | contractName,t.start_time,t.start_time startTime,t.end_time,t.end_time |
| | | endTime,t.state,t.contract_code,t.contract_code contractCode,t.obj_type,t.obj_type |
| | | objType,t.operator_link,t.operator_link operatorLink |
| | | from contract t |
| | | where 1 =1 |
| | | <if test="aLink !=null and aLink != ''"> |
| | | and t.a_link= #{aLink} |
| | | </if> |
| | | <if test="aContacts !=null and aContacts != ''"> |
| | | and t.a_contacts= #{aContacts} |
| | | </if> |
| | | <if test="amount !=null and amount != ''"> |
| | | and t.amount= #{amount} |
| | | </if> |
| | | <if test="contractType !=null and contractType != ''"> |
| | | and t.contract_type= #{contractType} |
| | | </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="operator !=null and operator != ''"> |
| | | and t.operator= #{operator} |
| | | </if> |
| | | <if test="signingTime !=null and signingTime != ''"> |
| | | and t.signing_time= #{signingTime} |
| | | </if> |
| | | <if test="bContacts !=null and bContacts != ''"> |
| | | and t.b_contacts= #{bContacts} |
| | | </if> |
| | | <if test="partyA !=null and partyA != ''"> |
| | | and t.party_a= #{partyA} |
| | | </if> |
| | | <if test="bLink !=null and bLink != ''"> |
| | | and t.b_link= #{bLink} |
| | | </if> |
| | | <if test="partyB !=null and partyB != ''"> |
| | | and t.party_b= #{partyB} |
| | | </if> |
| | | <if test="contractId !=null and contractId != ''"> |
| | | and t.contract_id= #{contractId} |
| | | </if> |
| | | <if test="objId !=null and objId != ''"> |
| | | and t.obj_id= #{objId} |
| | | </if> |
| | | <if test="contractName !=null and contractName != ''"> |
| | | and t.contract_name= #{contractName} |
| | | </if> |
| | | <if test="startTime !=null and startTime != ''"> |
| | | and t.start_time= #{startTime} |
| | | </if> |
| | | <if test="endTime !=null and endTime != ''"> |
| | | and t.end_time= #{endTime} |
| | | </if> |
| | | <if test="state !=null and state != ''"> |
| | | and t.state= #{state} |
| | | </if> |
| | | <if test="contractCode !=null and contractCode != ''"> |
| | | and t.contract_code= #{contractCode} |
| | | </if> |
| | | <if test="objType !=null and objType != ''"> |
| | | and t.obj_type= #{objType} |
| | | </if> |
| | | <if test="operatorLink !=null and operatorLink != ''"> |
| | | and t.operator_link= #{operatorLink} |
| | | </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="updateContractInfo" parameterType="Map"> |
| | | update contract t set t.status_cd = #{statusCd} |
| | | <if test="newBId != null and newBId != ''"> |
| | | ,t.b_id = #{newBId} |
| | | </if> |
| | | <if test="aLink !=null and aLink != ''"> |
| | | , t.a_link= #{aLink} |
| | | </if> |
| | | <if test="aContacts !=null and aContacts != ''"> |
| | | , t.a_contacts= #{aContacts} |
| | | </if> |
| | | <if test="amount !=null and amount != ''"> |
| | | , t.amount= #{amount} |
| | | </if> |
| | | <if test="contractType !=null and contractType != ''"> |
| | | , t.contract_type= #{contractType} |
| | | </if> |
| | | <if test="storeId !=null and storeId != ''"> |
| | | , t.store_id= #{storeId} |
| | | </if> |
| | | <if test="operator !=null and operator != ''"> |
| | | , t.operator= #{operator} |
| | | </if> |
| | | <if test="signingTime !=null and signingTime != ''"> |
| | | , t.signing_time= #{signingTime} |
| | | </if> |
| | | <if test="bContacts !=null and bContacts != ''"> |
| | | , t.b_contacts= #{bContacts} |
| | | </if> |
| | | <if test="partyA !=null and partyA != ''"> |
| | | , t.party_a= #{partyA} |
| | | </if> |
| | | <if test="bLink !=null and bLink != ''"> |
| | | , t.b_link= #{bLink} |
| | | </if> |
| | | <if test="partyB !=null and partyB != ''"> |
| | | , t.party_b= #{partyB} |
| | | </if> |
| | | <if test="objId !=null and objId != ''"> |
| | | , t.obj_id= #{objId} |
| | | </if> |
| | | <if test="contractName !=null and contractName != ''"> |
| | | , t.contract_name= #{contractName} |
| | | </if> |
| | | <if test="startTime !=null and startTime != ''"> |
| | | , t.start_time= #{startTime} |
| | | </if> |
| | | <if test="endTime !=null and endTime != ''"> |
| | | , t.end_time= #{endTime} |
| | | </if> |
| | | <if test="state !=null and state != ''"> |
| | | , t.state= #{state} |
| | | </if> |
| | | <if test="contractCode !=null and contractCode != ''"> |
| | | , t.contract_code= #{contractCode} |
| | | </if> |
| | | <if test="objType !=null and objType != ''"> |
| | | , t.obj_type= #{objType} |
| | | </if> |
| | | <if test="operatorLink !=null and operatorLink != ''"> |
| | | , t.operator_link= #{operatorLink} |
| | | </if> |
| | | where 1=1 |
| | | <if test="contractId !=null and contractId != ''"> |
| | | and t.contract_id= #{contractId} |
| | | </if> |
| | | |
| | | </update> |
| | | |
| | | <!-- 查询合同管理数量 add by wuxw 2018-07-03 --> |
| | | <select id="queryContractsCount" parameterType="Map" resultType="Map"> |
| | | select count(1) count |
| | | from contract t |
| | | where 1 =1 |
| | | <if test="aLink !=null and aLink != ''"> |
| | | and t.a_link= #{aLink} |
| | | </if> |
| | | <if test="aContacts !=null and aContacts != ''"> |
| | | and t.a_contacts= #{aContacts} |
| | | </if> |
| | | <if test="amount !=null and amount != ''"> |
| | | and t.amount= #{amount} |
| | | </if> |
| | | <if test="contractType !=null and contractType != ''"> |
| | | and t.contract_type= #{contractType} |
| | | </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="operator !=null and operator != ''"> |
| | | and t.operator= #{operator} |
| | | </if> |
| | | <if test="signingTime !=null and signingTime != ''"> |
| | | and t.signing_time= #{signingTime} |
| | | </if> |
| | | <if test="bContacts !=null and bContacts != ''"> |
| | | and t.b_contacts= #{bContacts} |
| | | </if> |
| | | <if test="partyA !=null and partyA != ''"> |
| | | and t.party_a= #{partyA} |
| | | </if> |
| | | <if test="bLink !=null and bLink != ''"> |
| | | and t.b_link= #{bLink} |
| | | </if> |
| | | <if test="partyB !=null and partyB != ''"> |
| | | and t.party_b= #{partyB} |
| | | </if> |
| | | <if test="contractId !=null and contractId != ''"> |
| | | and t.contract_id= #{contractId} |
| | | </if> |
| | | <if test="objId !=null and objId != ''"> |
| | | and t.obj_id= #{objId} |
| | | </if> |
| | | <if test="contractName !=null and contractName != ''"> |
| | | and t.contract_name= #{contractName} |
| | | </if> |
| | | <if test="startTime !=null and startTime != ''"> |
| | | and t.start_time= #{startTime} |
| | | </if> |
| | | <if test="endTime !=null and endTime != ''"> |
| | | and t.end_time= #{endTime} |
| | | </if> |
| | | <if test="state !=null and state != ''"> |
| | | and t.state= #{state} |
| | | </if> |
| | | <if test="contractCode !=null and contractCode != ''"> |
| | | and t.contract_code= #{contractCode} |
| | | </if> |
| | | <if test="objType !=null and objType != ''"> |
| | | and t.obj_type= #{objType} |
| | | </if> |
| | | <if test="operatorLink !=null and operatorLink != ''"> |
| | | and t.operator_link= #{operatorLink} |
| | | </if> |
| | | |
| | | |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | public static void main(String[] args) throws Exception { |
| | | |
| | | //加载配置 |
| | | StringBuffer sb = readFile(GeneratorStart.class.getResource("/newBack/template_prestoreFee.json").getFile()); |
| | | StringBuffer sb = readFile(GeneratorStart.class.getResource("/newBack/template_1.json").getFile()); |
| | | |
| | | JSONObject dataJson = JSONObject.parseObject(sb.toString()); |
| | | |
| | |
| | | |
| | | public static void main(String[] args) throws Exception { |
| | | //加载配置 |
| | | StringBuffer sb = readFile(GeneratorStart.class.getResource("/web/template_prestoreFee.json").getFile()); |
| | | StringBuffer sb = readFile(GeneratorStart.class.getResource("/web/template_1.json").getFile()); |
| | | |
| | | JSONObject data = JSONObject.parseObject(sb.toString()); |
| | | |
| | |
| | | { |
| | | "autoMove": true, |
| | | "id": "appointmentId", |
| | | "name": "rentingAppointment", |
| | | "desc": "租赁预约", |
| | | "id": "contractId", |
| | | "name": "contract", |
| | | "desc": "合同管理", |
| | | "shareParam": "storeId", |
| | | "shareColumn": "store_id", |
| | | "shareName": "user", |
| | | "tableName": "renting_appointment", |
| | | "shareName": "store", |
| | | "tableName": "contract", |
| | | "param": { |
| | | "appointmentId": "appointment_id", |
| | | "tenantName": "tenant_name", |
| | | "tenantSex": "tenant_sex", |
| | | "tenantTel": "tenant_tel", |
| | | "appointmentTime": "appointment_time", |
| | | "appointmentRoomId": "appointment_room_id", |
| | | "roomId": "room_id", |
| | | "contractId": "contract_id", |
| | | "contractCode": "contract_code", |
| | | "contractName": "contract_name", |
| | | "contractType": "contract_type", |
| | | "objType": "obj_type", |
| | | "objId": "obj_id", |
| | | "partyA": "party_a", |
| | | "partyB": "party_b", |
| | | "aContacts": "a_contacts", |
| | | "aLink": "a_link", |
| | | "bContacts": "b_contacts", |
| | | "bLink": "b_link", |
| | | "operator": "operator", |
| | | "operatorLink": "operator_link", |
| | | "amount": "amount", |
| | | "startTime": "start_time", |
| | | "endTime": "end_time", |
| | | "signingTime": "signing_time", |
| | | "storeId": "store_id", |
| | | "state": "state", |
| | | "msg": "msg", |
| | | "remark": "remark", |
| | | "statusCd": "status_cd" |
| | | }, |
| | | "required": [ |
| | | { |
| | | "code": "tenantName", |
| | | "msg": "租客名称不能为空" |
| | | "code": "contractCode", |
| | | "msg": "合同编码不能为空" |
| | | }, |
| | | { |
| | | "code": "tenantSex", |
| | | "msg": "租客性别不能为空" |
| | | "code": "contractName", |
| | | "msg": "合同名称不能为空" |
| | | }, |
| | | { |
| | | "code": "tenantTel", |
| | | "msg": "租客电话不能为空" |
| | | "code": "contractType", |
| | | "msg": "合同类型不能为空" |
| | | }, |
| | | { |
| | | "code": "appointmentTime", |
| | | "msg": "预约时间不能为空" |
| | | "code": "partyA", |
| | | "msg": "甲方不能为空" |
| | | }, |
| | | { |
| | | "code": "partyB", |
| | | "msg": "乙方不能为空" |
| | | }, |
| | | { |
| | | "code": "aContacts", |
| | | "msg": "甲方联系人不能为空" |
| | | }, |
| | | { |
| | | "code": "aLink", |
| | | "msg": "甲方联系电话不能为空" |
| | | }, |
| | | { |
| | | "code": "bContacts", |
| | | "msg": "乙方联系人不能为空" |
| | | }, |
| | | { |
| | | "code": "bLink", |
| | | "msg": "乙方联系电话不能为空" |
| | | }, |
| | | { |
| | | "code": "operator", |
| | | "msg": "经办人不能为空" |
| | | }, |
| | | { |
| | | "code": "operatorLink", |
| | | "msg": "经办人联系电话不能为空" |
| | | }, |
| | | { |
| | | "code": "startTime", |
| | | "msg": "开始时间不能为空" |
| | | }, |
| | | { |
| | | "code": "endTime", |
| | | "msg": "结束时间不能为空" |
| | | }, |
| | | { |
| | | "code": "signingTime", |
| | | "msg": "签订时间不能为空" |
| | | } |
| | | ] |
| | | } |
| New file |
| | |
| | | { |
| | | "autoMove": true, |
| | | "id": "appointmentId", |
| | | "name": "rentingAppointment", |
| | | "desc": "租赁预约", |
| | | "shareParam": "storeId", |
| | | "shareColumn": "store_id", |
| | | "shareName": "user", |
| | | "tableName": "renting_appointment", |
| | | "param": { |
| | | "appointmentId": "appointment_id", |
| | | "tenantName": "tenant_name", |
| | | "tenantSex": "tenant_sex", |
| | | "tenantTel": "tenant_tel", |
| | | "appointmentTime": "appointment_time", |
| | | "appointmentRoomId": "appointment_room_id", |
| | | "roomId": "room_id", |
| | | "storeId": "store_id", |
| | | "state": "state", |
| | | "msg": "msg", |
| | | "remark": "remark", |
| | | "statusCd": "status_cd" |
| | | }, |
| | | "required": [ |
| | | { |
| | | "code": "tenantName", |
| | | "msg": "租客名称不能为空" |
| | | }, |
| | | { |
| | | "code": "tenantSex", |
| | | "msg": "租客性别不能为空" |
| | | }, |
| | | { |
| | | "code": "tenantTel", |
| | | "msg": "租客电话不能为空" |
| | | }, |
| | | { |
| | | "code": "appointmentTime", |
| | | "msg": "预约时间不能为空" |
| | | } |
| | | ] |
| | | } |
| | |
| | | { |
| | | "templateName":"租赁预约", |
| | | "templateName":"合同信息", |
| | | "directories": "admin", |
| | | "templateCode":"rentingAppointment", |
| | | "templateKey":"appointmentId", |
| | | "templateKeyName":"预约ID", |
| | | "templateCode":"contract", |
| | | "templateKey":"contractId", |
| | | "templateKeyName":"合同ID", |
| | | "searchCode": "appointmentId", |
| | | "searchName": "预约ID", |
| | | "conditions": [ |
| New file |
| | |
| | | { |
| | | "templateName":"租赁预约", |
| | | "directories": "admin", |
| | | "templateCode":"rentingAppointment", |
| | | "templateKey":"appointmentId", |
| | | "templateKeyName":"预约ID", |
| | | "searchCode": "appointmentId", |
| | | "searchName": "预约ID", |
| | | "conditions": [ |
| | | { |
| | | "name": "租客名称", |
| | | "inputType": "input", |
| | | "code": "tenantName", |
| | | "whereCondition": "equal" |
| | | }, |
| | | { |
| | | "name": "租客手机号", |
| | | "inputType": "input", |
| | | "code": "tenantTel", |
| | | "whereCondition": "equal" |
| | | }, |
| | | { |
| | | "name": "预约房屋编号", |
| | | "inputType": "input", |
| | | "code": "appointmentRoomId", |
| | | "whereCondition": "equal" |
| | | } |
| | | ], |
| | | "columns":[ |
| | | { |
| | | "code": "tenantName", |
| | | "cnCode":"租客名称", |
| | | "desc":"必填,请填写租客名称", |
| | | "required":true, |
| | | "hasDefaultValue":false, |
| | | "inputType": "input", |
| | | "limit":"maxLength", |
| | | "limitParam":"64", |
| | | "limitErrInfo":"租客名称不能超过64位", |
| | | "show": true |
| | | }, |
| | | { |
| | | "code": "tenantSex", |
| | | "cnCode":"租客性别", |
| | | "desc":"选填,请选择租客性别", |
| | | "required":true, |
| | | "hasDefaultValue":false, |
| | | "inputType": "select", |
| | | "selectValue":"0,1", |
| | | "selectValueName":"男,女", |
| | | "limit":"num", |
| | | "limitParam":"", |
| | | "limitErrInfo":"年龄格式错误", |
| | | "show": true |
| | | }, |
| | | { |
| | | "code": "tenantTel", |
| | | "cnCode":"租客电话", |
| | | "desc":"必填,请填写租客电话", |
| | | "required":true, |
| | | "hasDefaultValue":false, |
| | | "inputType": "input", |
| | | "limit":"phone", |
| | | "limitParam":"", |
| | | "limitErrInfo":"手机号格式错误", |
| | | "show": true |
| | | }, |
| | | { |
| | | "code": "appointmentTime", |
| | | "cnCode":"预约时间", |
| | | "desc":"必填,请填写预约时间", |
| | | "required":true, |
| | | "hasDefaultValue":false, |
| | | "inputType": "input", |
| | | "limit":"datetime", |
| | | "limitParam":"", |
| | | "limitErrInfo":"预约时间格式错误", |
| | | "show": true |
| | | }, |
| | | { |
| | | "code": "appointmentRoomId", |
| | | "cnCode":"预约房屋", |
| | | "desc":"选填,请填写预约房屋", |
| | | "required":false, |
| | | "hasDefaultValue":false, |
| | | "inputType": "input", |
| | | "limit":"num", |
| | | "limitParam":"", |
| | | "limitErrInfo":"预约房屋格式错误", |
| | | "show": true |
| | | }, |
| | | { |
| | | "code": "remark", |
| | | "cnCode":"备注", |
| | | "desc":"选填,请填写备注", |
| | | "required":false, |
| | | "hasDefaultValue":false, |
| | | "inputType": "input", |
| | | "limit":"maxLength", |
| | | "limitParam":"500", |
| | | "limitErrInfo":"备注不能超过500字", |
| | | "show": true |
| | | } |
| | | |
| | | ] |
| | | } |
| New file |
| | |
| | | package com.java110.intf.store; |
| | | |
| | | import com.java110.config.feign.FeignConfiguration; |
| | | import com.java110.dto.contract.ContractDto; |
| | | import com.java110.po.contract.ContractPo; |
| | | 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 IContractInnerServiceSMO |
| | | * @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("/contractApi") |
| | | public interface IContractInnerServiceSMO { |
| | | |
| | | |
| | | @RequestMapping(value = "/saveContract", method = RequestMethod.POST) |
| | | public int saveContract(@RequestBody ContractPo contractPo); |
| | | |
| | | @RequestMapping(value = "/updateContract", method = RequestMethod.POST) |
| | | public int updateContract(@RequestBody ContractPo contractPo); |
| | | |
| | | @RequestMapping(value = "/deleteContract", method = RequestMethod.POST) |
| | | public int deleteContract(@RequestBody ContractPo contractPo); |
| | | |
| | | /** |
| | | * <p>查询小区楼信息</p> |
| | | * |
| | | * @param contractDto 数据对象分享 |
| | | * @return ContractDto 对象数据 |
| | | */ |
| | | @RequestMapping(value = "/queryContracts", method = RequestMethod.POST) |
| | | List<ContractDto> queryContracts(@RequestBody ContractDto contractDto); |
| | | |
| | | /** |
| | | * 查询<p>小区楼</p>总记录数 |
| | | * |
| | | * @param contractDto 数据对象分享 |
| | | * @return 小区下的小区楼记录数 |
| | | */ |
| | | @RequestMapping(value = "/queryContractsCount", method = RequestMethod.POST) |
| | | int queryContractsCount(@RequestBody ContractDto contractDto); |
| | | } |
| New file |
| | |
| | | package com.java110.store.api; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.dto.contract.ContractDto; |
| | | import com.java110.po.contract.ContractPo; |
| | | 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.contract.IUpdateContractBMO; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | |
| | | @RestController |
| | | @RequestMapping(value = "/contract") |
| | | public class ContractApi { |
| | | |
| | | @Autowired |
| | | private ISaveContractBMO saveContractBMOImpl; |
| | | @Autowired |
| | | private IUpdateContractBMO updateContractBMOImpl; |
| | | @Autowired |
| | | private IDeleteContractBMO deleteContractBMOImpl; |
| | | |
| | | @Autowired |
| | | private IGetContractBMO getContractBMOImpl; |
| | | |
| | | /** |
| | | * 微信保存消息模板 |
| | | * |
| | | * @param reqJson |
| | | * @return |
| | | * @serviceCode /contract/saveContract |
| | | * @path /app/contract/saveContract |
| | | */ |
| | | @RequestMapping(value = "/saveContract", method = RequestMethod.POST) |
| | | public ResponseEntity<String> saveContract(@RequestBody JSONObject reqJson, @RequestHeader(value = "store-id") String storeId) { |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "contractCode", "请求报文中未包含contractCode"); |
| | | Assert.hasKeyAndValue(reqJson, "contractName", "请求报文中未包含contractName"); |
| | | Assert.hasKeyAndValue(reqJson, "contractType", "请求报文中未包含contractType"); |
| | | Assert.hasKeyAndValue(reqJson, "partyA", "请求报文中未包含partyA"); |
| | | Assert.hasKeyAndValue(reqJson, "partyB", "请求报文中未包含partyB"); |
| | | Assert.hasKeyAndValue(reqJson, "aContacts", "请求报文中未包含aContacts"); |
| | | Assert.hasKeyAndValue(reqJson, "aLink", "请求报文中未包含aLink"); |
| | | Assert.hasKeyAndValue(reqJson, "bContacts", "请求报文中未包含bContacts"); |
| | | Assert.hasKeyAndValue(reqJson, "bLink", "请求报文中未包含bLink"); |
| | | Assert.hasKeyAndValue(reqJson, "operator", "请求报文中未包含operator"); |
| | | Assert.hasKeyAndValue(reqJson, "operatorLink", "请求报文中未包含operatorLink"); |
| | | Assert.hasKeyAndValue(reqJson, "startTime", "请求报文中未包含startTime"); |
| | | Assert.hasKeyAndValue(reqJson, "endTime", "请求报文中未包含endTime"); |
| | | Assert.hasKeyAndValue(reqJson, "signingTime", "请求报文中未包含signingTime"); |
| | | |
| | | ContractPo contractPo = BeanConvertUtil.covertBean(reqJson, ContractPo.class); |
| | | contractPo.setStoreId(storeId); |
| | | return saveContractBMOImpl.save(contractPo); |
| | | } |
| | | |
| | | /** |
| | | * 微信修改消息模板 |
| | | * |
| | | * @param reqJson |
| | | * @return |
| | | * @serviceCode /contract/updateContract |
| | | * @path /app/contract/updateContract |
| | | */ |
| | | @RequestMapping(value = "/updateContract", method = RequestMethod.POST) |
| | | public ResponseEntity<String> updateContract(@RequestBody JSONObject reqJson) { |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "contractCode", "请求报文中未包含contractCode"); |
| | | Assert.hasKeyAndValue(reqJson, "contractName", "请求报文中未包含contractName"); |
| | | Assert.hasKeyAndValue(reqJson, "contractType", "请求报文中未包含contractType"); |
| | | Assert.hasKeyAndValue(reqJson, "partyA", "请求报文中未包含partyA"); |
| | | Assert.hasKeyAndValue(reqJson, "partyB", "请求报文中未包含partyB"); |
| | | Assert.hasKeyAndValue(reqJson, "aContacts", "请求报文中未包含aContacts"); |
| | | Assert.hasKeyAndValue(reqJson, "aLink", "请求报文中未包含aLink"); |
| | | Assert.hasKeyAndValue(reqJson, "bContacts", "请求报文中未包含bContacts"); |
| | | Assert.hasKeyAndValue(reqJson, "bLink", "请求报文中未包含bLink"); |
| | | Assert.hasKeyAndValue(reqJson, "operator", "请求报文中未包含operator"); |
| | | Assert.hasKeyAndValue(reqJson, "operatorLink", "请求报文中未包含operatorLink"); |
| | | Assert.hasKeyAndValue(reqJson, "startTime", "请求报文中未包含startTime"); |
| | | Assert.hasKeyAndValue(reqJson, "endTime", "请求报文中未包含endTime"); |
| | | Assert.hasKeyAndValue(reqJson, "signingTime", "请求报文中未包含signingTime"); |
| | | Assert.hasKeyAndValue(reqJson, "contractId", "contractId不能为空"); |
| | | |
| | | |
| | | ContractPo contractPo = BeanConvertUtil.covertBean(reqJson, ContractPo.class); |
| | | return updateContractBMOImpl.update(contractPo); |
| | | } |
| | | |
| | | /** |
| | | * 微信删除消息模板 |
| | | * |
| | | * @param reqJson |
| | | * @return |
| | | * @serviceCode /contract/deleteContract |
| | | * @path /app/contract/deleteContract |
| | | */ |
| | | @RequestMapping(value = "/deleteContract", method = RequestMethod.POST) |
| | | public ResponseEntity<String> deleteContract(@RequestBody JSONObject reqJson) { |
| | | Assert.hasKeyAndValue(reqJson, "communityId", "小区ID不能为空"); |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "contractId", "contractId不能为空"); |
| | | |
| | | |
| | | ContractPo contractPo = BeanConvertUtil.covertBean(reqJson, ContractPo.class); |
| | | return deleteContractBMOImpl.delete(contractPo); |
| | | } |
| | | |
| | | /** |
| | | * 微信删除消息模板 |
| | | * |
| | | * @param storeId 商户ID |
| | | * @return |
| | | * @serviceCode /contract/queryContract |
| | | * @path /app/contract/queryContract |
| | | */ |
| | | @RequestMapping(value = "/queryContract", method = RequestMethod.GET) |
| | | public ResponseEntity<String> queryContract(@RequestHeader(value = "store-id") String storeId, |
| | | @RequestParam(value = "page") int page, |
| | | @RequestParam(value = "row") int row) { |
| | | ContractDto contractDto = new ContractDto(); |
| | | contractDto.setPage(page); |
| | | contractDto.setRow(row); |
| | | contractDto.setStoreId(storeId); |
| | | return getContractBMOImpl.get(contractDto); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.store.bmo.contract; |
| | | |
| | | import com.java110.po.contract.ContractPo; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | public interface IDeleteContractBMO { |
| | | |
| | | |
| | | /** |
| | | * 修改合同管理 |
| | | * add by wuxw |
| | | * |
| | | * @param contractPo |
| | | * @return |
| | | */ |
| | | ResponseEntity<String> delete(ContractPo contractPo); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.store.bmo.contract; |
| | | |
| | | import com.java110.dto.contract.ContractDto; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | public interface IGetContractBMO { |
| | | |
| | | |
| | | /** |
| | | * 查询合同管理 |
| | | * add by wuxw |
| | | * |
| | | * @param contractDto |
| | | * @return |
| | | */ |
| | | ResponseEntity<String> get(ContractDto contractDto); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.store.bmo.contract; |
| | | |
| | | import com.java110.po.contract.ContractPo; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | public interface ISaveContractBMO { |
| | | |
| | | |
| | | /** |
| | | * 添加合同管理 |
| | | * add by wuxw |
| | | * |
| | | * @param contractPo |
| | | * @return |
| | | */ |
| | | ResponseEntity<String> save(ContractPo contractPo); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.store.bmo.contract; |
| | | import com.java110.po.contract.ContractPo; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | public interface IUpdateContractBMO { |
| | | |
| | | |
| | | /** |
| | | * 修改合同管理 |
| | | * add by wuxw |
| | | * @param contractPo |
| | | * @return |
| | | */ |
| | | ResponseEntity<String> update(ContractPo contractPo); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.store.bmo.contract.impl; |
| | | |
| | | import com.java110.core.annotation.Java110Transactional; |
| | | import com.java110.intf.store.IContractInnerServiceSMO; |
| | | import com.java110.po.contract.ContractPo; |
| | | import com.java110.store.bmo.contract.IDeleteContractBMO; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("deleteContractBMOImpl") |
| | | public class DeleteContractBMOImpl implements IDeleteContractBMO { |
| | | |
| | | @Autowired |
| | | private IContractInnerServiceSMO contractInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * @param contractPo 数据 |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | @Java110Transactional |
| | | public ResponseEntity<String> delete(ContractPo contractPo) { |
| | | |
| | | int flag = contractInnerServiceSMOImpl.deleteContract(contractPo); |
| | | |
| | | if (flag > 0) { |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功"); |
| | | } |
| | | |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存失败"); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.store.bmo.contract.impl; |
| | | |
| | | import com.java110.dto.contract.ContractDto; |
| | | import com.java110.intf.store.IContractInnerServiceSMO; |
| | | import com.java110.store.bmo.contract.IGetContractBMO; |
| | | 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("getContractBMOImpl") |
| | | public class GetContractBMOImpl implements IGetContractBMO { |
| | | |
| | | @Autowired |
| | | private IContractInnerServiceSMO contractInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * @param contractDto |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | public ResponseEntity<String> get(ContractDto contractDto) { |
| | | |
| | | |
| | | int count = contractInnerServiceSMOImpl.queryContractsCount(contractDto); |
| | | |
| | | List<ContractDto> contractDtos = null; |
| | | if (count > 0) { |
| | | contractDtos = contractInnerServiceSMOImpl.queryContracts(contractDto); |
| | | } else { |
| | | contractDtos = new ArrayList<>(); |
| | | } |
| | | |
| | | ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) contractDto.getRow()), count, contractDtos); |
| | | |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK); |
| | | |
| | | return responseEntity; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.store.bmo.contract.impl; |
| | | |
| | | import com.java110.core.annotation.Java110Transactional; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.intf.store.IContractInnerServiceSMO; |
| | | import com.java110.po.contract.ContractPo; |
| | | import com.java110.store.bmo.contract.ISaveContractBMO; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("saveContractBMOImpl") |
| | | public class SaveContractBMOImpl implements ISaveContractBMO { |
| | | |
| | | @Autowired |
| | | private IContractInnerServiceSMO contractInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * 添加小区信息 |
| | | * |
| | | * @param contractPo |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | @Java110Transactional |
| | | public ResponseEntity<String> save(ContractPo contractPo) { |
| | | |
| | | contractPo.setContractId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_contractId)); |
| | | int flag = contractInnerServiceSMOImpl.saveContract(contractPo); |
| | | |
| | | if (flag > 0) { |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功"); |
| | | } |
| | | |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存失败"); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.store.bmo.contract.impl; |
| | | |
| | | import com.java110.core.annotation.Java110Transactional; |
| | | import com.java110.intf.store.IContractInnerServiceSMO; |
| | | import com.java110.po.contract.ContractPo; |
| | | import com.java110.store.bmo.contract.IUpdateContractBMO; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("updateContractBMOImpl") |
| | | public class UpdateContractBMOImpl implements IUpdateContractBMO { |
| | | |
| | | @Autowired |
| | | private IContractInnerServiceSMO contractInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * @param contractPo |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | @Java110Transactional |
| | | public ResponseEntity<String> update(ContractPo contractPo) { |
| | | |
| | | int flag = contractInnerServiceSMOImpl.updateContract(contractPo); |
| | | |
| | | 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 IContractServiceDao { |
| | | |
| | | |
| | | /** |
| | | * 保存 合同管理信息 |
| | | * @param info |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | void saveContractInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询合同管理信息(instance过程) |
| | | * 根据bId 查询合同管理信息 |
| | | * @param info bId 信息 |
| | | * @return 合同管理信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | List<Map> getContractInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 修改合同管理信息 |
| | | * @param info 修改信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | void updateContractInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | /** |
| | | * 查询合同管理总数 |
| | | * |
| | | * @param info 合同管理信息 |
| | | * @return 合同管理数量 |
| | | */ |
| | | int queryContractsCount(Map info); |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.store.dao.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.utils.constant.ResponseConstant; |
| | | import com.java110.utils.exception.DAOException; |
| | | import com.java110.utils.util.DateUtil; |
| | | import com.java110.core.base.dao.BaseServiceDao; |
| | | import com.java110.store.dao.IContractServiceDao; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 合同管理服务 与数据库交互 |
| | | * Created by wuxw on 2017/4/5. |
| | | */ |
| | | @Service("contractServiceDaoImpl") |
| | | //@Transactional |
| | | public class ContractServiceDaoImpl extends BaseServiceDao implements IContractServiceDao { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(ContractServiceDaoImpl.class); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 保存合同管理信息 到 instance |
| | | * @param info bId 信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public void saveContractInfo(Map info) throws DAOException { |
| | | logger.debug("保存合同管理信息Instance 入参 info : {}",info); |
| | | |
| | | int saveFlag = sqlSessionTemplate.insert("contractServiceDaoImpl.saveContractInfo",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> getContractInfo(Map info) throws DAOException { |
| | | logger.debug("查询合同管理信息 入参 info : {}",info); |
| | | |
| | | List<Map> businessContractInfos = sqlSessionTemplate.selectList("contractServiceDaoImpl.getContractInfo",info); |
| | | |
| | | return businessContractInfos; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改合同管理信息 |
| | | * @param info 修改信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public void updateContractInfo(Map info) throws DAOException { |
| | | logger.debug("修改合同管理信息Instance 入参 info : {}",info); |
| | | |
| | | int saveFlag = sqlSessionTemplate.update("contractServiceDaoImpl.updateContractInfo",info); |
| | | |
| | | if(saveFlag < 1){ |
| | | throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改合同管理信息Instance数据失败:"+ JSONObject.toJSONString(info)); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 查询合同管理数量 |
| | | * @param info 合同管理信息 |
| | | * @return 合同管理数量 |
| | | */ |
| | | @Override |
| | | public int queryContractsCount(Map info) { |
| | | logger.debug("查询合同管理数据 入参 info : {}",info); |
| | | |
| | | List<Map> businessContractInfos = sqlSessionTemplate.selectList("contractServiceDaoImpl.queryContractsCount", info); |
| | | if (businessContractInfos.size() < 1) { |
| | | return 0; |
| | | } |
| | | |
| | | return Integer.parseInt(businessContractInfos.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.contract.ContractDto; |
| | | import com.java110.intf.store.IContractInnerServiceSMO; |
| | | import com.java110.po.contract.ContractPo; |
| | | import com.java110.store.dao.IContractServiceDao; |
| | | 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 ContractInnerServiceSMOImpl extends BaseServiceSMO implements IContractInnerServiceSMO { |
| | | |
| | | @Autowired |
| | | private IContractServiceDao contractServiceDaoImpl; |
| | | |
| | | |
| | | @Override |
| | | public int saveContract(@RequestBody ContractPo contractPo) { |
| | | int saveFlag = 1; |
| | | contractServiceDaoImpl.saveContractInfo(BeanConvertUtil.beanCovertMap(contractPo)); |
| | | return saveFlag; |
| | | } |
| | | |
| | | @Override |
| | | public int updateContract(@RequestBody ContractPo contractPo) { |
| | | int saveFlag = 1; |
| | | contractServiceDaoImpl.updateContractInfo(BeanConvertUtil.beanCovertMap(contractPo)); |
| | | return saveFlag; |
| | | } |
| | | |
| | | @Override |
| | | public int deleteContract(@RequestBody ContractPo contractPo) { |
| | | int saveFlag = 1; |
| | | contractPo.setStatusCd("1"); |
| | | contractServiceDaoImpl.updateContractInfo(BeanConvertUtil.beanCovertMap(contractPo)); |
| | | return saveFlag; |
| | | } |
| | | |
| | | @Override |
| | | public List<ContractDto> queryContracts(@RequestBody ContractDto contractDto) { |
| | | |
| | | //校验是否传了 分页信息 |
| | | |
| | | int page = contractDto.getPage(); |
| | | |
| | | if (page != PageDto.DEFAULT_PAGE) { |
| | | contractDto.setPage((page - 1) * contractDto.getRow()); |
| | | } |
| | | |
| | | List<ContractDto> contracts = BeanConvertUtil.covertBeanList(contractServiceDaoImpl.getContractInfo(BeanConvertUtil.beanCovertMap(contractDto)), ContractDto.class); |
| | | |
| | | return contracts; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public int queryContractsCount(@RequestBody ContractDto contractDto) { |
| | | return contractServiceDaoImpl.queryContractsCount(BeanConvertUtil.beanCovertMap(contractDto)); |
| | | } |
| | | |
| | | public IContractServiceDao getContractServiceDaoImpl() { |
| | | return contractServiceDaoImpl; |
| | | } |
| | | |
| | | public void setContractServiceDaoImpl(IContractServiceDao contractServiceDaoImpl) { |
| | | this.contractServiceDaoImpl = contractServiceDaoImpl; |
| | | } |
| | | } |