提交代码

yy_dev
胡锐 2 years ago
parent c176ee986f
commit 18a2c33fee
  1. 160
      cweb/src/main/java/com/cweb/controller/BsAuditController.java
  2. 53
      cweb/src/main/java/com/cweb/controller/BsMerSettleAcctController.java
  3. 16
      service/src/main/java/com/hfkj/channel/saas/SaasMerService.java
  4. 147
      service/src/main/java/com/hfkj/dao/BsAuditMapper.java
  5. 7
      service/src/main/java/com/hfkj/dao/BsAuditMapperExt.java
  6. 402
      service/src/main/java/com/hfkj/dao/BsAuditSqlProvider.java
  7. 9
      service/src/main/java/com/hfkj/dao/BsMerSettleAcctApplyMapper.java
  8. 14
      service/src/main/java/com/hfkj/dao/BsMerSettleAcctApplySqlProvider.java
  9. 312
      service/src/main/java/com/hfkj/entity/BsAudit.java
  10. 1333
      service/src/main/java/com/hfkj/entity/BsAuditExample.java
  11. 16
      service/src/main/java/com/hfkj/entity/BsMerSettleAcctApply.java
  12. 70
      service/src/main/java/com/hfkj/entity/BsMerSettleAcctApplyExample.java
  13. 19
      service/src/main/java/com/hfkj/model/BsAuditModel.java
  14. 74
      service/src/main/java/com/hfkj/service/BsAuditService.java
  15. 32
      service/src/main/java/com/hfkj/service/BsMerSettleAcctApplyService.java
  16. 162
      service/src/main/java/com/hfkj/service/impl/BsAuditServiceImpl.java
  17. 34
      service/src/main/java/com/hfkj/service/impl/BsDeviceOrderServiceImpl.java
  18. 68
      service/src/main/java/com/hfkj/service/impl/BsMerSettleAcctApplyServiceImpl.java
  19. 40
      service/src/main/java/com/hfkj/sysenum/AuditStatusEnum.java
  20. 38
      service/src/main/java/com/hfkj/sysenum/AuditVocationalWorkType.java
  21. 1
      service/src/main/java/com/hfkj/sysenum/DeviceTypeEnum.java
  22. 2
      service/src/main/java/com/hfkj/sysenum/MerSettleAcctApplyStatus.java

@ -0,0 +1,160 @@
package com.cweb.controller;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.common.security.UserCenter;
import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.entity.BsAudit;
import com.hfkj.entity.BsMer;
import com.hfkj.entity.BsMerSettleAcctApply;
import com.hfkj.entity.SecRegion;
import com.hfkj.model.ResponseData;
import com.hfkj.model.UserInfoModel;
import com.hfkj.service.BsAuditService;
import com.hfkj.service.BsMerService;
import com.hfkj.service.BsMerSettleAcctApplyService;
import com.hfkj.service.CommonService;
import com.hfkj.sysenum.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;
@Controller
@Api(value = "商户审核")
@RequestMapping(value = "/audit")
public class BsAuditController {
private static Logger log = LoggerFactory.getLogger(BsAuditController.class);
@Resource
private UserCenter userCenter;
@Resource
private BsAuditService auditService;
@RequestMapping(value="/approve",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "通过")
public ResponseData approve(@RequestBody JSONObject body) {
try {
if (body == null || StringUtils.isBlank(body.getString("auditNo"))) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class);
if (userInfoModel == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.SEC_USER_EXPIRED, "");
}
// 查询审核
BsAudit audit = auditService.getAuditDetailByNo(body.getString("auditNo"));
if (audit == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的审批");
}
if (!audit.getStatus().equals(AuditStatusEnum.status1.getNumber())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "操作失败,审批状态不处于待审批");
}
if (!userInfoModel.getAgent().getId().equals(audit.getReviewedUserId())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "操作失败,审批审核人校验不通过");
}
auditService.approve(audit.getId());
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
log.error(e.getMessage(), e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/reject",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "驳回")
public ResponseData reject(@RequestBody JSONObject body) {
try {
if (body == null || body.getString("auditNo") == null || StringUtils.isBlank(body.getString("rejectReason"))) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class);
if (userInfoModel == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.SEC_USER_EXPIRED, "");
}
// 查询审核
BsAudit audit = auditService.getAuditDetailByNo(body.getString("auditNo"));
if (audit == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的审批");
}
if (!audit.getStatus().equals(AuditStatusEnum.status1.getNumber())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "操作失败,审批状态不处于待审批");
}
if (!userInfoModel.getAgent().getId().equals(audit.getReviewedUserId())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "操作失败,审批审核人校验不通过");
}
auditService.reject(audit.getId(), body.getString("rejectReason"));
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
log.error(e.getMessage(), e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/getAuditDetail",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询审核详情")
public ResponseData getAuditDetail(@RequestParam(value = "applyNo" , required = true) String applyNo) {
try {
return ResponseMsgUtil.success(auditService.getAuditDetailByNo(applyNo));
} catch (Exception e) {
log.error(e.getMessage(), e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/getAuditList",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询审核列表")
public ResponseData getAuditList(@RequestParam(value = "auditNo" , required = false) String auditNo,
@RequestParam(value = "status" , required = false) Integer status,
@RequestParam(value = "pageNum" , required = true) Integer pageNum,
@RequestParam(value = "pageSize" , required = true) Integer pageSize) {
try {
UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class);
if (userInfoModel == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.SEC_USER_EXPIRED, "");
}
Map<String,Object> param = new HashMap<>();
param.put("auditNo", auditNo);
param.put("status", status);
if (userInfoModel.getSecUser().getObjectType().equals(SecUserTypeEnum.type2.getNumber())) {
param.put("reviewedUserId", userInfoModel.getAgent().getId());
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无权限访问");
}
PageHelper.startPage(pageNum, pageSize);
return ResponseMsgUtil.success(new PageInfo<>(auditService.getAuditList(param)));
} catch (Exception e) {
log.error(e.getMessage(), e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -42,10 +42,8 @@ import java.util.*;
public class BsMerSettleAcctController { public class BsMerSettleAcctController {
private static Logger log = LoggerFactory.getLogger(BsMerSettleAcctController.class); private static Logger log = LoggerFactory.getLogger(BsMerSettleAcctController.class);
@Resource @Resource
private BsMerSettleAcctApplyService merSettleAcctApplyService; private BsMerSettleAcctApplyService merSettleAcctApplyService;
@Resource @Resource
private BsMerService merService; private BsMerService merService;
@Resource @Resource
@ -77,6 +75,13 @@ public class BsMerSettleAcctController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
} }
// 查询申请
BsMerSettleAcctApply apply = merSettleAcctApplyService.getLastApplyByMer(merSettleAcct.getMerId());
if (apply != null && apply.getStatus().equals(MerSettleAcctApplyStatus.status2.getNumber())) {
log.error("configMerBasis error!","参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "已有修改结算申请,请勿重复提交");
}
SecRegion openningBankArea = commonService.getRegionsById(merSettleAcct.getOpenningBankAreaCode()); SecRegion openningBankArea = commonService.getRegionsById(merSettleAcct.getOpenningBankAreaCode());
if (openningBankArea == null) { if (openningBankArea == null) {
log.error("configMerBasis error!","参数错误"); log.error("configMerBasis error!","参数错误");
@ -106,8 +111,7 @@ public class BsMerSettleAcctController {
log.error("configMerBasis error!","未知商户"); log.error("configMerBasis error!","未知商户");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知商户"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知商户");
} }
if ((!bsMer.getMerStatus().equals(MerStatusEnum.status2.getNumber()) if (!bsMer.getMerStatus().equals(MerStatusEnum.status1.getNumber())) {
&& !bsMer.getMerStatus().equals(MerStatusEnum.status4.getNumber()))) {
log.error("configMerBasis error!","状态错误"); log.error("configMerBasis error!","状态错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.STATUS_ERROR, ""); throw ErrorHelp.genException(SysCode.System, ErrorCode.STATUS_ERROR, "");
} }
@ -127,6 +131,7 @@ public class BsMerSettleAcctController {
// 对公结算、对私法人结算 // 对公结算、对私法人结算
merSettleAcct.setSettleIdCardName(bsMer.getLarName()); merSettleAcct.setSettleIdCardName(bsMer.getLarName());
merSettleAcct.setSettleIdCardNo(bsMer.getLarIdCard()); merSettleAcct.setSettleIdCardNo(bsMer.getLarIdCard());
merSettleAcct.setSettleIdCardAddress(bsMer.getLarIdCardAddress());
merSettleAcct.setSettleIdCardPortraitImg(bsMer.getLarIdCardPortraitImg()); merSettleAcct.setSettleIdCardPortraitImg(bsMer.getLarIdCardPortraitImg());
merSettleAcct.setSettleIdCardNationalEmblemImg(bsMer.getLarIdCardNationalEmblemImg()); merSettleAcct.setSettleIdCardNationalEmblemImg(bsMer.getLarIdCardNationalEmblemImg());
merSettleAcct.setSettleIdPeriodType(bsMer.getBlisPeriodType()); merSettleAcct.setSettleIdPeriodType(bsMer.getBlisPeriodType());
@ -134,9 +139,9 @@ public class BsMerSettleAcctController {
merSettleAcct.setSettleIdCardPeriodEnd(bsMer.getLarIdCardPeriodEnd()); merSettleAcct.setSettleIdCardPeriodEnd(bsMer.getLarIdCardPeriodEnd());
} }
merSettleAcct.setApplyNo(System.currentTimeMillis()+""); merSettleAcct.setMerName(bsMer.getMerName());
merSettleAcct.setStatus(MerSettleAcctApplyStatus.status1.getNumber()); merSettleAcct.setStatus(MerSettleAcctApplyStatus.status1.getNumber());
merSettleAcctApplyService.createApply(merSettleAcct);
return ResponseMsgUtil.success("申请成功"); return ResponseMsgUtil.success("申请成功");
@ -146,13 +151,41 @@ public class BsMerSettleAcctController {
} }
} }
@RequestMapping(value="/getMerDetail",method = RequestMethod.GET) @RequestMapping(value="/getApplyList",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询商户结算申请列表")
public ResponseData getApplyList(@RequestParam(value = "merId" , required = true) Long merId) {
try {
return ResponseMsgUtil.success(merSettleAcctApplyService.getApplyListByMer(merId));
} catch (Exception e) {
log.error(e.getMessage(), e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/getApplyDetail",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询商户结算申请详情")
public ResponseData getApplyDetail(@RequestParam(value = "applyId" , required = true) Long applyId) {
try {
return ResponseMsgUtil.success(merSettleAcctApplyService.getApplyById(applyId));
} catch (Exception e) {
log.error(e.getMessage(), e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/getLastApplyByMer",method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ApiOperation(value = "查询商户详情") @ApiOperation(value = "查询商户最新申请修改")
public ResponseData getMerDetail(@RequestParam(value = "merId" , required = true) Long merId) { public ResponseData getLastApplyByMer(@RequestParam(value = "merId" , required = true) Long merId) {
try { try {
return ResponseMsgUtil.success(merService.getMerDetail(merId)); return ResponseMsgUtil.success(merSettleAcctApplyService.getLastApplyByMer(merId));
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);

@ -327,17 +327,16 @@ public class SaasMerService {
Map<String,Object> header = new HashMap<>(); Map<String,Object> header = new HashMap<>();
header.put("Authorization", "bearer " + saasCommon.getUpdateToken()); header.put("Authorization", "bearer " + saasCommon.getUpdateToken());
/*
JSONObject obj = new JSONObject();
obj.put("data", Base64.encodeBase64String(RSAUtil.encryptByPrivateKey(JSONObject.toJSONString(param).getBytes(), Base64.decodeBase64(RSAUtil.PRIVATE_KEY))));*/
JSONObject responseObj = HttpsUtils.doPost(SaasConfig.requestMerUrl + "channel/customer/update/settle/" + merPlatformNo.getPlatformNo(), param, header); JSONObject responseObj = HttpsUtils.doPost(SaasConfig.requestMerUrl + "channel/customer/update/settle/" + merPlatformNo.getPlatformNo(), param, header);
System.out.println("body:" + JSONObject.toJSONString(param)); System.out.println("body:" + JSONObject.toJSONString(param));
System.out.println("response:" + responseObj.toJSONString()); System.out.println("response:" + responseObj.toJSONString());
if (responseObj == null || !responseObj.getString("code").equals("000000")) { if (responseObj == null || !responseObj.getString("message").equals("SUCCESS")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, responseObj.getString("message")); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, responseObj.getString("message"));
} }
return JSONObject.parseObject(new String(RSAUtil.decryptByPublicKey(Base64.decodeBase64(responseObj.getString("data")), Base64.decodeBase64(RSAUtil.PUBLIC_KEY)))); merSettleAcctApply.setApplyNo(responseObj.getString("reviewRelatedId"));
merSettleAcctApplyService.editData(merSettleAcctApply);
return responseObj;
} catch (Exception e) { } catch (Exception e) {
System.out.println(e); System.out.println(e);
@ -345,10 +344,13 @@ public class SaasMerService {
} }
} }
/**
* 查询修改审核
* @param reviewRelatedId 回执id
* @return
*/
public JSONObject updateReview(String reviewRelatedId) { public JSONObject updateReview(String reviewRelatedId) {
try { try {
Map<String,Object> param = new HashMap<>(); Map<String,Object> param = new HashMap<>();
param.put("reviewRelatedId", reviewRelatedId); param.put("reviewRelatedId", reviewRelatedId);

@ -0,0 +1,147 @@
package com.hfkj.dao;
import com.hfkj.entity.BsAudit;
import com.hfkj.entity.BsAuditExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;
import org.springframework.stereotype.Repository;
/**
*
* 代码由工具生成,请勿修改!!!
* 如果需要扩展请在其父类进行扩展
*
**/
@Repository
public interface BsAuditMapper extends BsAuditMapperExt {
@SelectProvider(type=BsAuditSqlProvider.class, method="countByExample")
long countByExample(BsAuditExample example);
@DeleteProvider(type=BsAuditSqlProvider.class, method="deleteByExample")
int deleteByExample(BsAuditExample example);
@Delete({
"delete from bs_audit",
"where id = #{id,jdbcType=BIGINT}"
})
int deleteByPrimaryKey(Long id);
@Insert({
"insert into bs_audit (audit_no, vocational_work_type, ",
"vocational_work_type_name, audit_object_id, ",
"audit_object_name, op_user_id, ",
"op_user_name, reviewed_user_id, ",
"reviewed_user_name, `status`, ",
"reject_reason, create_time, ",
"update_time, ext_1, ",
"ext_2, ext_3)",
"values (#{auditNo,jdbcType=VARCHAR}, #{vocationalWorkType,jdbcType=INTEGER}, ",
"#{vocationalWorkTypeName,jdbcType=VARCHAR}, #{auditObjectId,jdbcType=BIGINT}, ",
"#{auditObjectName,jdbcType=VARCHAR}, #{opUserId,jdbcType=BIGINT}, ",
"#{opUserName,jdbcType=VARCHAR}, #{reviewedUserId,jdbcType=BIGINT}, ",
"#{reviewedUserName,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ",
"#{rejectReason,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(BsAudit record);
@InsertProvider(type=BsAuditSqlProvider.class, method="insertSelective")
@Options(useGeneratedKeys=true,keyProperty="id")
int insertSelective(BsAudit record);
@SelectProvider(type=BsAuditSqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="audit_no", property="auditNo", jdbcType=JdbcType.VARCHAR),
@Result(column="vocational_work_type", property="vocationalWorkType", jdbcType=JdbcType.INTEGER),
@Result(column="vocational_work_type_name", property="vocationalWorkTypeName", jdbcType=JdbcType.VARCHAR),
@Result(column="audit_object_id", property="auditObjectId", jdbcType=JdbcType.BIGINT),
@Result(column="audit_object_name", property="auditObjectName", jdbcType=JdbcType.VARCHAR),
@Result(column="op_user_id", property="opUserId", jdbcType=JdbcType.BIGINT),
@Result(column="op_user_name", property="opUserName", jdbcType=JdbcType.VARCHAR),
@Result(column="reviewed_user_id", property="reviewedUserId", jdbcType=JdbcType.BIGINT),
@Result(column="reviewed_user_name", property="reviewedUserName", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="reject_reason", property="rejectReason", jdbcType=JdbcType.VARCHAR),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
})
List<BsAudit> selectByExample(BsAuditExample example);
@Select({
"select",
"id, audit_no, vocational_work_type, vocational_work_type_name, audit_object_id, ",
"audit_object_name, op_user_id, op_user_name, reviewed_user_id, reviewed_user_name, ",
"`status`, reject_reason, create_time, update_time, ext_1, ext_2, ext_3",
"from bs_audit",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="audit_no", property="auditNo", jdbcType=JdbcType.VARCHAR),
@Result(column="vocational_work_type", property="vocationalWorkType", jdbcType=JdbcType.INTEGER),
@Result(column="vocational_work_type_name", property="vocationalWorkTypeName", jdbcType=JdbcType.VARCHAR),
@Result(column="audit_object_id", property="auditObjectId", jdbcType=JdbcType.BIGINT),
@Result(column="audit_object_name", property="auditObjectName", jdbcType=JdbcType.VARCHAR),
@Result(column="op_user_id", property="opUserId", jdbcType=JdbcType.BIGINT),
@Result(column="op_user_name", property="opUserName", jdbcType=JdbcType.VARCHAR),
@Result(column="reviewed_user_id", property="reviewedUserId", jdbcType=JdbcType.BIGINT),
@Result(column="reviewed_user_name", property="reviewedUserName", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="reject_reason", property="rejectReason", jdbcType=JdbcType.VARCHAR),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
})
BsAudit selectByPrimaryKey(Long id);
@UpdateProvider(type=BsAuditSqlProvider.class, method="updateByExampleSelective")
int updateByExampleSelective(@Param("record") BsAudit record, @Param("example") BsAuditExample example);
@UpdateProvider(type=BsAuditSqlProvider.class, method="updateByExample")
int updateByExample(@Param("record") BsAudit record, @Param("example") BsAuditExample example);
@UpdateProvider(type=BsAuditSqlProvider.class, method="updateByPrimaryKeySelective")
int updateByPrimaryKeySelective(BsAudit record);
@Update({
"update bs_audit",
"set audit_no = #{auditNo,jdbcType=VARCHAR},",
"vocational_work_type = #{vocationalWorkType,jdbcType=INTEGER},",
"vocational_work_type_name = #{vocationalWorkTypeName,jdbcType=VARCHAR},",
"audit_object_id = #{auditObjectId,jdbcType=BIGINT},",
"audit_object_name = #{auditObjectName,jdbcType=VARCHAR},",
"op_user_id = #{opUserId,jdbcType=BIGINT},",
"op_user_name = #{opUserName,jdbcType=VARCHAR},",
"reviewed_user_id = #{reviewedUserId,jdbcType=BIGINT},",
"reviewed_user_name = #{reviewedUserName,jdbcType=VARCHAR},",
"`status` = #{status,jdbcType=INTEGER},",
"reject_reason = #{rejectReason,jdbcType=VARCHAR},",
"create_time = #{createTime,jdbcType=TIMESTAMP},",
"update_time = #{updateTime,jdbcType=TIMESTAMP},",
"ext_1 = #{ext1,jdbcType=VARCHAR},",
"ext_2 = #{ext2,jdbcType=VARCHAR},",
"ext_3 = #{ext3,jdbcType=VARCHAR}",
"where id = #{id,jdbcType=BIGINT}"
})
int updateByPrimaryKey(BsAudit record);
}

@ -0,0 +1,7 @@
package com.hfkj.dao;
/**
* mapper扩展类
*/
public interface BsAuditMapperExt {
}

@ -0,0 +1,402 @@
package com.hfkj.dao;
import com.hfkj.entity.BsAudit;
import com.hfkj.entity.BsAuditExample.Criteria;
import com.hfkj.entity.BsAuditExample.Criterion;
import com.hfkj.entity.BsAuditExample;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.jdbc.SQL;
public class BsAuditSqlProvider {
public String countByExample(BsAuditExample example) {
SQL sql = new SQL();
sql.SELECT("count(*)").FROM("bs_audit");
applyWhere(sql, example, false);
return sql.toString();
}
public String deleteByExample(BsAuditExample example) {
SQL sql = new SQL();
sql.DELETE_FROM("bs_audit");
applyWhere(sql, example, false);
return sql.toString();
}
public String insertSelective(BsAudit record) {
SQL sql = new SQL();
sql.INSERT_INTO("bs_audit");
if (record.getAuditNo() != null) {
sql.VALUES("audit_no", "#{auditNo,jdbcType=VARCHAR}");
}
if (record.getVocationalWorkType() != null) {
sql.VALUES("vocational_work_type", "#{vocationalWorkType,jdbcType=INTEGER}");
}
if (record.getVocationalWorkTypeName() != null) {
sql.VALUES("vocational_work_type_name", "#{vocationalWorkTypeName,jdbcType=VARCHAR}");
}
if (record.getAuditObjectId() != null) {
sql.VALUES("audit_object_id", "#{auditObjectId,jdbcType=BIGINT}");
}
if (record.getAuditObjectName() != null) {
sql.VALUES("audit_object_name", "#{auditObjectName,jdbcType=VARCHAR}");
}
if (record.getOpUserId() != null) {
sql.VALUES("op_user_id", "#{opUserId,jdbcType=BIGINT}");
}
if (record.getOpUserName() != null) {
sql.VALUES("op_user_name", "#{opUserName,jdbcType=VARCHAR}");
}
if (record.getReviewedUserId() != null) {
sql.VALUES("reviewed_user_id", "#{reviewedUserId,jdbcType=BIGINT}");
}
if (record.getReviewedUserName() != null) {
sql.VALUES("reviewed_user_name", "#{reviewedUserName,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}");
}
if (record.getRejectReason() != null) {
sql.VALUES("reject_reason", "#{rejectReason,jdbcType=VARCHAR}");
}
if (record.getCreateTime() != null) {
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}");
}
if (record.getUpdateTime() != null) {
sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}");
}
if (record.getExt1() != null) {
sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}");
}
return sql.toString();
}
public String selectByExample(BsAuditExample example) {
SQL sql = new SQL();
if (example != null && example.isDistinct()) {
sql.SELECT_DISTINCT("id");
} else {
sql.SELECT("id");
}
sql.SELECT("audit_no");
sql.SELECT("vocational_work_type");
sql.SELECT("vocational_work_type_name");
sql.SELECT("audit_object_id");
sql.SELECT("audit_object_name");
sql.SELECT("op_user_id");
sql.SELECT("op_user_name");
sql.SELECT("reviewed_user_id");
sql.SELECT("reviewed_user_name");
sql.SELECT("`status`");
sql.SELECT("reject_reason");
sql.SELECT("create_time");
sql.SELECT("update_time");
sql.SELECT("ext_1");
sql.SELECT("ext_2");
sql.SELECT("ext_3");
sql.FROM("bs_audit");
applyWhere(sql, example, false);
if (example != null && example.getOrderByClause() != null) {
sql.ORDER_BY(example.getOrderByClause());
}
return sql.toString();
}
public String updateByExampleSelective(Map<String, Object> parameter) {
BsAudit record = (BsAudit) parameter.get("record");
BsAuditExample example = (BsAuditExample) parameter.get("example");
SQL sql = new SQL();
sql.UPDATE("bs_audit");
if (record.getId() != null) {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
}
if (record.getAuditNo() != null) {
sql.SET("audit_no = #{record.auditNo,jdbcType=VARCHAR}");
}
if (record.getVocationalWorkType() != null) {
sql.SET("vocational_work_type = #{record.vocationalWorkType,jdbcType=INTEGER}");
}
if (record.getVocationalWorkTypeName() != null) {
sql.SET("vocational_work_type_name = #{record.vocationalWorkTypeName,jdbcType=VARCHAR}");
}
if (record.getAuditObjectId() != null) {
sql.SET("audit_object_id = #{record.auditObjectId,jdbcType=BIGINT}");
}
if (record.getAuditObjectName() != null) {
sql.SET("audit_object_name = #{record.auditObjectName,jdbcType=VARCHAR}");
}
if (record.getOpUserId() != null) {
sql.SET("op_user_id = #{record.opUserId,jdbcType=BIGINT}");
}
if (record.getOpUserName() != null) {
sql.SET("op_user_name = #{record.opUserName,jdbcType=VARCHAR}");
}
if (record.getReviewedUserId() != null) {
sql.SET("reviewed_user_id = #{record.reviewedUserId,jdbcType=BIGINT}");
}
if (record.getReviewedUserName() != null) {
sql.SET("reviewed_user_name = #{record.reviewedUserName,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
}
if (record.getRejectReason() != null) {
sql.SET("reject_reason = #{record.rejectReason,jdbcType=VARCHAR}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
}
if (record.getUpdateTime() != null) {
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");
}
if (record.getExt1() != null) {
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}");
}
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByExample(Map<String, Object> parameter) {
SQL sql = new SQL();
sql.UPDATE("bs_audit");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("audit_no = #{record.auditNo,jdbcType=VARCHAR}");
sql.SET("vocational_work_type = #{record.vocationalWorkType,jdbcType=INTEGER}");
sql.SET("vocational_work_type_name = #{record.vocationalWorkTypeName,jdbcType=VARCHAR}");
sql.SET("audit_object_id = #{record.auditObjectId,jdbcType=BIGINT}");
sql.SET("audit_object_name = #{record.auditObjectName,jdbcType=VARCHAR}");
sql.SET("op_user_id = #{record.opUserId,jdbcType=BIGINT}");
sql.SET("op_user_name = #{record.opUserName,jdbcType=VARCHAR}");
sql.SET("reviewed_user_id = #{record.reviewedUserId,jdbcType=BIGINT}");
sql.SET("reviewed_user_name = #{record.reviewedUserName,jdbcType=VARCHAR}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
sql.SET("reject_reason = #{record.rejectReason,jdbcType=VARCHAR}");
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}");
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}");
BsAuditExample example = (BsAuditExample) parameter.get("example");
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByPrimaryKeySelective(BsAudit record) {
SQL sql = new SQL();
sql.UPDATE("bs_audit");
if (record.getAuditNo() != null) {
sql.SET("audit_no = #{auditNo,jdbcType=VARCHAR}");
}
if (record.getVocationalWorkType() != null) {
sql.SET("vocational_work_type = #{vocationalWorkType,jdbcType=INTEGER}");
}
if (record.getVocationalWorkTypeName() != null) {
sql.SET("vocational_work_type_name = #{vocationalWorkTypeName,jdbcType=VARCHAR}");
}
if (record.getAuditObjectId() != null) {
sql.SET("audit_object_id = #{auditObjectId,jdbcType=BIGINT}");
}
if (record.getAuditObjectName() != null) {
sql.SET("audit_object_name = #{auditObjectName,jdbcType=VARCHAR}");
}
if (record.getOpUserId() != null) {
sql.SET("op_user_id = #{opUserId,jdbcType=BIGINT}");
}
if (record.getOpUserName() != null) {
sql.SET("op_user_name = #{opUserName,jdbcType=VARCHAR}");
}
if (record.getReviewedUserId() != null) {
sql.SET("reviewed_user_id = #{reviewedUserId,jdbcType=BIGINT}");
}
if (record.getReviewedUserName() != null) {
sql.SET("reviewed_user_name = #{reviewedUserName,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{status,jdbcType=INTEGER}");
}
if (record.getRejectReason() != null) {
sql.SET("reject_reason = #{rejectReason,jdbcType=VARCHAR}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}");
}
if (record.getUpdateTime() != null) {
sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}");
}
if (record.getExt1() != null) {
sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}");
}
sql.WHERE("id = #{id,jdbcType=BIGINT}");
return sql.toString();
}
protected void applyWhere(SQL sql, BsAuditExample example, boolean includeExamplePhrase) {
if (example == null) {
return;
}
String parmPhrase1;
String parmPhrase1_th;
String parmPhrase2;
String parmPhrase2_th;
String parmPhrase3;
String parmPhrase3_th;
if (includeExamplePhrase) {
parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}";
parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}";
parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}";
parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}";
parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}";
parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}";
} else {
parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}";
parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}";
parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}";
parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}";
parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}";
parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}";
}
StringBuilder sb = new StringBuilder();
List<Criteria> oredCriteria = example.getOredCriteria();
boolean firstCriteria = true;
for (int i = 0; i < oredCriteria.size(); i++) {
Criteria criteria = oredCriteria.get(i);
if (criteria.isValid()) {
if (firstCriteria) {
firstCriteria = false;
} else {
sb.append(" or ");
}
sb.append('(');
List<Criterion> criterions = criteria.getAllCriteria();
boolean firstCriterion = true;
for (int j = 0; j < criterions.size(); j++) {
Criterion criterion = criterions.get(j);
if (firstCriterion) {
firstCriterion = false;
} else {
sb.append(" and ");
}
if (criterion.isNoValue()) {
sb.append(criterion.getCondition());
} else if (criterion.isSingleValue()) {
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j));
} else {
sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler()));
}
} else if (criterion.isBetweenValue()) {
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j));
} else {
sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler()));
}
} else if (criterion.isListValue()) {
sb.append(criterion.getCondition());
sb.append(" (");
List<?> listItems = (List<?>) criterion.getValue();
boolean comma = false;
for (int k = 0; k < listItems.size(); k++) {
if (comma) {
sb.append(", ");
} else {
comma = true;
}
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase3, i, j, k));
} else {
sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler()));
}
}
sb.append(')');
}
}
sb.append(')');
}
}
if (sb.length() > 0) {
sql.WHERE(sb.toString());
}
}
}

@ -40,7 +40,7 @@ public interface BsMerSettleAcctApplyMapper extends BsMerSettleAcctApplyMapperEx
@Insert({ @Insert({
"insert into bs_mer_settle_acct_apply (apply_no, apply_type, ", "insert into bs_mer_settle_acct_apply (apply_no, apply_type, ",
"mer_id, settle_type, ", "mer_id, mer_name, settle_type, ",
"commission_img, bank_card_img, ", "commission_img, bank_card_img, ",
"bank_name, bank_card_no, ", "bank_name, bank_card_no, ",
"bank_card_holder, openning_bank_city_code, ", "bank_card_holder, openning_bank_city_code, ",
@ -57,7 +57,7 @@ public interface BsMerSettleAcctApplyMapper extends BsMerSettleAcctApplyMapperEx
"create_time, update_time, ", "create_time, update_time, ",
"ext_1, ext_2, ext_3)", "ext_1, ext_2, ext_3)",
"values (#{applyNo,jdbcType=VARCHAR}, #{applyType,jdbcType=INTEGER}, ", "values (#{applyNo,jdbcType=VARCHAR}, #{applyType,jdbcType=INTEGER}, ",
"#{merId,jdbcType=BIGINT}, #{settleType,jdbcType=INTEGER}, ", "#{merId,jdbcType=BIGINT}, #{merName,jdbcType=VARCHAR}, #{settleType,jdbcType=INTEGER}, ",
"#{commissionImg,jdbcType=VARCHAR}, #{bankCardImg,jdbcType=VARCHAR}, ", "#{commissionImg,jdbcType=VARCHAR}, #{bankCardImg,jdbcType=VARCHAR}, ",
"#{bankName,jdbcType=VARCHAR}, #{bankCardNo,jdbcType=VARCHAR}, ", "#{bankName,jdbcType=VARCHAR}, #{bankCardNo,jdbcType=VARCHAR}, ",
"#{bankCardHolder,jdbcType=VARCHAR}, #{openningBankCityCode,jdbcType=BIGINT}, ", "#{bankCardHolder,jdbcType=VARCHAR}, #{openningBankCityCode,jdbcType=BIGINT}, ",
@ -87,6 +87,7 @@ public interface BsMerSettleAcctApplyMapper extends BsMerSettleAcctApplyMapperEx
@Result(column="apply_no", property="applyNo", jdbcType=JdbcType.VARCHAR), @Result(column="apply_no", property="applyNo", jdbcType=JdbcType.VARCHAR),
@Result(column="apply_type", property="applyType", jdbcType=JdbcType.INTEGER), @Result(column="apply_type", property="applyType", jdbcType=JdbcType.INTEGER),
@Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT),
@Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR),
@Result(column="settle_type", property="settleType", jdbcType=JdbcType.INTEGER), @Result(column="settle_type", property="settleType", jdbcType=JdbcType.INTEGER),
@Result(column="commission_img", property="commissionImg", jdbcType=JdbcType.VARCHAR), @Result(column="commission_img", property="commissionImg", jdbcType=JdbcType.VARCHAR),
@Result(column="bank_card_img", property="bankCardImg", jdbcType=JdbcType.VARCHAR), @Result(column="bank_card_img", property="bankCardImg", jdbcType=JdbcType.VARCHAR),
@ -124,7 +125,7 @@ public interface BsMerSettleAcctApplyMapper extends BsMerSettleAcctApplyMapperEx
@Select({ @Select({
"select", "select",
"id, apply_no, apply_type, mer_id, settle_type, commission_img, bank_card_img, ", "id, apply_no, apply_type, mer_id, mer_name, settle_type, commission_img, bank_card_img, ",
"bank_name, bank_card_no, bank_card_holder, openning_bank_city_code, openning_bank_city_name, ", "bank_name, bank_card_no, bank_card_holder, openning_bank_city_code, openning_bank_city_name, ",
"openning_bank_area_code, openning_bank_area_name, openning_bank_province_code, ", "openning_bank_area_code, openning_bank_area_name, openning_bank_province_code, ",
"openning_bank_province_name, openning_bank_code, openning_bank_name, openning_bank_license_url, ", "openning_bank_province_name, openning_bank_code, openning_bank_name, openning_bank_license_url, ",
@ -140,6 +141,7 @@ public interface BsMerSettleAcctApplyMapper extends BsMerSettleAcctApplyMapperEx
@Result(column="apply_no", property="applyNo", jdbcType=JdbcType.VARCHAR), @Result(column="apply_no", property="applyNo", jdbcType=JdbcType.VARCHAR),
@Result(column="apply_type", property="applyType", jdbcType=JdbcType.INTEGER), @Result(column="apply_type", property="applyType", jdbcType=JdbcType.INTEGER),
@Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT),
@Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR),
@Result(column="settle_type", property="settleType", jdbcType=JdbcType.INTEGER), @Result(column="settle_type", property="settleType", jdbcType=JdbcType.INTEGER),
@Result(column="commission_img", property="commissionImg", jdbcType=JdbcType.VARCHAR), @Result(column="commission_img", property="commissionImg", jdbcType=JdbcType.VARCHAR),
@Result(column="bank_card_img", property="bankCardImg", jdbcType=JdbcType.VARCHAR), @Result(column="bank_card_img", property="bankCardImg", jdbcType=JdbcType.VARCHAR),
@ -189,6 +191,7 @@ public interface BsMerSettleAcctApplyMapper extends BsMerSettleAcctApplyMapperEx
"set apply_no = #{applyNo,jdbcType=VARCHAR},", "set apply_no = #{applyNo,jdbcType=VARCHAR},",
"apply_type = #{applyType,jdbcType=INTEGER},", "apply_type = #{applyType,jdbcType=INTEGER},",
"mer_id = #{merId,jdbcType=BIGINT},", "mer_id = #{merId,jdbcType=BIGINT},",
"mer_name = #{merName,jdbcType=VARCHAR},",
"settle_type = #{settleType,jdbcType=INTEGER},", "settle_type = #{settleType,jdbcType=INTEGER},",
"commission_img = #{commissionImg,jdbcType=VARCHAR},", "commission_img = #{commissionImg,jdbcType=VARCHAR},",
"bank_card_img = #{bankCardImg,jdbcType=VARCHAR},", "bank_card_img = #{bankCardImg,jdbcType=VARCHAR},",

@ -40,6 +40,10 @@ public class BsMerSettleAcctApplySqlProvider {
sql.VALUES("mer_id", "#{merId,jdbcType=BIGINT}"); sql.VALUES("mer_id", "#{merId,jdbcType=BIGINT}");
} }
if (record.getMerName() != null) {
sql.VALUES("mer_name", "#{merName,jdbcType=VARCHAR}");
}
if (record.getSettleType() != null) { if (record.getSettleType() != null) {
sql.VALUES("settle_type", "#{settleType,jdbcType=INTEGER}"); sql.VALUES("settle_type", "#{settleType,jdbcType=INTEGER}");
} }
@ -181,6 +185,7 @@ public class BsMerSettleAcctApplySqlProvider {
sql.SELECT("apply_no"); sql.SELECT("apply_no");
sql.SELECT("apply_type"); sql.SELECT("apply_type");
sql.SELECT("mer_id"); sql.SELECT("mer_id");
sql.SELECT("mer_name");
sql.SELECT("settle_type"); sql.SELECT("settle_type");
sql.SELECT("commission_img"); sql.SELECT("commission_img");
sql.SELECT("bank_card_img"); sql.SELECT("bank_card_img");
@ -246,6 +251,10 @@ public class BsMerSettleAcctApplySqlProvider {
sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}"); sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}");
} }
if (record.getMerName() != null) {
sql.SET("mer_name = #{record.merName,jdbcType=VARCHAR}");
}
if (record.getSettleType() != null) { if (record.getSettleType() != null) {
sql.SET("settle_type = #{record.settleType,jdbcType=INTEGER}"); sql.SET("settle_type = #{record.settleType,jdbcType=INTEGER}");
} }
@ -386,6 +395,7 @@ public class BsMerSettleAcctApplySqlProvider {
sql.SET("apply_no = #{record.applyNo,jdbcType=VARCHAR}"); sql.SET("apply_no = #{record.applyNo,jdbcType=VARCHAR}");
sql.SET("apply_type = #{record.applyType,jdbcType=INTEGER}"); sql.SET("apply_type = #{record.applyType,jdbcType=INTEGER}");
sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}"); sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}");
sql.SET("mer_name = #{record.merName,jdbcType=VARCHAR}");
sql.SET("settle_type = #{record.settleType,jdbcType=INTEGER}"); sql.SET("settle_type = #{record.settleType,jdbcType=INTEGER}");
sql.SET("commission_img = #{record.commissionImg,jdbcType=VARCHAR}"); sql.SET("commission_img = #{record.commissionImg,jdbcType=VARCHAR}");
sql.SET("bank_card_img = #{record.bankCardImg,jdbcType=VARCHAR}"); sql.SET("bank_card_img = #{record.bankCardImg,jdbcType=VARCHAR}");
@ -440,6 +450,10 @@ public class BsMerSettleAcctApplySqlProvider {
sql.SET("mer_id = #{merId,jdbcType=BIGINT}"); sql.SET("mer_id = #{merId,jdbcType=BIGINT}");
} }
if (record.getMerName() != null) {
sql.SET("mer_name = #{merName,jdbcType=VARCHAR}");
}
if (record.getSettleType() != null) { if (record.getSettleType() != null) {
sql.SET("settle_type = #{settleType,jdbcType=INTEGER}"); sql.SET("settle_type = #{settleType,jdbcType=INTEGER}");
} }

@ -0,0 +1,312 @@
package com.hfkj.entity;
import java.io.Serializable;
import java.util.Date;
/**
* bs_audit
* @author
*/
/**
*
* 代码由工具生成
*
**/
public class BsAudit implements Serializable {
/**
* 主键
*/
private Long id;
/**
* 审批编号
*/
private String auditNo;
/**
* 业务类型
*/
private Integer vocationalWorkType;
/**
* 业务类型名称
*/
private String vocationalWorkTypeName;
/**
* 审核对象id
*/
private Long auditObjectId;
/**
* 审核对象名称
*/
private String auditObjectName;
/**
* 提交人
*/
private Long opUserId;
/**
* 提交人名称
*/
private String opUserName;
/**
* 审核人id
*/
private Long reviewedUserId;
/**
* 审核人名称
*/
private String reviewedUserName;
/**
* 状态 1待审核 2审核通过 3审核驳回
*/
private Integer status;
/**
* 驳回原因
*/
private String rejectReason;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
private String ext1;
private String ext2;
private String ext3;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getAuditNo() {
return auditNo;
}
public void setAuditNo(String auditNo) {
this.auditNo = auditNo;
}
public Integer getVocationalWorkType() {
return vocationalWorkType;
}
public void setVocationalWorkType(Integer vocationalWorkType) {
this.vocationalWorkType = vocationalWorkType;
}
public String getVocationalWorkTypeName() {
return vocationalWorkTypeName;
}
public void setVocationalWorkTypeName(String vocationalWorkTypeName) {
this.vocationalWorkTypeName = vocationalWorkTypeName;
}
public Long getAuditObjectId() {
return auditObjectId;
}
public void setAuditObjectId(Long auditObjectId) {
this.auditObjectId = auditObjectId;
}
public String getAuditObjectName() {
return auditObjectName;
}
public void setAuditObjectName(String auditObjectName) {
this.auditObjectName = auditObjectName;
}
public Long getOpUserId() {
return opUserId;
}
public void setOpUserId(Long opUserId) {
this.opUserId = opUserId;
}
public String getOpUserName() {
return opUserName;
}
public void setOpUserName(String opUserName) {
this.opUserName = opUserName;
}
public Long getReviewedUserId() {
return reviewedUserId;
}
public void setReviewedUserId(Long reviewedUserId) {
this.reviewedUserId = reviewedUserId;
}
public String getReviewedUserName() {
return reviewedUserName;
}
public void setReviewedUserName(String reviewedUserName) {
this.reviewedUserName = reviewedUserName;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getRejectReason() {
return rejectReason;
}
public void setRejectReason(String rejectReason) {
this.rejectReason = rejectReason;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public String getExt1() {
return ext1;
}
public void setExt1(String ext1) {
this.ext1 = ext1;
}
public String getExt2() {
return ext2;
}
public void setExt2(String ext2) {
this.ext2 = ext2;
}
public String getExt3() {
return ext3;
}
public void setExt3(String ext3) {
this.ext3 = ext3;
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
BsAudit other = (BsAudit) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getAuditNo() == null ? other.getAuditNo() == null : this.getAuditNo().equals(other.getAuditNo()))
&& (this.getVocationalWorkType() == null ? other.getVocationalWorkType() == null : this.getVocationalWorkType().equals(other.getVocationalWorkType()))
&& (this.getVocationalWorkTypeName() == null ? other.getVocationalWorkTypeName() == null : this.getVocationalWorkTypeName().equals(other.getVocationalWorkTypeName()))
&& (this.getAuditObjectId() == null ? other.getAuditObjectId() == null : this.getAuditObjectId().equals(other.getAuditObjectId()))
&& (this.getAuditObjectName() == null ? other.getAuditObjectName() == null : this.getAuditObjectName().equals(other.getAuditObjectName()))
&& (this.getOpUserId() == null ? other.getOpUserId() == null : this.getOpUserId().equals(other.getOpUserId()))
&& (this.getOpUserName() == null ? other.getOpUserName() == null : this.getOpUserName().equals(other.getOpUserName()))
&& (this.getReviewedUserId() == null ? other.getReviewedUserId() == null : this.getReviewedUserId().equals(other.getReviewedUserId()))
&& (this.getReviewedUserName() == null ? other.getReviewedUserName() == null : this.getReviewedUserName().equals(other.getReviewedUserName()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getRejectReason() == null ? other.getRejectReason() == null : this.getRejectReason().equals(other.getRejectReason()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
&& (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1()))
&& (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2()))
&& (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getAuditNo() == null) ? 0 : getAuditNo().hashCode());
result = prime * result + ((getVocationalWorkType() == null) ? 0 : getVocationalWorkType().hashCode());
result = prime * result + ((getVocationalWorkTypeName() == null) ? 0 : getVocationalWorkTypeName().hashCode());
result = prime * result + ((getAuditObjectId() == null) ? 0 : getAuditObjectId().hashCode());
result = prime * result + ((getAuditObjectName() == null) ? 0 : getAuditObjectName().hashCode());
result = prime * result + ((getOpUserId() == null) ? 0 : getOpUserId().hashCode());
result = prime * result + ((getOpUserName() == null) ? 0 : getOpUserName().hashCode());
result = prime * result + ((getReviewedUserId() == null) ? 0 : getReviewedUserId().hashCode());
result = prime * result + ((getReviewedUserName() == null) ? 0 : getReviewedUserName().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getRejectReason() == null) ? 0 : getRejectReason().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode());
result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode());
result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode());
return result;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", auditNo=").append(auditNo);
sb.append(", vocationalWorkType=").append(vocationalWorkType);
sb.append(", vocationalWorkTypeName=").append(vocationalWorkTypeName);
sb.append(", auditObjectId=").append(auditObjectId);
sb.append(", auditObjectName=").append(auditObjectName);
sb.append(", opUserId=").append(opUserId);
sb.append(", opUserName=").append(opUserName);
sb.append(", reviewedUserId=").append(reviewedUserId);
sb.append(", reviewedUserName=").append(reviewedUserName);
sb.append(", status=").append(status);
sb.append(", rejectReason=").append(rejectReason);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", ext1=").append(ext1);
sb.append(", ext2=").append(ext2);
sb.append(", ext3=").append(ext3);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}

File diff suppressed because it is too large Load Diff

@ -33,6 +33,11 @@ public class BsMerSettleAcctApply implements Serializable {
*/ */
private Long merId; private Long merId;
/**
* 商户名称
*/
private String merName;
/** /**
* 结算类型 1对公结算 2对私法人结算 3对私非法人结算 * 结算类型 1对公结算 2对私法人结算 3对私非法人结算
*/ */
@ -218,6 +223,14 @@ public class BsMerSettleAcctApply implements Serializable {
this.merId = merId; this.merId = merId;
} }
public String getMerName() {
return merName;
}
public void setMerName(String merName) {
this.merName = merName;
}
public Integer getSettleType() { public Integer getSettleType() {
return settleType; return settleType;
} }
@ -490,6 +503,7 @@ public class BsMerSettleAcctApply implements Serializable {
&& (this.getApplyNo() == null ? other.getApplyNo() == null : this.getApplyNo().equals(other.getApplyNo())) && (this.getApplyNo() == null ? other.getApplyNo() == null : this.getApplyNo().equals(other.getApplyNo()))
&& (this.getApplyType() == null ? other.getApplyType() == null : this.getApplyType().equals(other.getApplyType())) && (this.getApplyType() == null ? other.getApplyType() == null : this.getApplyType().equals(other.getApplyType()))
&& (this.getMerId() == null ? other.getMerId() == null : this.getMerId().equals(other.getMerId())) && (this.getMerId() == null ? other.getMerId() == null : this.getMerId().equals(other.getMerId()))
&& (this.getMerName() == null ? other.getMerName() == null : this.getMerName().equals(other.getMerName()))
&& (this.getSettleType() == null ? other.getSettleType() == null : this.getSettleType().equals(other.getSettleType())) && (this.getSettleType() == null ? other.getSettleType() == null : this.getSettleType().equals(other.getSettleType()))
&& (this.getCommissionImg() == null ? other.getCommissionImg() == null : this.getCommissionImg().equals(other.getCommissionImg())) && (this.getCommissionImg() == null ? other.getCommissionImg() == null : this.getCommissionImg().equals(other.getCommissionImg()))
&& (this.getBankCardImg() == null ? other.getBankCardImg() == null : this.getBankCardImg().equals(other.getBankCardImg())) && (this.getBankCardImg() == null ? other.getBankCardImg() == null : this.getBankCardImg().equals(other.getBankCardImg()))
@ -532,6 +546,7 @@ public class BsMerSettleAcctApply implements Serializable {
result = prime * result + ((getApplyNo() == null) ? 0 : getApplyNo().hashCode()); result = prime * result + ((getApplyNo() == null) ? 0 : getApplyNo().hashCode());
result = prime * result + ((getApplyType() == null) ? 0 : getApplyType().hashCode()); result = prime * result + ((getApplyType() == null) ? 0 : getApplyType().hashCode());
result = prime * result + ((getMerId() == null) ? 0 : getMerId().hashCode()); result = prime * result + ((getMerId() == null) ? 0 : getMerId().hashCode());
result = prime * result + ((getMerName() == null) ? 0 : getMerName().hashCode());
result = prime * result + ((getSettleType() == null) ? 0 : getSettleType().hashCode()); result = prime * result + ((getSettleType() == null) ? 0 : getSettleType().hashCode());
result = prime * result + ((getCommissionImg() == null) ? 0 : getCommissionImg().hashCode()); result = prime * result + ((getCommissionImg() == null) ? 0 : getCommissionImg().hashCode());
result = prime * result + ((getBankCardImg() == null) ? 0 : getBankCardImg().hashCode()); result = prime * result + ((getBankCardImg() == null) ? 0 : getBankCardImg().hashCode());
@ -577,6 +592,7 @@ public class BsMerSettleAcctApply implements Serializable {
sb.append(", applyNo=").append(applyNo); sb.append(", applyNo=").append(applyNo);
sb.append(", applyType=").append(applyType); sb.append(", applyType=").append(applyType);
sb.append(", merId=").append(merId); sb.append(", merId=").append(merId);
sb.append(", merName=").append(merName);
sb.append(", settleType=").append(settleType); sb.append(", settleType=").append(settleType);
sb.append(", commissionImg=").append(commissionImg); sb.append(", commissionImg=").append(commissionImg);
sb.append(", bankCardImg=").append(bankCardImg); sb.append(", bankCardImg=").append(bankCardImg);

@ -375,6 +375,76 @@ public class BsMerSettleAcctApplyExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andMerNameIsNull() {
addCriterion("mer_name is null");
return (Criteria) this;
}
public Criteria andMerNameIsNotNull() {
addCriterion("mer_name is not null");
return (Criteria) this;
}
public Criteria andMerNameEqualTo(String value) {
addCriterion("mer_name =", value, "merName");
return (Criteria) this;
}
public Criteria andMerNameNotEqualTo(String value) {
addCriterion("mer_name <>", value, "merName");
return (Criteria) this;
}
public Criteria andMerNameGreaterThan(String value) {
addCriterion("mer_name >", value, "merName");
return (Criteria) this;
}
public Criteria andMerNameGreaterThanOrEqualTo(String value) {
addCriterion("mer_name >=", value, "merName");
return (Criteria) this;
}
public Criteria andMerNameLessThan(String value) {
addCriterion("mer_name <", value, "merName");
return (Criteria) this;
}
public Criteria andMerNameLessThanOrEqualTo(String value) {
addCriterion("mer_name <=", value, "merName");
return (Criteria) this;
}
public Criteria andMerNameLike(String value) {
addCriterion("mer_name like", value, "merName");
return (Criteria) this;
}
public Criteria andMerNameNotLike(String value) {
addCriterion("mer_name not like", value, "merName");
return (Criteria) this;
}
public Criteria andMerNameIn(List<String> values) {
addCriterion("mer_name in", values, "merName");
return (Criteria) this;
}
public Criteria andMerNameNotIn(List<String> values) {
addCriterion("mer_name not in", values, "merName");
return (Criteria) this;
}
public Criteria andMerNameBetween(String value1, String value2) {
addCriterion("mer_name between", value1, value2, "merName");
return (Criteria) this;
}
public Criteria andMerNameNotBetween(String value1, String value2) {
addCriterion("mer_name not between", value1, value2, "merName");
return (Criteria) this;
}
public Criteria andSettleTypeIsNull() { public Criteria andSettleTypeIsNull() {
addCriterion("settle_type is null"); addCriterion("settle_type is null");
return (Criteria) this; return (Criteria) this;

@ -0,0 +1,19 @@
package com.hfkj.model;
import com.hfkj.entity.BsAudit;
import lombok.Data;
/**
* @className: BsAuditModel
* @author: HuRui
* @date: 2023/5/9
**/
@Data
public class BsAuditModel extends BsAudit {
/**
* 审核对象数据
*/
private Object auditObject;
}

@ -0,0 +1,74 @@
package com.hfkj.service;
import com.hfkj.entity.BsAudit;
import com.hfkj.model.BsAuditModel;
import java.util.List;
import java.util.Map;
/**
* @className: BsAuditService
* @author: HuRui
* @date: 2023/5/9
**/
public interface BsAuditService {
/**
* 编辑数据
* @param audit
*/
void editData(BsAudit audit);
/**
* 创建审核
* @param audit
*/
BsAudit createAudit(BsAudit audit);
/**
* 审核通过
* @param auditId 审批id
*/
void approve(Long auditId);
/**
* 审批通过回调
* @param audit
*/
void approveCallback(BsAudit audit);
/**
* 审核拒绝
* @param auditId 审批id
* @param rejectReason 拒绝原因
*/
void reject(Long auditId, String rejectReason);
/**
* 审批驳回回调
* @param audit
*/
void rejectCallback(BsAudit audit);
/**
* 审核编号
* @param auditId 审批id
* @return
*/
BsAudit getAuditDetailById(Long auditId);
/**
* 审核编号
* @param auditNo 审批编号
* @return
*/
BsAuditModel getAuditDetailByNo(String auditNo);
/**
* 查询审核列表
* @param param
* @return
*/
List<BsAudit> getAuditList(Map<String,Object> param);
}

@ -1,7 +1,10 @@
package com.hfkj.service; package com.hfkj.service;
import com.hfkj.entity.BsMerSettleAcct;
import com.hfkj.entity.BsMerSettleAcctApply; import com.hfkj.entity.BsMerSettleAcctApply;
import java.util.List;
/** /**
* @className: BsMerSettleAcctApplyService * @className: BsMerSettleAcctApplyService
* @author: HuRui * @author: HuRui
@ -16,12 +19,37 @@ public interface BsMerSettleAcctApplyService {
void editData(BsMerSettleAcctApply merSettleAcctApply); void editData(BsMerSettleAcctApply merSettleAcctApply);
/** /**
* 修改结算申请 * 创建申请
* @param merSettleAcctApply
*/
void createApply(BsMerSettleAcctApply merSettleAcctApply);
/**
* 渠道申请修改结算
* @param merSettleAcctApply * @param merSettleAcctApply
* @return * @return
*/ */
BsMerSettleAcctApply updateSettleAcctApply(BsMerSettleAcctApply merSettleAcctApply); BsMerSettleAcctApply applyUpdateSettleAcct(BsMerSettleAcctApply merSettleAcctApply);
/**
* 查询商户最新申请
* @param merId
* @return
*/
BsMerSettleAcctApply getLastApplyByMer(Long merId);
/**
* 根据id查询申请
* @param id
* @return
*/
BsMerSettleAcctApply getApplyById(Long id); BsMerSettleAcctApply getApplyById(Long id);
/**
* 根据商户查询结算申请
* @param merId
* @return
*/
List<BsMerSettleAcctApply> getApplyListByMer(Long merId);
} }

@ -0,0 +1,162 @@
package com.hfkj.service.impl;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.dao.BsAuditMapper;
import com.hfkj.entity.BsAudit;
import com.hfkj.entity.BsAuditExample;
import com.hfkj.entity.BsMerSettleAcctApply;
import com.hfkj.model.BsAuditModel;
import com.hfkj.service.BsAuditService;
import com.hfkj.service.BsMerSettleAcctApplyService;
import com.hfkj.sysenum.AuditStatusEnum;
import com.hfkj.sysenum.AuditVocationalWorkType;
import com.hfkj.sysenum.MerSettleAcctApplyStatus;
import org.apache.commons.collections4.MapUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @className: BsAuditServiceImpl
* @author: HuRui
* @date: 2023/5/9
**/
@Service("auditService")
public class BsAuditServiceImpl implements BsAuditService {
@Resource
private BsAuditMapper auditMapper;
@Resource
private BsMerSettleAcctApplyService merSettleAcctApplyService;
@Override
public void editData(BsAudit audit) {
if (audit.getId() == null) {
audit.setCreateTime(new Date());
audit.setUpdateTime(new Date());
auditMapper.insert(audit);
} else {
audit.setUpdateTime(new Date());
auditMapper.updateByPrimaryKey(audit);
}
}
@Override
public BsAudit createAudit(BsAudit audit) {
editData(audit);
return audit;
}
@Override
public void approve(Long auditId) {
// 查询审核详情
BsAudit audit = getAuditDetailById(auditId);
if (audit == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的审批");
}
if (!audit.getStatus().equals(AuditStatusEnum.status1.getNumber())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "审批状态处于待审核");
}
audit.setStatus(AuditStatusEnum.status2.getNumber());
editData(audit);
approveCallback(audit);
}
@Override
@Transactional(propagation= Propagation.REQUIRES_NEW)
public void approveCallback(BsAudit audit) {
if (audit.getVocationalWorkType().equals(AuditVocationalWorkType.type1.getNumber())) {
BsMerSettleAcctApply acctApply = merSettleAcctApplyService.getApplyById(audit.getAuditObjectId());
if (acctApply != null) {
merSettleAcctApplyService.applyUpdateSettleAcct(acctApply);
}
}
}
@Override
public void reject(Long auditId, String rejectReason) {
// 查询审核详情
BsAudit audit = getAuditDetailById(auditId);
if (audit == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的审批");
}
if (!audit.getStatus().equals(AuditStatusEnum.status1.getNumber())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "审批状态处于待审核");
}
audit.setStatus(AuditStatusEnum.status3.getNumber());
audit.setRejectReason(rejectReason);
editData(audit);
rejectCallback(audit);
}
@Override
@Transactional(propagation= Propagation.REQUIRES_NEW)
public void rejectCallback(BsAudit audit) {
if (audit.getVocationalWorkType().equals(AuditVocationalWorkType.type1.getNumber())) {
BsMerSettleAcctApply acctApply = merSettleAcctApplyService.getApplyById(audit.getAuditObjectId());
if (acctApply != null) {
acctApply.setRejectReason(audit.getRejectReason());
acctApply.setStatus(MerSettleAcctApplyStatus.status4.getNumber());
merSettleAcctApplyService.editData(acctApply);
}
}
}
@Override
public BsAudit getAuditDetailById(Long auditId) {
return auditMapper.selectByPrimaryKey(auditId);
}
@Override
public BsAuditModel getAuditDetailByNo(String auditNo) {
BsAuditExample example = new BsAuditExample();
example.createCriteria().andAuditNoEqualTo(auditNo).andStatusNotEqualTo(AuditStatusEnum.status0.getNumber());
List<BsAudit> list = auditMapper.selectByExample(example);
if (list.size() == 0) {
return null;
}
BsAuditModel auditModel = new BsAuditModel();
BeanUtils.copyProperties(list.get(0), auditModel);
if (auditModel.getVocationalWorkType().equals(AuditVocationalWorkType.type1.getNumber())) {
auditModel.setAuditObject(merSettleAcctApplyService.getApplyById(auditModel.getAuditObjectId()));
}
return auditModel;
}
@Override
public List<BsAudit> getAuditList(Map<String, Object> param) {
BsAuditExample example = new BsAuditExample();
BsAuditExample.Criteria criteria = example.createCriteria().andStatusNotEqualTo(AuditStatusEnum.status0.getNumber());
if (MapUtils.getInteger(param, "auditNo") != null) {
criteria.andAuditNoLike("%" + MapUtils.getInteger(param, "auditNo") + "%");
}
if (MapUtils.getInteger(param, "status") != null) {
criteria.andStatusEqualTo(MapUtils.getInteger(param, "status"));
}
if (MapUtils.getInteger(param, "opUserId") != null) {
criteria.andOpUserIdEqualTo(MapUtils.getLong(param, "opUserId"));
}
if (MapUtils.getLong(param, "reviewedUserId") != null) {
criteria.andReviewedUserIdEqualTo(MapUtils.getLong(param, "reviewedUserId"));
}
example.setOrderByClause("create_time desc");
return auditMapper.selectByExample(example);
}
}

@ -49,6 +49,9 @@ public class BsDeviceOrderServiceImpl implements BsDeviceOrderService {
@Resource @Resource
private BsDeviceOrderAssignService deviceOrderAssignService; private BsDeviceOrderAssignService deviceOrderAssignService;
@Resource
private BsPayQrCodeService payQrCodeService;
@Resource @Resource
private CommonService commonService; private CommonService commonService;
@ -90,6 +93,12 @@ public class BsDeviceOrderServiceImpl implements BsDeviceOrderService {
deviceOrder.setAgentName(userInfoModel.getStore().getAgentName()); deviceOrder.setAgentName(userInfoModel.getStore().getAgentName());
deviceOrder.setCompanyId(userInfoModel.getStore().getCompanyId()); deviceOrder.setCompanyId(userInfoModel.getStore().getCompanyId());
deviceOrder.setCompanyName(userInfoModel.getStore().getCompanyName()); deviceOrder.setCompanyName(userInfoModel.getStore().getCompanyName());
if (deviceOrder.getPayPrice().equals(new BigDecimal("0"))) {
deviceOrder.setPayType(0);
deviceOrder.setPayTime(new Date());
deviceOrder.setStatus(DeviceOrderStatusEnum.status2.getNumber());
}
return editData(deviceOrder); return editData(deviceOrder);
} }
@ -115,6 +124,7 @@ public class BsDeviceOrderServiceImpl implements BsDeviceOrderService {
order.setStatus(DeviceOrderStatusEnum.status3.getNumber()); order.setStatus(DeviceOrderStatusEnum.status3.getNumber());
editData(order); editData(order);
if (order.getDeviceType().equals(DeviceTypeEnum.type1.getNumber())) {
List<BsDevice> deviceList = new ArrayList<>(); List<BsDevice> deviceList = new ArrayList<>();
for (String deviceNo : deviceNoList) { for (String deviceNo : deviceNoList) {
// 查询设备 // 查询设备
@ -164,6 +174,25 @@ public class BsDeviceOrderServiceImpl implements BsDeviceOrderService {
deviceService.editDevice(device); deviceService.editDevice(device);
} }
} }
else if (order.getDeviceType().equals(DeviceTypeEnum.type2.getNumber())) {
List<BsPayQrCode> payQrCodeList = new ArrayList<>();
for (String serialNumber : deviceNoList) {
// 查询支付码
BsPayQrCode payQrCode = payQrCodeService.getDetailBySN(serialNumber);
if (payQrCode == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的支付码编号:" + serialNumber);
}
if (!payQrCode.getStatus().equals(PayQrCodeStatusEnum.status1.getNumber())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "支付码状态错误");
}
payQrCodeList.add(payQrCode);
}
}
}
@Override @Override
@Transactional(propagation= Propagation.REQUIRES_NEW,rollbackFor= {RuntimeException.class}) @Transactional(propagation= Propagation.REQUIRES_NEW,rollbackFor= {RuntimeException.class})
@ -217,11 +246,16 @@ public class BsDeviceOrderServiceImpl implements BsDeviceOrderService {
if (!order.getStatus().equals(DeviceOrderStatusEnum.status2.getNumber())) { if (!order.getStatus().equals(DeviceOrderStatusEnum.status2.getNumber())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "状态不处于已支付,无法退款"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "状态不处于已支付,无法退款");
} }
if (order.getPayType().equals(0)) {
} else if (order.getPayType().equals(1)) {
// 退款 // 退款
OrderRefundModel refund = WxOrderService.orderToRefund(order.getEntryPlatformMerNo(), order.getPaySerialNo(), order.getPayPrice(), order.getPayPrice()); OrderRefundModel refund = WxOrderService.orderToRefund(order.getEntryPlatformMerNo(), order.getPaySerialNo(), order.getPayPrice(), order.getPayPrice());
if(!refund.getResult_code().equals("SUCCESS")) { if(!refund.getResult_code().equals("SUCCESS")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "退款失败!" + refund.getErr_code_des()); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "退款失败!" + refund.getErr_code_des());
} }
}
order.setStatus(DeviceOrderStatusEnum.status4.getNumber()); order.setStatus(DeviceOrderStatusEnum.status4.getNumber());
order.setRefundTime(new Date()); order.setRefundTime(new Date());
editData(order); editData(order);

@ -1,14 +1,25 @@
package com.hfkj.service.impl; package com.hfkj.service.impl;
import com.hfkj.channel.saas.SaasMerService; import com.hfkj.channel.saas.SaasMerService;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.common.security.UserCenter;
import com.hfkj.dao.BsMerSettleAcctApplyMapper; import com.hfkj.dao.BsMerSettleAcctApplyMapper;
import com.hfkj.entity.BsMerSettleAcct; import com.hfkj.entity.*;
import com.hfkj.entity.BsMerSettleAcctApply; import com.hfkj.model.UserInfoModel;
import com.hfkj.service.BsAuditService;
import com.hfkj.service.BsMerSettleAcctApplyService; import com.hfkj.service.BsMerSettleAcctApplyService;
import com.hfkj.sysenum.AuditStatusEnum;
import com.hfkj.sysenum.AuditVocationalWorkType;
import com.hfkj.sysenum.MerSettleAcctApplyStatus;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* @className: BsMerSettleAcctApplyServiceImpl * @className: BsMerSettleAcctApplyServiceImpl
@ -20,10 +31,14 @@ public class BsMerSettleAcctApplyServiceImpl implements BsMerSettleAcctApplyServ
@Resource @Resource
private BsMerSettleAcctApplyMapper merSettleAcctApplyMapper; private BsMerSettleAcctApplyMapper merSettleAcctApplyMapper;
@Resource
private BsAuditService auditService;
@Resource @Resource
private SaasMerService saasMerService; private SaasMerService saasMerService;
@Resource
private UserCenter userCenter;
@Override @Override
public void editData(BsMerSettleAcctApply merSettleAcctApply) { public void editData(BsMerSettleAcctApply merSettleAcctApply) {
if (merSettleAcctApply.getId() == null) { if (merSettleAcctApply.getId() == null) {
@ -37,11 +52,48 @@ public class BsMerSettleAcctApplyServiceImpl implements BsMerSettleAcctApplyServ
} }
@Override @Override
public BsMerSettleAcctApply updateSettleAcctApply(BsMerSettleAcctApply merSettleAcctApply) { @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public void createApply(BsMerSettleAcctApply merSettleAcctApply) {
merSettleAcctApply.setStatus(MerSettleAcctApplyStatus.status2.getNumber());
editData(merSettleAcctApply); editData(merSettleAcctApply);
UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class);
if (userInfoModel == null || userInfoModel.getSalesman() == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "该角色暂无权限");
}
BsAudit audit = new BsAudit();
audit.setAuditNo(System.currentTimeMillis()+"");
audit.setVocationalWorkType(AuditVocationalWorkType.type1.getNumber());
audit.setVocationalWorkTypeName(AuditVocationalWorkType.type1.getName());
audit.setAuditObjectId(merSettleAcctApply.getId());
audit.setAuditObjectName(merSettleAcctApply.getMerName());
audit.setOpUserId(userInfoModel.getSecUser().getId());
audit.setOpUserName(userInfoModel.getSecUser().getUserName());
audit.setReviewedUserId(userInfoModel.getSalesman().getAgentId());
audit.setReviewedUserName(userInfoModel.getSalesman().getAgentName());
audit.setStatus(AuditStatusEnum.status1.getNumber());
auditService.createAudit(audit);
}
@Override
public BsMerSettleAcctApply applyUpdateSettleAcct(BsMerSettleAcctApply merSettleAcctApply) {
merSettleAcctApply.setStatus(MerSettleAcctApplyStatus.status2.getNumber());
editData(merSettleAcctApply);
saasMerService.updateSettleApply(merSettleAcctApply.getId());
return null;
}
@Override
public BsMerSettleAcctApply getLastApplyByMer(Long merId) {
BsMerSettleAcctApplyExample example = new BsMerSettleAcctApplyExample();
example.createCriteria().andMerIdEqualTo(merId).andStatusNotEqualTo(0);
example.setOrderByClause("create_time desc");
List<BsMerSettleAcctApply> list = merSettleAcctApplyMapper.selectByExample(example);
if (list.size() > 0) {
return list.get(0);
}
return null; return null;
} }
@ -50,4 +102,12 @@ public class BsMerSettleAcctApplyServiceImpl implements BsMerSettleAcctApplyServ
return merSettleAcctApplyMapper.selectByPrimaryKey(id); return merSettleAcctApplyMapper.selectByPrimaryKey(id);
} }
@Override
public List<BsMerSettleAcctApply> getApplyListByMer(Long merId) {
BsMerSettleAcctApplyExample example = new BsMerSettleAcctApplyExample();
example.createCriteria().andMerIdEqualTo(merId);
example.setOrderByClause("create_time desc");
return merSettleAcctApplyMapper.selectByExample(example);
}
} }

@ -0,0 +1,40 @@
package com.hfkj.sysenum;
/**
* @className: BsAuditStatus
* @author: HuRui
* @date: 2023/5/9
**/
public enum AuditStatusEnum {
status0(0, "不可用"),
status1(1, "待审核"),
status2(2, "通过"),
status3(3, "驳回"),
;
private Integer number;
private String name;
AuditStatusEnum(int number, String name) {
this.number = number;
this.name = name;
}
public Integer getNumber() {
return number;
}
public void setNumber(Integer number) {
this.number = number;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

@ -0,0 +1,38 @@
package com.hfkj.sysenum;
/**
* @className: AuditVocationalWorkType
* @author: HuRui
* @date: 2023/5/9
**/
public enum AuditVocationalWorkType {
type1(1, "修改商户结算"),
;
private Integer number;
private String name;
AuditVocationalWorkType(int number, String name) {
this.number = number;
this.name = name;
}
public Integer getNumber() {
return number;
}
public void setNumber(Integer number) {
this.number = number;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

@ -8,6 +8,7 @@ import java.util.Objects;
*/ */
public enum DeviceTypeEnum { public enum DeviceTypeEnum {
type1(1, "4G收款音响"), type1(1, "4G收款音响"),
type2(2, "桌码(支付码)"),
; ;
private Integer number; private Integer number;

@ -13,7 +13,7 @@ public enum MerSettleAcctApplyStatus {
status1(1, "待提交"), status1(1, "待提交"),
status2(2, "审核中"), status2(2, "审核中"),
status3(3, "通过"), status3(3, "通过"),
status4(3, "驳回"), status4(4, "驳回"),
; ;
private Integer number; private Integer number;

Loading…
Cancel
Save