Showing
11 changed files
with
829 additions
and
0 deletions
1 | +package com.yoho.order.dal; | ||
2 | + | ||
3 | +import java.util.List; | ||
4 | + | ||
5 | +import org.apache.ibatis.annotations.Param; | ||
6 | + | ||
7 | +import com.yoho.order.model.BusinessLicense; | ||
8 | +import com.yoho.order.model.BusinessLicenseReq; | ||
9 | + | ||
10 | +/** | ||
11 | + * Created by caoyan on 2019/1/7. | ||
12 | + */ | ||
13 | +public interface BusinessLicenseMapper { | ||
14 | + | ||
15 | + int insert(BusinessLicense businessLicense); | ||
16 | + | ||
17 | + List<BusinessLicense> selectByUid(@Param("uid") Integer uid); | ||
18 | + | ||
19 | + int selectTotalByCondition(@Param("businessLicenseReq")BusinessLicenseReq businessLicenseReq); | ||
20 | + | ||
21 | + List<BusinessLicense> selectByCondition(@Param("businessLicenseReq")BusinessLicenseReq businessLicenseReq); | ||
22 | + | ||
23 | + BusinessLicense selectById(@Param("id") Integer id); | ||
24 | + | ||
25 | +} |
1 | +package com.yoho.order.model; | ||
2 | + | ||
3 | +import java.io.Serializable; | ||
4 | + | ||
5 | +/** | ||
6 | + * @author caoyan | ||
7 | + * @date 2019/1/7 | ||
8 | + */ | ||
9 | +public class BusinessLicense implements Serializable { | ||
10 | + | ||
11 | + | ||
12 | + private static final long serialVersionUID = 2607922995706119816L; | ||
13 | + | ||
14 | + private Integer id; | ||
15 | + | ||
16 | + private Integer uid; | ||
17 | + | ||
18 | + private Integer businessType; | ||
19 | + | ||
20 | + private String businessName; | ||
21 | + | ||
22 | + private String socialCreditCode; | ||
23 | + | ||
24 | + private String certName; | ||
25 | + | ||
26 | + private String certNo; | ||
27 | + | ||
28 | + private Integer startTime; | ||
29 | + | ||
30 | + private Integer expireTime; | ||
31 | + | ||
32 | + private String licenseOriginalImage; | ||
33 | + | ||
34 | + private String licenseCopyImage; | ||
35 | + | ||
36 | + private String certFaceImage; | ||
37 | + | ||
38 | + private String certReverseImage; | ||
39 | + | ||
40 | + private Integer commitTime; | ||
41 | + | ||
42 | + private Integer auditStatus; | ||
43 | + | ||
44 | + private Integer auditTime; | ||
45 | + | ||
46 | + private Integer auditUid; | ||
47 | + | ||
48 | + private String rejectReason; | ||
49 | + | ||
50 | + public Integer getId() { | ||
51 | + return id; | ||
52 | + } | ||
53 | + | ||
54 | + public void setId(Integer id) { | ||
55 | + this.id = id; | ||
56 | + } | ||
57 | + | ||
58 | + public Integer getUid() { | ||
59 | + return uid; | ||
60 | + } | ||
61 | + | ||
62 | + public void setUid(Integer uid) { | ||
63 | + this.uid = uid; | ||
64 | + } | ||
65 | + | ||
66 | + public Integer getBusinessType() { | ||
67 | + return businessType; | ||
68 | + } | ||
69 | + | ||
70 | + public void setBusinessType(Integer businessType) { | ||
71 | + this.businessType = businessType; | ||
72 | + } | ||
73 | + | ||
74 | + public String getBusinessName() { | ||
75 | + return businessName; | ||
76 | + } | ||
77 | + | ||
78 | + public void setBusinessName(String businessName) { | ||
79 | + this.businessName = businessName; | ||
80 | + } | ||
81 | + | ||
82 | + public String getSocialCreditCode() { | ||
83 | + return socialCreditCode; | ||
84 | + } | ||
85 | + | ||
86 | + public void setSocialCreditCode(String socialCreditCode) { | ||
87 | + this.socialCreditCode = socialCreditCode; | ||
88 | + } | ||
89 | + | ||
90 | + public String getCertName() { | ||
91 | + return certName; | ||
92 | + } | ||
93 | + | ||
94 | + public void setCertName(String certName) { | ||
95 | + this.certName = certName; | ||
96 | + } | ||
97 | + | ||
98 | + public String getCertNo() { | ||
99 | + return certNo; | ||
100 | + } | ||
101 | + | ||
102 | + public void setCertNo(String certNo) { | ||
103 | + this.certNo = certNo; | ||
104 | + } | ||
105 | + | ||
106 | + public Integer getStartTime() { | ||
107 | + return startTime; | ||
108 | + } | ||
109 | + | ||
110 | + public void setStartTime(Integer startTime) { | ||
111 | + this.startTime = startTime; | ||
112 | + } | ||
113 | + | ||
114 | + public Integer getExpireTime() { | ||
115 | + return expireTime; | ||
116 | + } | ||
117 | + | ||
118 | + public void setExpireTime(Integer expireTime) { | ||
119 | + this.expireTime = expireTime; | ||
120 | + } | ||
121 | + | ||
122 | + public String getLicenseOriginalImage() { | ||
123 | + return licenseOriginalImage; | ||
124 | + } | ||
125 | + | ||
126 | + public void setLicenseOriginalImage(String licenseOriginalImage) { | ||
127 | + this.licenseOriginalImage = licenseOriginalImage; | ||
128 | + } | ||
129 | + | ||
130 | + public String getLicenseCopyImage() { | ||
131 | + return licenseCopyImage; | ||
132 | + } | ||
133 | + | ||
134 | + public void setLicenseCopyImage(String licenseCopyImage) { | ||
135 | + this.licenseCopyImage = licenseCopyImage; | ||
136 | + } | ||
137 | + | ||
138 | + public String getCertFaceImage() { | ||
139 | + return certFaceImage; | ||
140 | + } | ||
141 | + | ||
142 | + public void setCertFaceImage(String certFaceImage) { | ||
143 | + this.certFaceImage = certFaceImage; | ||
144 | + } | ||
145 | + | ||
146 | + public String getCertReverseImage() { | ||
147 | + return certReverseImage; | ||
148 | + } | ||
149 | + | ||
150 | + public void setCertReverseImage(String certReverseImage) { | ||
151 | + this.certReverseImage = certReverseImage; | ||
152 | + } | ||
153 | + | ||
154 | + public Integer getCommitTime() { | ||
155 | + return commitTime; | ||
156 | + } | ||
157 | + | ||
158 | + public void setCommitTime(Integer commitTime) { | ||
159 | + this.commitTime = commitTime; | ||
160 | + } | ||
161 | + | ||
162 | + public Integer getAuditStatus() { | ||
163 | + return auditStatus; | ||
164 | + } | ||
165 | + | ||
166 | + public void setAuditStatus(Integer auditStatus) { | ||
167 | + this.auditStatus = auditStatus; | ||
168 | + } | ||
169 | + | ||
170 | + public Integer getAuditTime() { | ||
171 | + return auditTime; | ||
172 | + } | ||
173 | + | ||
174 | + public void setAuditTime(Integer auditTime) { | ||
175 | + this.auditTime = auditTime; | ||
176 | + } | ||
177 | + | ||
178 | + public Integer getAuditUid() { | ||
179 | + return auditUid; | ||
180 | + } | ||
181 | + | ||
182 | + public void setAuditUid(Integer auditUid) { | ||
183 | + this.auditUid = auditUid; | ||
184 | + } | ||
185 | + | ||
186 | + public String getRejectReason() { | ||
187 | + return rejectReason; | ||
188 | + } | ||
189 | + | ||
190 | + public void setRejectReason(String rejectReason) { | ||
191 | + this.rejectReason = rejectReason; | ||
192 | + } | ||
193 | + | ||
194 | + @Override | ||
195 | + public String toString() { | ||
196 | + return "BusinessLicense{" + | ||
197 | + "id=" + id + | ||
198 | + ", uid='" + uid + '\'' + | ||
199 | + ", businessType='" + businessType + '\'' + | ||
200 | + ", businessName='" + businessName + '\'' + | ||
201 | + ", socialCreditCode='" + socialCreditCode + '\'' + | ||
202 | + ", certName='" + certName + '\'' + | ||
203 | + ", certNo='" + certNo + '\'' + | ||
204 | + ", startTime='" + startTime + '\'' + | ||
205 | + ", expireTime='" + expireTime + '\'' + | ||
206 | + ", licenseOriginalImage='" + licenseOriginalImage + '\'' + | ||
207 | + ", licenseCopyImage='" + licenseCopyImage + '\'' + | ||
208 | + ", certFaceImage='" + certFaceImage + '\'' + | ||
209 | + ", certReverseImage='" + certReverseImage + '\'' + | ||
210 | + ", commitTime='" + commitTime + '\'' + | ||
211 | + ", auditStatus='" + auditStatus + '\'' + | ||
212 | + ", auditTime='" + auditTime + '\'' + | ||
213 | + ", auditUid='" + auditUid + '\'' + | ||
214 | + ", rejectReason='" + rejectReason + '\'' + | ||
215 | + '}'; | ||
216 | + } | ||
217 | +} |
1 | +package com.yoho.order.model; | ||
2 | + | ||
3 | +import com.yoho.ufo.service.model.PageRequestBO; | ||
4 | + | ||
5 | +import lombok.AllArgsConstructor; | ||
6 | +import lombok.Data; | ||
7 | +import lombok.NoArgsConstructor; | ||
8 | +import lombok.experimental.Builder; | ||
9 | + | ||
10 | +/** | ||
11 | + * Created by caoyan. | ||
12 | + */ | ||
13 | +@Data | ||
14 | +@Builder | ||
15 | +@AllArgsConstructor | ||
16 | +@NoArgsConstructor | ||
17 | +public class BusinessLicenseReq extends PageRequestBO{ | ||
18 | + | ||
19 | + /** | ||
20 | + * | ||
21 | + */ | ||
22 | + private static final long serialVersionUID = 1620427808531296022L; | ||
23 | + | ||
24 | + private Integer id; | ||
25 | + | ||
26 | + private Integer uid; | ||
27 | + | ||
28 | + private Integer businessType; | ||
29 | + | ||
30 | + private String businessName; | ||
31 | + | ||
32 | + private String socialCreditCode; | ||
33 | + | ||
34 | + private String certName; | ||
35 | + | ||
36 | + private String certNo; | ||
37 | + | ||
38 | + private String licenseImage; | ||
39 | + | ||
40 | + private String certFaceImage; | ||
41 | + | ||
42 | + private String certReverseImage; | ||
43 | + | ||
44 | + private Integer validStatus;//入驻状态 1:已入驻 9:已退驻 | ||
45 | + | ||
46 | +} |
1 | +package com.yoho.order.model; | ||
2 | + | ||
3 | +import com.yoho.ufo.service.model.PageRequestBO; | ||
4 | + | ||
5 | +import lombok.AllArgsConstructor; | ||
6 | +import lombok.Data; | ||
7 | +import lombok.NoArgsConstructor; | ||
8 | +import lombok.experimental.Builder; | ||
9 | + | ||
10 | +/** | ||
11 | + * Created by caoyan. | ||
12 | + */ | ||
13 | +@Data | ||
14 | +@Builder | ||
15 | +@AllArgsConstructor | ||
16 | +@NoArgsConstructor | ||
17 | +public class BusinessLicenseRsp extends PageRequestBO{ | ||
18 | + | ||
19 | + /** | ||
20 | + * | ||
21 | + */ | ||
22 | + private static final long serialVersionUID = 1620427808531296022L; | ||
23 | + | ||
24 | + private Integer id; | ||
25 | + | ||
26 | + private Integer uid; | ||
27 | + | ||
28 | + private Integer businessType; | ||
29 | + | ||
30 | + private String businessTypeStr; | ||
31 | + | ||
32 | + private String certName; | ||
33 | + | ||
34 | + private String certNo; | ||
35 | + | ||
36 | + private String commitTime; | ||
37 | + | ||
38 | + private Integer auditStatus; | ||
39 | + | ||
40 | + private String auditStatusStr; | ||
41 | + | ||
42 | + private String auditTime; | ||
43 | + | ||
44 | + private String rejectReason; | ||
45 | + | ||
46 | + private String startTime; | ||
47 | + | ||
48 | + private String expireTime; | ||
49 | + | ||
50 | + private String licenseOriginalImage; | ||
51 | + | ||
52 | + private String licenseCopyImage; | ||
53 | + | ||
54 | + private String businessName; | ||
55 | + | ||
56 | + private String socialCreditCode; | ||
57 | + | ||
58 | +} |
1 | +<?xml version="1.0" encoding="UTF-8" ?> | ||
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > | ||
3 | +<mapper namespace="com.yoho.order.dal.BusinessLicenseMapper"> | ||
4 | + <resultMap id="BaseResultMap" type="com.yoho.order.model.BusinessLicense"> | ||
5 | + <result column="id" property="id" jdbcType="INTEGER" /> | ||
6 | + <result column="uid" property="uid" jdbcType="INTEGER" /> | ||
7 | + <result column="business_type" property="businessType" jdbcType="INTEGER" /> | ||
8 | + <result column="business_name" property="businessName" jdbcType="VARCHAR" /> | ||
9 | + <result column="social_credit_code" property="socialCreditCode" jdbcType="VARCHAR" /> | ||
10 | + <result column="cert_name" property="certName" jdbcType="VARCHAR" /> | ||
11 | + <result column="cert_no" property="certNo" jdbcType="VARCHAR" /> | ||
12 | + <result column="start_time" property="startTime" jdbcType="INTEGER" /> | ||
13 | + <result column="expire_time" property="expireTime" jdbcType="INTEGER" /> | ||
14 | + <result column="license_original_image" property="licenseOriginalImage" jdbcType="VARCHAR" /> | ||
15 | + <result column="license_copy_image" property="licenseCopyImage" jdbcType="VARCHAR" /> | ||
16 | + <result column="cert_face_image" property="certFaceImage" jdbcType="VARCHAR" /> | ||
17 | + <result column="cert_reverse_image" property="certReverseImage" jdbcType="VARCHAR" /> | ||
18 | + <result column="commit_time" property="commitTime" jdbcType="INTEGER" /> | ||
19 | + <result column="audit_status" property="auditStatus" jdbcType="INTEGER" /> | ||
20 | + <result column="audit_time" property="auditTime" jdbcType="INTEGER" /> | ||
21 | + <result column="audit_uid" property="auditUid" jdbcType="INTEGER" /> | ||
22 | + <result column="reject_reason" property="rejectReason" jdbcType="VARCHAR" /> | ||
23 | + </resultMap> | ||
24 | + | ||
25 | + <sql id="Base_Column_List"> | ||
26 | + id, uid, business_type, business_name, social_credit_code, cert_name, cert_no, start_time, expire_time, license_original_image, | ||
27 | + license_copy_image, cert_face_image, cert_reverse_image, commit_time, audit_status, audit_time, audit_uid, reject_reason | ||
28 | + </sql> | ||
29 | + | ||
30 | + <insert id="insert" parameterType="com.yoho.order.model.BusinessLicense"> | ||
31 | + insert into business_license (uid, business_type, business_name, social_credit_code, cert_name, cert_no, start_time, expire_time, | ||
32 | + license_original_image, license_copy_image, cert_face_image, cert_reverse_image, commit_time) values (#{uid}, #{businessType}, #{businessName}, | ||
33 | + #{socialCreditCode}, #{certName}, #{certNo}, #{licenseImage}, #{certFaceImage}, #{certReverseImage}, #{commitTime}) | ||
34 | + </insert> | ||
35 | + | ||
36 | + <select id="selectByUid" resultMap="BaseResultMap"> | ||
37 | + select <include refid="Base_Column_List"></include> | ||
38 | + from business_license | ||
39 | + where uid=#{uid} | ||
40 | + order by commit_time desc | ||
41 | + </select> | ||
42 | + | ||
43 | + <sql id="Query_Sql" > | ||
44 | + <if test="businessLicenseReq.uid != null"> | ||
45 | + and a.uid=#{businessLicenseReq.uid} | ||
46 | + </if> | ||
47 | + <if test="businessLicenseReq.businessName!= null"> | ||
48 | + <bind name="pattern" value="'%' + businessLicenseReq.businessName + '%'" /> | ||
49 | + and a.business_name like #{pattern} | ||
50 | + </if> | ||
51 | + <if test="businessLicenseReq.validStatus != null"> | ||
52 | + and b.valid_status=#{businessLicenseReq.validStatus} | ||
53 | + </if> | ||
54 | + </sql> | ||
55 | + | ||
56 | + <select id="selectTotalByCondition" resultType="java.lang.Integer" parameterType="com.yoho.order.model.BusinessLicenseReq"> | ||
57 | + select count(1) | ||
58 | + from business_license a | ||
59 | + <if test="businessLicenseReq.validStatus != null"> | ||
60 | + LEFT JOIN stored_seller b | ||
61 | + ON( b.uid=a.uid) | ||
62 | + </if> | ||
63 | + where 1=1 | ||
64 | + <include refid="Query_Sql"></include> | ||
65 | + </select> | ||
66 | + | ||
67 | + <select id="selectByCondition" resultMap="BaseResultMap" parameterType="com.yoho.order.model.BusinessLicenseReq"> | ||
68 | + select a.* | ||
69 | + from business_license a | ||
70 | + <if test="businessLicenseReq.validStatus != null"> | ||
71 | + LEFT JOIN stored_seller b | ||
72 | + ON( b.uid=a.uid) | ||
73 | + </if> | ||
74 | + where 1=1 | ||
75 | + <include refid="Query_Sql"></include> | ||
76 | + order by a.commit_time desc | ||
77 | + <if test="businessLicenseReq.start!=null and businessLicenseReq.size != null"> | ||
78 | + limit #{businessLicenseReq.start},#{businessLicenseReq.size} | ||
79 | + </if> | ||
80 | + </select> | ||
81 | + | ||
82 | + <select id="selectById"> | ||
83 | + select <include refid="Base_Column_List"></include> | ||
84 | + from business_license | ||
85 | + where id=#{id} | ||
86 | + </select> | ||
87 | + | ||
88 | + | ||
89 | +</mapper> |
1 | +package com.yoho.ufo.order.controller; | ||
2 | + | ||
3 | +import org.slf4j.Logger; | ||
4 | +import org.slf4j.LoggerFactory; | ||
5 | +import org.springframework.beans.factory.annotation.Autowired; | ||
6 | +import org.springframework.web.bind.annotation.RequestBody; | ||
7 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
8 | +import org.springframework.web.bind.annotation.RestController; | ||
9 | + | ||
10 | +import com.yoho.order.model.BusinessLicense; | ||
11 | +import com.yoho.order.model.BusinessLicenseReq; | ||
12 | +import com.yoho.order.model.BusinessLicenseRsp; | ||
13 | +import com.yoho.ufo.exception.PlatformException; | ||
14 | +import com.yoho.ufo.order.service.IBusinessLicenseService; | ||
15 | +import com.yoho.ufo.service.model.ApiResponse; | ||
16 | +import com.yoho.ufo.service.model.PageResponseBO; | ||
17 | + | ||
18 | +@RestController | ||
19 | +@RequestMapping(value = "/businessLicense") | ||
20 | +public class BusinessLicenseController { | ||
21 | + | ||
22 | + private static final Logger LOGGER = LoggerFactory.getLogger(BusinessLicenseController.class); | ||
23 | + | ||
24 | + @Autowired | ||
25 | + private IBusinessLicenseService businessLicenseService; | ||
26 | + | ||
27 | + @RequestMapping(value = "/queryList") | ||
28 | + public ApiResponse queryList(BusinessLicenseReq req) { | ||
29 | + LOGGER.info("queryList in. req is {}", req); | ||
30 | + PageResponseBO<BusinessLicenseRsp> result = businessLicenseService.queryList(req); | ||
31 | + return new ApiResponse.ApiResponseBuilder().code(200).message("查询成功").data(result).build(); | ||
32 | + } | ||
33 | + | ||
34 | + @RequestMapping(value = "/save") | ||
35 | + public ApiResponse save(@RequestBody BusinessLicenseReq req) { | ||
36 | + LOGGER.info("save in. req is {}", req); | ||
37 | + int result = businessLicenseService.save(req); | ||
38 | + if(result>0) { | ||
39 | + return new ApiResponse.ApiResponseBuilder().code(200).message("保存成功").build(); | ||
40 | + }else { | ||
41 | + return new ApiResponse.ApiResponseBuilder().code(500).message("保存失败").build(); | ||
42 | + } | ||
43 | + } | ||
44 | + | ||
45 | + @RequestMapping(value = "/queryAuditStatus") | ||
46 | + public ApiResponse queryAuditStatus(@RequestBody BusinessLicenseReq req) { | ||
47 | + LOGGER.info("queryAuditStatus in. req is {}", req); | ||
48 | + BusinessLicense bl; | ||
49 | + try { | ||
50 | + bl = businessLicenseService.getAuditRecord(req); | ||
51 | + } catch (PlatformException e) { | ||
52 | + return new ApiResponse.ApiResponseBuilder().code(500).message(e.getMessage()).build(); | ||
53 | + } | ||
54 | + | ||
55 | + if(null == bl) { | ||
56 | + return new ApiResponse.ApiResponseBuilder().code(400).message("记录不存在").build(); | ||
57 | + } | ||
58 | + | ||
59 | + String auditStatusStr = "审核中"; | ||
60 | + String info = "您的资料已提交审核,认证成功后我们将会第一时间通知您。"; | ||
61 | + if(bl.getAuditStatus().intValue() == 1) { | ||
62 | + auditStatusStr = "审核通过"; | ||
63 | + info = "您的资料已审核通过,现您可以进行商家入驻。"; | ||
64 | + }else if(bl.getAuditStatus().intValue() == 2) { | ||
65 | + auditStatusStr = "审核不通过"; | ||
66 | + info = bl.getRejectReason(); | ||
67 | + } | ||
68 | + | ||
69 | + return new ApiResponse.ApiResponseBuilder().code(200).message(info).data(auditStatusStr).build(); | ||
70 | + } | ||
71 | + | ||
72 | +} |
1 | +package com.yoho.ufo.order.service; | ||
2 | + | ||
3 | +import com.yoho.order.model.BusinessLicense; | ||
4 | +import com.yoho.order.model.BusinessLicenseReq; | ||
5 | +import com.yoho.order.model.BusinessLicenseRsp; | ||
6 | +import com.yoho.ufo.exception.PlatformException; | ||
7 | +import com.yoho.ufo.service.model.PageResponseBO; | ||
8 | + | ||
9 | +public interface IBusinessLicenseService { | ||
10 | + int save(BusinessLicenseReq req); | ||
11 | + | ||
12 | + BusinessLicense getAuditRecord(BusinessLicenseReq req) throws PlatformException; | ||
13 | + | ||
14 | + PageResponseBO<BusinessLicenseRsp> queryList(BusinessLicenseReq req); | ||
15 | + | ||
16 | + BusinessLicenseRsp getDetail(BusinessLicenseReq req); | ||
17 | +} |
1 | +package com.yoho.ufo.order.service.impl; | ||
2 | + | ||
3 | +import java.util.List; | ||
4 | + | ||
5 | +import org.apache.commons.collections.CollectionUtils; | ||
6 | +import org.apache.commons.lang.StringUtils; | ||
7 | +import org.slf4j.Logger; | ||
8 | +import org.slf4j.LoggerFactory; | ||
9 | +import org.springframework.beans.BeanUtils; | ||
10 | +import org.springframework.beans.factory.annotation.Autowired; | ||
11 | +import org.springframework.stereotype.Service; | ||
12 | + | ||
13 | +import com.google.common.collect.Lists; | ||
14 | +import com.yoho.core.common.utils.DateUtil; | ||
15 | +import com.yoho.order.dal.BusinessLicenseMapper; | ||
16 | +import com.yoho.order.model.BusinessLicense; | ||
17 | +import com.yoho.order.model.BusinessLicenseReq; | ||
18 | +import com.yoho.order.model.BusinessLicenseRsp; | ||
19 | +import com.yoho.ufo.exception.PlatformException; | ||
20 | +import com.yoho.ufo.order.service.IBusinessLicenseService; | ||
21 | +import com.yoho.ufo.service.model.PageResponseBO; | ||
22 | + | ||
23 | +/** | ||
24 | + * @author caoyan | ||
25 | + * @date 2019/1/7 | ||
26 | + */ | ||
27 | +@Service | ||
28 | +public class BusinessLicenseServiceImpl implements IBusinessLicenseService { | ||
29 | + | ||
30 | + private static final Logger LOGGER = LoggerFactory.getLogger(BusinessLicenseServiceImpl.class); | ||
31 | + | ||
32 | + @Autowired | ||
33 | + private BusinessLicenseMapper businessLicenseMapper; | ||
34 | + | ||
35 | + @Override | ||
36 | + public int save(BusinessLicenseReq req) { | ||
37 | + BusinessLicense item = new BusinessLicense(); | ||
38 | + BeanUtils.copyProperties(req, item); | ||
39 | + item.setCommitTime(DateUtil.getCurrentTimeSecond()); | ||
40 | + return businessLicenseMapper.insert(item); | ||
41 | + } | ||
42 | + | ||
43 | + @Override | ||
44 | + public BusinessLicense getAuditRecord(BusinessLicenseReq req) throws PlatformException { | ||
45 | + if(null == req.getUid()) { | ||
46 | + throw new PlatformException("用户ID为空", 400); | ||
47 | + } | ||
48 | + List<BusinessLicense> list = businessLicenseMapper.selectByUid(req.getUid()); | ||
49 | + | ||
50 | + return list.get(0); | ||
51 | + } | ||
52 | + | ||
53 | + @Override | ||
54 | + public PageResponseBO<BusinessLicenseRsp> queryList(BusinessLicenseReq req){ | ||
55 | + int total = businessLicenseMapper.selectTotalByCondition(req); | ||
56 | + if(total == 0) { | ||
57 | + return null; | ||
58 | + } | ||
59 | + | ||
60 | + List<BusinessLicense> list = businessLicenseMapper.selectByCondition(req); | ||
61 | + if(CollectionUtils.isEmpty(list)) { | ||
62 | + return null; | ||
63 | + } | ||
64 | + | ||
65 | + List<BusinessLicenseRsp> rspList = Lists.newArrayList(); | ||
66 | + for(BusinessLicense item : list) { | ||
67 | + BusinessLicenseRsp rsp = new BusinessLicenseRsp(); | ||
68 | + rsp.setId(item.getId()); | ||
69 | + rsp.setUid(item.getUid()); | ||
70 | + rsp.setBusinessType(item.getBusinessType()); | ||
71 | + rsp.setBusinessTypeStr(getBusinessTypeStr(item.getBusinessType())); | ||
72 | + rsp.setCertName(item.getCertName()); | ||
73 | + rsp.setCertNo(item.getCertNo()); | ||
74 | + rsp.setCommitTime(DateUtil.getDateStrBySecond(item.getCommitTime(), "yyyy/MM/dd HH:mm:ss")); | ||
75 | + rsp.setAuditStatus(item.getAuditStatus()); | ||
76 | + rsp.setAuditStatusStr(getAuditStatusStr(item.getAuditStatus())); | ||
77 | + rsp.setAuditTime(null == item.getAuditTime() ? "/" : DateUtil.getDateStrBySecond(item.getAuditTime(), "yyyy/MM/dd HH:mm:ss")); | ||
78 | + rsp.setRejectReason(StringUtils.isEmpty(item.getRejectReason()) ? "/" : item.getRejectReason()); | ||
79 | + | ||
80 | + rspList.add(rsp); | ||
81 | + } | ||
82 | + | ||
83 | + PageResponseBO<BusinessLicenseRsp> result=new PageResponseBO<>(); | ||
84 | + result.setList(rspList); | ||
85 | + result.setPage(req.getPage()); | ||
86 | + result.setSize(req.getSize()); | ||
87 | + result.setTotal(total); | ||
88 | + | ||
89 | + return result; | ||
90 | + } | ||
91 | + | ||
92 | + @Override | ||
93 | + public BusinessLicenseRsp getDetail(BusinessLicenseReq req) { | ||
94 | + BusinessLicense bl = businessLicenseMapper.selectById(req.getId()); | ||
95 | + if(null == bl) { | ||
96 | + return null; | ||
97 | + } | ||
98 | + | ||
99 | + BusinessLicenseRsp rsp = new BusinessLicenseRsp(); | ||
100 | + BeanUtils.copyProperties(bl, rsp, BusinessLicenseRsp.class); | ||
101 | + rsp.setBusinessTypeStr(getBusinessTypeStr(bl.getBusinessType())); | ||
102 | + | ||
103 | + return rsp; | ||
104 | + } | ||
105 | + | ||
106 | + private String getBusinessTypeStr(int type) { | ||
107 | + if(type == 1) { | ||
108 | + return "个体工商户"; | ||
109 | + }else if(type == 2) { | ||
110 | + return "企业法人"; | ||
111 | + } | ||
112 | + | ||
113 | + return StringUtils.EMPTY; | ||
114 | + } | ||
115 | + | ||
116 | + private String getAuditStatusStr(int status) { | ||
117 | + if(status == 0) { | ||
118 | + return "待审核"; | ||
119 | + }else if(status == 1) { | ||
120 | + return "审核通过"; | ||
121 | + }else if(status == 2) { | ||
122 | + return "审核不通过"; | ||
123 | + } | ||
124 | + return ""; | ||
125 | + } | ||
126 | +} |
@@ -38,6 +38,7 @@ datasources: | @@ -38,6 +38,7 @@ datasources: | ||
38 | - com.yoho.order.dal.QiniuLiveRecordMapper | 38 | - com.yoho.order.dal.QiniuLiveRecordMapper |
39 | - com.yoho.order.dal.CameraRecordMapper | 39 | - com.yoho.order.dal.CameraRecordMapper |
40 | - com.yoho.order.dal.UserCameraRecordMapper | 40 | - com.yoho.order.dal.UserCameraRecordMapper |
41 | + - com.yoho.order.dal.BusinessLicenseMapper | ||
41 | 42 | ||
42 | ufo_resource: | 43 | ufo_resource: |
43 | servers: | 44 | servers: |
@@ -38,6 +38,7 @@ datasources: | @@ -38,6 +38,7 @@ datasources: | ||
38 | - com.yoho.order.dal.QiniuLiveRecordMapper | 38 | - com.yoho.order.dal.QiniuLiveRecordMapper |
39 | - com.yoho.order.dal.CameraRecordMapper | 39 | - com.yoho.order.dal.CameraRecordMapper |
40 | - com.yoho.order.dal.UserCameraRecordMapper | 40 | - com.yoho.order.dal.UserCameraRecordMapper |
41 | + - com.yoho.order.dal.BusinessLicenseMapper | ||
41 | 42 | ||
42 | ufo_resource: | 43 | ufo_resource: |
43 | servers: | 44 | servers: |
1 | +<!DOCTYPE html> | ||
2 | +<html> | ||
3 | +<head> | ||
4 | + <meta charset="UTF-8"/> | ||
5 | + <title>Yoho!Buy运营平台</title> | ||
6 | + <script src="/ufoPlatform/js/include.js"></script> | ||
7 | + <style> | ||
8 | + .selected{background: #5bc0de; color:#fff; } | ||
9 | + </style> | ||
10 | + | ||
11 | + <style type="text/css"> | ||
12 | + .nav li {float:left; list-style:none;} | ||
13 | + .nav li a{float:left;text-decoration:none;padding:0.2em 1.6em;border-right:1px solid white;color:black; font-size:14px;} | ||
14 | +</style> | ||
15 | + | ||
16 | +</head> | ||
17 | +<body class="easyui-layout"> | ||
18 | +<div region="north" style="height:230px;"> | ||
19 | + <script> | ||
20 | + document.write(addHead('营业执照认证', '商户入驻资质审核')); | ||
21 | + </script> | ||
22 | + <div style="margin-left: 10px;margin-top: 30px"> | ||
23 | + <div style="border:1px solid #ddd;border-radius:5px 5px 5px 5px;"> | ||
24 | + <div style="margin-left: 10px;margin-top: 20px;margin-bottom: 20px"> | ||
25 | + <input id="uid" name="uid" /> | ||
26 | + <input id="businessName" name="businessName" /> | ||
27 | + <input id="validStatus" name="validStatus" /> | ||
28 | + <a id="searchBtn" class="btn-info">筛选</a> | ||
29 | + <a id="allBtn" class="btn-success">全部</a> | ||
30 | + </div> | ||
31 | + </div> | ||
32 | + </div> | ||
33 | +</div> | ||
34 | + | ||
35 | +<div id="businessList" region="center"> | ||
36 | + <table id="businessListTable"></table> | ||
37 | +</div> | ||
38 | +<script> | ||
39 | +$(function() { | ||
40 | + $("#uid").textbox({ | ||
41 | + prompt: "用户UID", | ||
42 | + width: 200 | ||
43 | + }); | ||
44 | + | ||
45 | + $("#businessName").textbox({ | ||
46 | + prompt: "商家名称", | ||
47 | + width: 200 | ||
48 | + }); | ||
49 | + | ||
50 | + $("#validStatus").combobox({ | ||
51 | + prompt: "入驻状态", | ||
52 | + width: 150, | ||
53 | + editable : false, | ||
54 | + data: [ | ||
55 | + {"text" : "已入驻", "value" : 1}, | ||
56 | + {"text" : "已退驻", "value" : 9} | ||
57 | + ] | ||
58 | + }); | ||
59 | + | ||
60 | + $("#searchBtn").linkbutton({ | ||
61 | + iconCls : "icon-search", | ||
62 | + onClick : function() { | ||
63 | + $("#businessListTable").datagrid("load", { | ||
64 | + uid : $("#uid").val(), | ||
65 | + businessName : $("#businessName").val(), | ||
66 | + validStatus : $("#validStatus").myCombobox("getValue") | ||
67 | + }); | ||
68 | + } | ||
69 | + }); | ||
70 | + | ||
71 | + //全部按钮 | ||
72 | + $("#allBtn").linkbutton({ | ||
73 | + iconCls: "icon-import", | ||
74 | + onClick: function () { | ||
75 | + $("#uid").textbox('setValue',''); | ||
76 | + $("#businessName").textbox('setValue',''); | ||
77 | + $("#validStatus").combobox('setValue',''); | ||
78 | + } | ||
79 | + }); | ||
80 | + | ||
81 | + getBusinessList(); | ||
82 | +}); | ||
83 | + | ||
84 | +function getBusinessList(){ | ||
85 | + $("#businessListTable").myDatagrid({ | ||
86 | + fit: true, | ||
87 | + fitColumns: true, | ||
88 | + striped: true, | ||
89 | + url: contextPath + "/businessLicense/queryList", | ||
90 | + method: 'POST', | ||
91 | + loadFilter: function (data) { | ||
92 | + var temp = defaultLoadFilter(data); | ||
93 | + temp=null==temp?[]:temp; | ||
94 | + temp.rows = temp.list; | ||
95 | + return temp; | ||
96 | + }, | ||
97 | + | ||
98 | + columns: [[{ | ||
99 | + title: "UID", | ||
100 | + field: "uid", | ||
101 | + width: 20, | ||
102 | + align: "center" | ||
103 | + }, { | ||
104 | + title: "商户类型", | ||
105 | + field: "businessTypeStr", | ||
106 | + width: 20, | ||
107 | + align: "center" | ||
108 | + }, { | ||
109 | + title: "姓名", | ||
110 | + field: "certName", | ||
111 | + width: 20, | ||
112 | + align: "center" | ||
113 | + }, { | ||
114 | + title: "身份证号", | ||
115 | + field: "certNo", | ||
116 | + width: 30, | ||
117 | + align: "center" | ||
118 | + }, { | ||
119 | + title: "提交时间", | ||
120 | + field: "commitTime", | ||
121 | + width: 30, | ||
122 | + align: "center" | ||
123 | + }, { | ||
124 | + title: "审核状态", | ||
125 | + field: "auditStatusStr", | ||
126 | + width: 20, | ||
127 | + align: "center" | ||
128 | + }, { | ||
129 | + title: "审核时间", | ||
130 | + field: "auditTime", | ||
131 | + width: 30, | ||
132 | + align: "center" | ||
133 | + }, { | ||
134 | + title: "原因", | ||
135 | + field: "rejectReason", | ||
136 | + width: 30, | ||
137 | + align: "center" | ||
138 | + }, { | ||
139 | + title: "操作", | ||
140 | + field: "asdf", | ||
141 | + width: 30, | ||
142 | + align: "center", | ||
143 | + formatter: function (value, rowData, rowIndex) { | ||
144 | + var str = "<a role='detail' dataId='"+ rowData.id +"' style='margin-left:10px;background-color: #428bca !important;'>查看</a>"; | ||
145 | + if(rowData.auditStatus==0){ | ||
146 | + str = "<a role='audit' dataId='"+ rowData.id +"' style='margin-left:10px;background-color: #5cb85c !important;'>审核</a>" + str; | ||
147 | + } | ||
148 | + return str; | ||
149 | + } | ||
150 | + }]], | ||
151 | + cache: false, | ||
152 | + pagination: true, | ||
153 | + pageSize: 10, | ||
154 | + idField: "id", | ||
155 | + singleSelect: true, | ||
156 | + onLoadSuccess: function (data) { | ||
157 | + $(this).datagrid("getPanel").find("a[role='detail']").linkbutton({ | ||
158 | + onClick: function () { | ||
159 | + var orderCode = $(this).attr("dataId"); | ||
160 | + window.open(contextPath + "/html/orderManage/detail.html?orderCode=" + orderCode + "&ver=" + new Date().getTime()) | ||
161 | + } | ||
162 | + }); | ||
163 | + | ||
164 | + $(this).datagrid("getPanel").find("a[role='audit']").linkbutton({ | ||
165 | + onClick: function () { | ||
166 | + var orderCode = $(this).attr("dataId"); | ||
167 | + window.open(contextPath + "/html/orderManage/detail.html?orderCode=" + orderCode + "&ver=" + new Date().getTime()) | ||
168 | + } | ||
169 | + }); | ||
170 | + | ||
171 | + } | ||
172 | + }); | ||
173 | +} | ||
174 | + | ||
175 | +</script> | ||
176 | +</body> | ||
177 | +</html> |
-
Please register or login to post a comment