Commit fca18a41 by 陶光胜

Merge branch 'developer' into 'master'

Developer

See merge request !26
parents ee2f9e08 e6bcad1d
......@@ -9,7 +9,8 @@ package com.gic.enterprise.constant;
public enum AuditTypeEnum {
NORMAL(0, "普通审批项"),
RISK_MODE(1, "风险模式审批"),
DOWNLOAD_REPORT(2, "下载申请")
DOWNLOAD_REPORT(2, "下载申请"),
HAOBAN(3, "好办")
;
private Integer code;
......
......@@ -14,6 +14,7 @@ import java.util.Date;
public class AuditLogDTO implements Serializable {
private static final long serialVersionUID = -5504276110192964185L;
public interface ApplyValid {}
/**
......@@ -117,6 +118,15 @@ public class AuditLogDTO implements Serializable {
private String position;
private String projectName;
private String applyUserPhone;
private String auditUrl;
public String getAuditUrl() {
return auditUrl;
}
public void setAuditUrl(String auditUrl) {
this.auditUrl = auditUrl;
}
public Integer getAuditLogId() {
return auditLogId;
......
......@@ -29,6 +29,15 @@ public class DataActuallyPaidConfig implements Serializable{
*/
private Integer performanceCount;
/**
* 是否已经配置过会员业务
*/
private boolean hasConfigMemberBusiness;
/**
* 是否已经配置过业绩统计
*/
private boolean hasConfigPerformanceCount;
public Integer getEnterpriseId() {
return enterpriseId;
}
......@@ -55,4 +64,22 @@ public class DataActuallyPaidConfig implements Serializable{
this.performanceCount = performanceCount;
return this;
}
public boolean isHasConfigMemberBusiness() {
return hasConfigMemberBusiness;
}
public DataActuallyPaidConfig setHasConfigMemberBusiness(boolean hasConfigMemberBusiness) {
this.hasConfigMemberBusiness = hasConfigMemberBusiness;
return this;
}
public boolean isHasConfigPerformanceCount() {
return hasConfigPerformanceCount;
}
public DataActuallyPaidConfig setHasConfigPerformanceCount(boolean hasConfigPerformanceCount) {
this.hasConfigPerformanceCount = hasConfigPerformanceCount;
return this;
}
}
......@@ -56,13 +56,27 @@ public interface DataConfigApiService {
* @Description:

* @author guojuxing
* @param enterpriseId
* @param memberBusiness 会员业务 1:开启
* @param performanceCount
业绩统计 1:开启
* @param memberBusiness 会员业务 1:开启 0:关闭 null则不变化会员业务
* @param performanceCount
业绩统计 1:开启 0:关闭 null则不变化业绩统计配置
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>


*/
ServiceResponse<Void> configActuallyPaid(Integer enterpriseId, Integer memberBusiness, Integer performanceCount);
/**
* 是否已经配置过会员业务(实付)
* @param enterpriseId
* @return
*/
ServiceResponse<Boolean> hasConfigMemberBusiness(Integer enterpriseId);
/**
* 是否已经配置过业绩统计(实付)
* @param enterpriseId
* @return
*/
ServiceResponse<Boolean> hasConfigPerformanceCount(Integer enterpriseId);
/**
* 实付配置信息
* @Title: listActuallyPaidConfig

* @Description:
......
......@@ -157,6 +157,13 @@ public interface EnterpriseApiService {
ServiceResponse<List<EnterpriseDTO>> listEnterpriseByName(String search);
/**
* 商户名称/公司名称精确查询
* @param search 精确查询。如果是空,则查询全部
* @return
*/
ServiceResponse<List<EnterpriseDTO>> listEnterpriseBySearch(String search);
/**
* 商户初始化标志改成已初始化状态
* @Title: initEnterprise

* @Description:
......
......@@ -57,4 +57,6 @@ public interface TabDataActuallyPaidConfigMapper {
List<TabDataActuallyPaidConfig> listByEnterpriseId(Integer enterpriseId);
int delete(@Param("enterpriseId") Integer enterpriseId, @Param("classify") Integer classify);
int count(@Param("enterpriseId") Integer enterpriseId, @Param("classify") Integer classify);
}
\ No newline at end of file
......@@ -115,6 +115,8 @@ public interface TabEnterpriseMapper {

 */
List<TabEnterprise> listEnterpriseByName(@Param("search")String search);
List<TabEnterprise> listEnterpriseBySearch(@Param("search")String search);
/**
* 查询商户列表数据
......
......@@ -32,8 +32,16 @@ public interface DataActuallyPaidConfigService {
* @Description:

* @author guojuxing
* @param enterpriseId
* @param classify

* @param classify
count
* @return int


*/
int delete(Integer enterpriseId, Integer classify);
/**
* 查询无效的记录,用于判断是否修改过配置,如果修改过,不允许再次edit
* @param enterpriseId
* @param classify
* @return
*/
int count(Integer enterpriseId, Integer classify);
}
......@@ -117,6 +117,8 @@ public interface EnterpriseService {

 */
List<EnterpriseDTO> listEnterpriseByName(String search);
List<EnterpriseDTO> listEnterpriseBySearch(String search);
/**
* 查询所有的商户
* @Title: listEnterprise

......
......@@ -36,4 +36,9 @@ public class DataActuallyPaidConfigServiceImpl implements DataActuallyPaidConfig
public int delete(Integer enterpriseId, Integer classify) {
return tabDataActuallyPaidConfigMapper.delete(enterpriseId, classify);
}
@Override
public int count(Integer enterpriseId, Integer classify) {
return tabDataActuallyPaidConfigMapper.count(enterpriseId, classify);
}
}
......@@ -106,6 +106,15 @@ public class EnterpriseServiceImpl implements EnterpriseService{
}
@Override
public List<EnterpriseDTO> listEnterpriseBySearch(String search) {
List<TabEnterprise> list = tabEnterpriseMapper.listEnterpriseBySearch(search);
if (CollectionUtils.isNotEmpty(list)) {
return EntityUtil.changeEntityListNew(EnterpriseDTO.class, list);
}
return new ArrayList<>();
}
@Override
public List<EnterpriseDTO> listEnterprise() {
List<TabEnterprise> list = tabEnterpriseMapper.listEnterprise();
if (CollectionUtils.isNotEmpty(list)) {
......
......@@ -97,23 +97,24 @@ public class AuditLogApiServiceImpl implements AuditLogApiService {
auditLogDTO.setProjectItemId(projectItem.getProjectItemId());
auditLogDTO.setProjectItemName(projectItem.getProjectItemName());
// 判断申请人是否存在
ServiceResponse<UserDTO> userServiceResponse = userApiService.getUserInfoById(auditLogDTO.getApplyUserId());
if (!userServiceResponse.isSuccess()) {
return EnterpriseServiceResponse.failure(ErrorCode.NOTEXISTS);
}
auditLogDTO.setApplyUserName(userServiceResponse.getResult().getUserName());
auditLogDTO.setApplyUserPhone(userServiceResponse.getResult().getPhoneNumber());
// 如果审批项是被禁用的 直接通过
if (projectItem.getUseStatus() == 0 || userServiceResponse.getResult().getSuperAdmin() == 1) {
String extraInfo = auditLogDTO.getExtraInfo();
JSONObject jsonObject = JSON.parseObject(extraInfo);
jsonObject.put("auditResult", DataSecurityAuditEnum.PASS.getCode());
String[] callback = projectItem.getCallbackUrl().split(GlobalInfo.FLAG_COMMA);
AsyncCallbackUtils.callBack(jsonObject, callback[0], callback[1]);
return EnterpriseServiceResponse.success();
if (!AuditTypeEnum.HAOBAN.getCode().equals(auditLogDTO.getAuditType())) {
// 如果不是好办的 需要判断申请人
ServiceResponse<UserDTO> userServiceResponse = userApiService.getUserInfoById(auditLogDTO.getApplyUserId());
if (!userServiceResponse.isSuccess()) {
return EnterpriseServiceResponse.failure(ErrorCode.NOTEXISTS);
}
auditLogDTO.setApplyUserName(userServiceResponse.getResult().getUserName());
auditLogDTO.setApplyUserPhone(userServiceResponse.getResult().getPhoneNumber());
// 如果审批项是被禁用的 直接通过
if (projectItem.getUseStatus() == 0 || userServiceResponse.getResult().getSuperAdmin() == 1) {
String extraInfo = auditLogDTO.getExtraInfo();
JSONObject jsonObject = JSON.parseObject(extraInfo);
jsonObject.put("auditResult", DataSecurityAuditEnum.PASS.getCode());
String[] callback = projectItem.getCallbackUrl().split(GlobalInfo.FLAG_COMMA);
AsyncCallbackUtils.callBack(jsonObject, callback[0], callback[1]);
return EnterpriseServiceResponse.success();
}
}
if (Constants.NORMAL_STATUS.equals(projectItem.getIsPlatform())) {
// todo 如果是平台审批项, 同一个平台审批项 如果24小时内有审核成功的,就拒绝提交
......@@ -354,7 +355,12 @@ public class AuditLogApiServiceImpl implements AuditLogApiService {
String position = userTypeEnum != null ? userTypeEnum.getMessage() : "";
String[] keyWord = {enterprise.getEnterpriseName(), auditLogDTO.getApplyUserName(), position, auditLogDTO.getProjectItemName()};
// todo 跳转地址
String url = String.format("%s/damo-system/wechat-approve.html?auditLogId=%d&openid=%s", config.getHost(), auditLogDTO.getAuditLogId(), auditorDTO.getOpenid());
String url;
if (AuditTypeEnum.HAOBAN.getCode().equals(auditLogDTO.getAuditType())) {
url = auditLogDTO.getAuditUrl();
} else {
url = String.format("%s/damo-system/wechat-approve.html?auditLogId=%d&openid=%s", config.getHost(), auditLogDTO.getAuditLogId(), auditorDTO.getOpenid());
}
logger.info("微信跳转 url:{}", url);
this.wxTemplateRouterApiService.sendForDownloadData(auditorDTO.getOpenid(), url, keyWord);
}
......
......@@ -97,6 +97,9 @@ public class DataConfigApiServiceImpl implements DataConfigApiService {
if (dto.getClassify() == null) {
dto.setClassify(1);
}
if (dataActuallyPaidConfigService.count(dto.getEnterpriseId(), dto.getClassify()) > 0) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "已经配置过,不允许再次配置");
}
dataActuallyPaidConfigService.delete(dto.getEnterpriseId(), dto.getClassify());
dto.setConfigStatus(Optional.ofNullable(dto.getConfigStatus()).orElse(0));
dataActuallyPaidConfigService.saveActuallyPaidConfig(dto);
......@@ -106,37 +109,46 @@ public class DataConfigApiServiceImpl implements DataConfigApiService {
@Override
public ServiceResponse<Void> configActuallyPaid(Integer enterpriseId, Integer memberBusiness, Integer performanceCount) {
if (memberBusiness == null) {
memberBusiness = 0;
List<DataActuallyPaidConfigDTO> list = new ArrayList<>(5);
if (memberBusiness != null) {
list.add(new DataActuallyPaidConfigDTO()
.setEnterpriseId(enterpriseId)
.setClassify(1)
.setConfigStatus(memberBusiness));
list.add(new DataActuallyPaidConfigDTO()
.setEnterpriseId(enterpriseId)
.setClassify(2)
.setConfigStatus(memberBusiness));
}
if (performanceCount == null) {
performanceCount = 0;
if (performanceCount != null) {
list.add(new DataActuallyPaidConfigDTO()
.setEnterpriseId(enterpriseId)
.setClassify(3)
.setConfigStatus(performanceCount));
list.add(new DataActuallyPaidConfigDTO()
.setEnterpriseId(enterpriseId)
.setClassify(4)
.setConfigStatus(performanceCount));
list.add(new DataActuallyPaidConfigDTO()
.setEnterpriseId(enterpriseId)
.setClassify(5)
.setConfigStatus(performanceCount));
}
List<DataActuallyPaidConfigDTO> list = new ArrayList<>(5);
list.add(new DataActuallyPaidConfigDTO()
.setEnterpriseId(enterpriseId)
.setClassify(1)
.setConfigStatus(memberBusiness));
list.add(new DataActuallyPaidConfigDTO()
.setEnterpriseId(enterpriseId)
.setClassify(2)
.setConfigStatus(memberBusiness));
list.add(new DataActuallyPaidConfigDTO()
.setEnterpriseId(enterpriseId)
.setClassify(3)
.setConfigStatus(performanceCount));
list.add(new DataActuallyPaidConfigDTO()
.setEnterpriseId(enterpriseId)
.setClassify(4)
.setConfigStatus(performanceCount));
list.add(new DataActuallyPaidConfigDTO()
.setEnterpriseId(enterpriseId)
.setClassify(5)
.setConfigStatus(performanceCount));
return configActuallyPaid(list);
}
@Override
public ServiceResponse<Boolean> hasConfigMemberBusiness(Integer enterpriseId) {
return ServiceResponse.success(dataActuallyPaidConfigService.count(enterpriseId, 1) > 0);
}
@Override
public ServiceResponse<Boolean> hasConfigPerformanceCount(Integer enterpriseId) {
return ServiceResponse.success(dataActuallyPaidConfigService.count(enterpriseId, 3) > 0);
}
@Override
public ServiceResponse<List<DataActuallyPaidConfigDTO>> listActuallyPaidConfig(Integer enterpriseId) {
List<TabDataActuallyPaidConfig> list = dataActuallyPaidConfigService.listByEnterpriseId(enterpriseId);
if (CollectionUtils.isEmpty(list)) {
......@@ -158,7 +170,9 @@ public class DataConfigApiServiceImpl implements DataConfigApiService {
return ServiceResponse.success(new DataActuallyPaidConfig()
.setEnterpriseId(enterpriseId)
.setMemberBusiness(memberBusiness)
.setPerformanceCount(performanceCount));
.setPerformanceCount(performanceCount)
.setHasConfigMemberBusiness(dataActuallyPaidConfigService.count(enterpriseId, 1) > 0)
.setHasConfigPerformanceCount(dataActuallyPaidConfigService.count(enterpriseId, 3) > 0));
}
return ServiceResponse.success(new DataActuallyPaidConfig().setEnterpriseId(enterpriseId).setMemberBusiness(0).setPerformanceCount(0));
}
......
......@@ -368,6 +368,11 @@ public class EnterpriseApiServiceImpl implements EnterpriseApiService {
}
@Override
public ServiceResponse<List<EnterpriseDTO>> listEnterpriseBySearch(String search) {
return ServiceResponse.success(enterpriseService.listEnterpriseBySearch(search));
}
@Override
public ServiceResponse initEnterprise(Integer enterpriseId) {
TabEnterprise tabEnterprise = enterpriseService.getEnterpriseById(enterpriseId);
if (tabEnterprise == null) {
......
......@@ -130,4 +130,11 @@
and classify = #{classify}
and status = 1
</update>
<select id="count" resultType="int">
select count(1) from tab_data_actually_paid_config
where enterprise_id = #{enterpriseId}
and classify = #{classify}
and status = 0
</select>
</mapper>
\ No newline at end of file
......@@ -343,6 +343,16 @@
</if>
</select>
<select id="listEnterpriseBySearch" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_enterprise
where status = 1
<if test="search != null and search != '' ">
and ( enterprise_name = #{search} or company_name = #{search} )
</if>
</select>
<select id="listEnterprise" resultMap="BaseResultMap">
select
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment