commit
3e069a3b98
@ -0,0 +1,255 @@ |
||||
package com.order.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.BsOrderAfterSalesApply; |
||||
import com.hfkj.model.ResponseData; |
||||
import com.hfkj.model.SecUserSessionObject; |
||||
import com.hfkj.model.UserSessionObject; |
||||
import com.hfkj.model.order.OrderChildModel; |
||||
import com.hfkj.model.order.OrderModel; |
||||
import com.hfkj.service.order.BsOrderAfterSalesApplyService; |
||||
import com.hfkj.service.order.BsOrderAfterSalesOpRecordService; |
||||
import com.hfkj.service.order.BsOrderChildService; |
||||
import com.hfkj.sysenum.SecUserObjectTypeEnum; |
||||
import com.hfkj.sysenum.UserStatusEnum; |
||||
import com.hfkj.sysenum.order.OrderAfterSalesApplyTypeEnum; |
||||
import com.hfkj.sysenum.order.OrderChildProductTypeEnum; |
||||
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; |
||||
|
||||
/** |
||||
* @className: OrderAfterSalesApplyController |
||||
* @author: HuRui |
||||
* @date: 2024/5/15 |
||||
**/ |
||||
@Controller |
||||
@RequestMapping(value="/afterSales") |
||||
@Api(value="订单售后业务") |
||||
public class OrderAfterSalesApplyController { |
||||
Logger log = LoggerFactory.getLogger(OrderAfterSalesApplyController.class); |
||||
@Resource |
||||
private UserCenter userCenter; |
||||
@Resource |
||||
private BsOrderAfterSalesApplyService orderAfterSalesApplyService; |
||||
@Resource |
||||
private BsOrderAfterSalesOpRecordService orderAfterSalesOpRecordService; |
||||
@Resource |
||||
private BsOrderChildService orderChildService; |
||||
|
||||
@RequestMapping(value="/apply",method = RequestMethod.POST) |
||||
@ResponseBody |
||||
@ApiOperation(value = "申请") |
||||
public ResponseData apply(@RequestBody JSONObject body) { |
||||
try { |
||||
if (body == null |
||||
|| body.getInteger("type") == null |
||||
|| StringUtils.isBlank(body.getString("childOrderNo")) |
||||
|| body.getInteger("productCount") == null |
||||
|| StringUtils.isBlank(body.getString("remarks")) |
||||
) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
||||
} |
||||
|
||||
// 申请类型
|
||||
OrderAfterSalesApplyTypeEnum applyType = OrderAfterSalesApplyTypeEnum.getData(body.getInteger("type")); |
||||
if (applyType == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的申请类型"); |
||||
} |
||||
|
||||
orderAfterSalesApplyService.createApply(applyType, |
||||
body.getString("childOrderNo"), |
||||
body.getInteger("productCount"), |
||||
body.getString("photo"), |
||||
body.getString("remarks") |
||||
); |
||||
return ResponseMsgUtil.success("提交成功"); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("error!",e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
@RequestMapping(value="/audit",method = RequestMethod.POST) |
||||
@ResponseBody |
||||
@ApiOperation(value = "申请审核") |
||||
public ResponseData audit(@RequestBody JSONObject body) { |
||||
try { |
||||
SecUserSessionObject secUserSessionObject = userCenter.getSessionModel(SecUserSessionObject.class); |
||||
if (secUserSessionObject == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.ACCOUNT_LOGIN_NOT, ""); |
||||
} |
||||
if (body == null |
||||
|| StringUtils.isBlank(body.getString("applyNo")) |
||||
|| body.getBoolean("auditStatus") == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
||||
} |
||||
|
||||
orderAfterSalesApplyService.audit( |
||||
body.getString("applyNo"), |
||||
body.getBoolean("auditStatus"), |
||||
body.getString("remarks"), |
||||
secUserSessionObject.getAccount().getId()); |
||||
return ResponseMsgUtil.success("提交成功"); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("error!",e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
@RequestMapping(value="/sendExpress",method = RequestMethod.POST) |
||||
@ResponseBody |
||||
@ApiOperation(value = "邮寄") |
||||
public ResponseData sendExpress(@RequestBody JSONObject body) { |
||||
try { |
||||
if (body == null |
||||
|| StringUtils.isBlank(body.getString("applyNo")) |
||||
|| StringUtils.isBlank(body.getString("sendExpressNo")) |
||||
) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
||||
} |
||||
|
||||
orderAfterSalesApplyService.sendExpress(body.getString("applyNo"),body.getString("sendExpressNo")); |
||||
return ResponseMsgUtil.success("提交成功"); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("error!",e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
@RequestMapping(value="/finish",method = RequestMethod.POST) |
||||
@ResponseBody |
||||
@ApiOperation(value = "完成") |
||||
public ResponseData finish(@RequestBody JSONObject body) { |
||||
try { |
||||
if (body == null || StringUtils.isBlank(body.getString("applyNo"))) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
||||
} |
||||
SecUserSessionObject secUserSessionObject = userCenter.getSessionModel(SecUserSessionObject.class); |
||||
if (secUserSessionObject == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.ACCOUNT_LOGIN_NOT, ""); |
||||
} |
||||
|
||||
orderAfterSalesApplyService.finish(body.getString("applyNo"), secUserSessionObject.getAccount().getId()); |
||||
return ResponseMsgUtil.success("提交成功"); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("error!",e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
@RequestMapping(value="/queryApply",method = RequestMethod.GET) |
||||
@ResponseBody |
||||
@ApiOperation(value = "查询申请") |
||||
public ResponseData queryApply(@RequestParam(value = "applyNo" , required = true) String applyNo) { |
||||
try { |
||||
// 查询申请
|
||||
BsOrderAfterSalesApply apply = orderAfterSalesApplyService.getDetailByApplyNo(applyNo); |
||||
if (apply == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的申请"); |
||||
} |
||||
Map<String,Object> map = new HashMap<>(); |
||||
map.put("applyDetail", apply); |
||||
map.put("childOrder", orderChildService.getDetail(apply.getChildOrderNo())); |
||||
map.put("applyOpRecord", orderAfterSalesOpRecordService.getRecordList(applyNo)); |
||||
return ResponseMsgUtil.success(map); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("error!",e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
@RequestMapping(value="/queryApplyList",method = RequestMethod.GET) |
||||
@ResponseBody |
||||
@ApiOperation(value = "查询申请列表") |
||||
public ResponseData queryApplyList(@RequestParam(value = "merId" , required = false) Long merId, |
||||
@RequestParam(value = "type" , required = false) Integer type, |
||||
@RequestParam(value = "userPhone" , required = false) String userPhone, |
||||
@RequestParam(value = "childOrderNo" , required = false) String childOrderNo, |
||||
@RequestParam(value = "applyNo" , required = false) String applyNo, |
||||
@RequestParam(value = "status" , required = false) Integer status, |
||||
@RequestParam(value = "createTimeS" , required = false) Long createTimeS, |
||||
@RequestParam(value = "createTimeE" , required = false) Long createTimeE, |
||||
@RequestParam(value = "pageNum" , required = true) Integer pageNum, |
||||
@RequestParam(value = "pageSize" , required = true) Integer pageSize) { |
||||
try { |
||||
|
||||
SecUserSessionObject secUserSessionObject = userCenter.getSessionModel(SecUserSessionObject.class); |
||||
if (secUserSessionObject == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.ACCOUNT_LOGIN_NOT, ""); |
||||
} |
||||
Map<String,Object> param = new HashMap<>(); |
||||
if (secUserSessionObject.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type1.getCode())) { |
||||
param.put("merId", merId); |
||||
} else if (secUserSessionObject.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type2.getCode())) { |
||||
param.put("merId", secUserSessionObject.getAccount().getObjectId()); |
||||
} else { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知权限"); |
||||
} |
||||
param.put("type", type); |
||||
param.put("userPhone", userPhone); |
||||
param.put("childOrderNo", childOrderNo); |
||||
param.put("applyNo", applyNo); |
||||
param.put("status", status); |
||||
param.put("createTimeS", createTimeS); |
||||
param.put("createTimeE", createTimeE); |
||||
|
||||
PageHelper.startPage(pageNum,pageSize); |
||||
return ResponseMsgUtil.success(new PageInfo<>(orderAfterSalesApplyService.getApplyList(param))); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("error!",e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
@RequestMapping(value="/queryUserApplyList",method = RequestMethod.GET) |
||||
@ResponseBody |
||||
@ApiOperation(value = "查询用户申请列表") |
||||
public ResponseData queryUserApplyList(@RequestParam(value = "childOrderNo" , required = false) String childOrderNo, |
||||
@RequestParam(value = "applyNo" , required = false) String applyNo, |
||||
@RequestParam(value = "status" , required = false) Integer status, |
||||
@RequestParam(value = "pageNum" , required = true) Integer pageNum, |
||||
@RequestParam(value = "pageSize" , required = true) Integer pageSize) { |
||||
try { |
||||
|
||||
UserSessionObject userSessionObject = userCenter.getSessionModel(UserSessionObject.class); |
||||
if (userSessionObject == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.ACCOUNT_LOGIN_NOT, ""); |
||||
} |
||||
Map<String,Object> param = new HashMap<>(); |
||||
param.put("userId", userSessionObject.getUser().getId()); |
||||
param.put("childOrderNo", childOrderNo); |
||||
param.put("applyNo", applyNo); |
||||
param.put("status", status); |
||||
|
||||
PageHelper.startPage(pageNum,pageSize); |
||||
return ResponseMsgUtil.success(new PageInfo<>(orderAfterSalesApplyService.getApplyList(param))); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("error!",e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,127 @@ |
||||
package com.order.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.BsOrderRefund; |
||||
import com.hfkj.model.ResponseData; |
||||
import com.hfkj.model.UserSessionObject; |
||||
import com.hfkj.model.order.OrderChildModel; |
||||
import com.hfkj.model.order.OrderModel; |
||||
import com.hfkj.service.order.BsOrderRefundService; |
||||
import com.hfkj.service.order.BsOrderService; |
||||
import com.hfkj.sysenum.UserStatusEnum; |
||||
import com.hfkj.sysenum.order.OrderChildProductTypeEnum; |
||||
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; |
||||
|
||||
/** |
||||
* @className: OrderController |
||||
* @author: HuRui |
||||
* @date: 2024/4/30 |
||||
**/ |
||||
@Controller |
||||
@RequestMapping(value="/refund") |
||||
@Api(value="订单退款业务") |
||||
public class OrderRefundController { |
||||
|
||||
Logger log = LoggerFactory.getLogger(OrderRefundController.class); |
||||
@Resource |
||||
private UserCenter userCenter; |
||||
@Resource |
||||
private BsOrderRefundService orderRefundService; |
||||
|
||||
@RequestMapping(value="/tradeOrder",method = RequestMethod.POST) |
||||
@ResponseBody |
||||
@ApiOperation(value = "退款交易订单") |
||||
public ResponseData tradeOrder(@RequestBody JSONObject body) { |
||||
try { |
||||
// 用户session
|
||||
UserSessionObject userSession = userCenter.getSessionModel(UserSessionObject.class); |
||||
if (userSession == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.ACCOUNT_LOGIN_NOT, ""); |
||||
} |
||||
if (body == null || StringUtils.isBlank(body.getString("orderNo"))) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
||||
} |
||||
|
||||
return ResponseMsgUtil.success(orderRefundService.tradeOrderRefund(body.getString("orderNo"),body.getString("remark"))); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("error!",e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
@RequestMapping(value="/tradeOrderChild",method = RequestMethod.POST) |
||||
@ResponseBody |
||||
@ApiOperation(value = "退款交易子订单") |
||||
public ResponseData tradeOrderChild(@RequestBody JSONObject body) { |
||||
try { |
||||
// 用户session
|
||||
UserSessionObject userSession = userCenter.getSessionModel(UserSessionObject.class); |
||||
if (userSession == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.ACCOUNT_LOGIN_NOT, ""); |
||||
} |
||||
if (!userSession.getUser().getStatus().equals(UserStatusEnum.status1.getCode())) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "该账户已被禁用,无法进行交易"); |
||||
} |
||||
if (body == null |
||||
|| StringUtils.isBlank(body.getString("childOrderNo")) |
||||
|| body.getInteger("productCount") == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
||||
} |
||||
|
||||
return ResponseMsgUtil.success(orderRefundService.tradeOrderChildRefund( |
||||
body.getString("childOrderNo"), |
||||
body.getInteger("productCount"), |
||||
body.getString("remark") |
||||
)); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("error!",e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
@RequestMapping(value="/queryOrderRefund",method = RequestMethod.GET) |
||||
@ResponseBody |
||||
@ApiOperation(value = "查询退款订单") |
||||
public ResponseData queryOrderRefund(@RequestParam(value = "orderNo" , required = false) String orderNo, |
||||
@RequestParam(value = "orderChildNo" , required = false) String orderChildNo, |
||||
@RequestParam(value = "refundOrderNo" , required = false) String refundOrderNo) { |
||||
try { |
||||
if (StringUtils.isBlank(orderNo) |
||||
&& StringUtils.isBlank(orderChildNo) |
||||
&& StringUtils.isBlank(refundOrderNo)) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
||||
} |
||||
|
||||
Map<String,Object> param = new HashMap<>(); |
||||
param.put("orderNo", orderNo); |
||||
param.put("orderChildNo", orderChildNo); |
||||
param.put("refundOrderNo", refundOrderNo); |
||||
return ResponseMsgUtil.success(orderRefundService.getRefundList(param)); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("error!",e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
|
||||
} |
@ -0,0 +1,203 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.BsOrderAfterSalesApply; |
||||
import com.hfkj.entity.BsOrderAfterSalesApplyExample; |
||||
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 BsOrderAfterSalesApplyMapper extends BsOrderAfterSalesApplyMapperExt { |
||||
@SelectProvider(type=BsOrderAfterSalesApplySqlProvider.class, method="countByExample") |
||||
long countByExample(BsOrderAfterSalesApplyExample example); |
||||
|
||||
@DeleteProvider(type=BsOrderAfterSalesApplySqlProvider.class, method="deleteByExample") |
||||
int deleteByExample(BsOrderAfterSalesApplyExample example); |
||||
|
||||
@Delete({ |
||||
"delete from bs_order_after_sales_apply", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int deleteByPrimaryKey(Long id); |
||||
|
||||
@Insert({ |
||||
"insert into bs_order_after_sales_apply (user_id, user_phone, ", |
||||
"mer_id, apply_no, `type`, ", |
||||
"order_no, child_order_no, ", |
||||
"product_type, product_id, ", |
||||
"product_name, product_img, ", |
||||
"product_spec_id, product_spec_name, ", |
||||
"product_count, photo, ", |
||||
"remarks, send_express_no, ", |
||||
"refund_order_no, refund_price, ", |
||||
"refund_integral, `status`, ", |
||||
"audit_remarks, create_time, ", |
||||
"audit_time, send_express_time, ", |
||||
"finish_time, update_time, ", |
||||
"ext_1, ext_2, ext_3)", |
||||
"values (#{userId,jdbcType=BIGINT}, #{userPhone,jdbcType=VARCHAR}, ", |
||||
"#{merId,jdbcType=BIGINT}, #{applyNo,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, ", |
||||
"#{orderNo,jdbcType=VARCHAR}, #{childOrderNo,jdbcType=VARCHAR}, ", |
||||
"#{productType,jdbcType=INTEGER}, #{productId,jdbcType=BIGINT}, ", |
||||
"#{productName,jdbcType=VARCHAR}, #{productImg,jdbcType=VARCHAR}, ", |
||||
"#{productSpecId,jdbcType=BIGINT}, #{productSpecName,jdbcType=VARCHAR}, ", |
||||
"#{productCount,jdbcType=INTEGER}, #{photo,jdbcType=VARCHAR}, ", |
||||
"#{remarks,jdbcType=VARCHAR}, #{sendExpressNo,jdbcType=VARCHAR}, ", |
||||
"#{refundOrderNo,jdbcType=VARCHAR}, #{refundPrice,jdbcType=DECIMAL}, ", |
||||
"#{refundIntegral,jdbcType=BIGINT}, #{status,jdbcType=INTEGER}, ", |
||||
"#{auditRemarks,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ", |
||||
"#{auditTime,jdbcType=TIMESTAMP}, #{sendExpressTime,jdbcType=TIMESTAMP}, ", |
||||
"#{finishTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ", |
||||
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" |
||||
}) |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insert(BsOrderAfterSalesApply record); |
||||
|
||||
@InsertProvider(type=BsOrderAfterSalesApplySqlProvider.class, method="insertSelective") |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insertSelective(BsOrderAfterSalesApply record); |
||||
|
||||
@SelectProvider(type=BsOrderAfterSalesApplySqlProvider.class, method="selectByExample") |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="apply_no", property="applyNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="type", property="type", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="child_order_no", property="childOrderNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="product_type", property="productType", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="product_id", property="productId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="product_name", property="productName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="product_img", property="productImg", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="product_spec_id", property="productSpecId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="product_spec_name", property="productSpecName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="product_count", property="productCount", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="photo", property="photo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="send_express_no", property="sendExpressNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="refund_order_no", property="refundOrderNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="refund_price", property="refundPrice", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="refund_integral", property="refundIntegral", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="audit_remarks", property="auditRemarks", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="audit_time", property="auditTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="send_express_time", property="sendExpressTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="finish_time", property="finishTime", 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<BsOrderAfterSalesApply> selectByExample(BsOrderAfterSalesApplyExample example); |
||||
|
||||
@Select({ |
||||
"select", |
||||
"id, user_id, user_phone, mer_id, apply_no, `type`, order_no, child_order_no, ", |
||||
"product_type, product_id, product_name, product_img, product_spec_id, product_spec_name, ", |
||||
"product_count, photo, remarks, send_express_no, refund_order_no, refund_price, ", |
||||
"refund_integral, `status`, audit_remarks, create_time, audit_time, send_express_time, ", |
||||
"finish_time, update_time, ext_1, ext_2, ext_3", |
||||
"from bs_order_after_sales_apply", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="apply_no", property="applyNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="type", property="type", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="child_order_no", property="childOrderNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="product_type", property="productType", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="product_id", property="productId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="product_name", property="productName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="product_img", property="productImg", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="product_spec_id", property="productSpecId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="product_spec_name", property="productSpecName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="product_count", property="productCount", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="photo", property="photo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="send_express_no", property="sendExpressNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="refund_order_no", property="refundOrderNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="refund_price", property="refundPrice", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="refund_integral", property="refundIntegral", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="audit_remarks", property="auditRemarks", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="audit_time", property="auditTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="send_express_time", property="sendExpressTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="finish_time", property="finishTime", 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) |
||||
}) |
||||
BsOrderAfterSalesApply selectByPrimaryKey(Long id); |
||||
|
||||
@UpdateProvider(type=BsOrderAfterSalesApplySqlProvider.class, method="updateByExampleSelective") |
||||
int updateByExampleSelective(@Param("record") BsOrderAfterSalesApply record, @Param("example") BsOrderAfterSalesApplyExample example); |
||||
|
||||
@UpdateProvider(type=BsOrderAfterSalesApplySqlProvider.class, method="updateByExample") |
||||
int updateByExample(@Param("record") BsOrderAfterSalesApply record, @Param("example") BsOrderAfterSalesApplyExample example); |
||||
|
||||
@UpdateProvider(type=BsOrderAfterSalesApplySqlProvider.class, method="updateByPrimaryKeySelective") |
||||
int updateByPrimaryKeySelective(BsOrderAfterSalesApply record); |
||||
|
||||
@Update({ |
||||
"update bs_order_after_sales_apply", |
||||
"set user_id = #{userId,jdbcType=BIGINT},", |
||||
"user_phone = #{userPhone,jdbcType=VARCHAR},", |
||||
"mer_id = #{merId,jdbcType=BIGINT},", |
||||
"apply_no = #{applyNo,jdbcType=VARCHAR},", |
||||
"`type` = #{type,jdbcType=INTEGER},", |
||||
"order_no = #{orderNo,jdbcType=VARCHAR},", |
||||
"child_order_no = #{childOrderNo,jdbcType=VARCHAR},", |
||||
"product_type = #{productType,jdbcType=INTEGER},", |
||||
"product_id = #{productId,jdbcType=BIGINT},", |
||||
"product_name = #{productName,jdbcType=VARCHAR},", |
||||
"product_img = #{productImg,jdbcType=VARCHAR},", |
||||
"product_spec_id = #{productSpecId,jdbcType=BIGINT},", |
||||
"product_spec_name = #{productSpecName,jdbcType=VARCHAR},", |
||||
"product_count = #{productCount,jdbcType=INTEGER},", |
||||
"photo = #{photo,jdbcType=VARCHAR},", |
||||
"remarks = #{remarks,jdbcType=VARCHAR},", |
||||
"send_express_no = #{sendExpressNo,jdbcType=VARCHAR},", |
||||
"refund_order_no = #{refundOrderNo,jdbcType=VARCHAR},", |
||||
"refund_price = #{refundPrice,jdbcType=DECIMAL},", |
||||
"refund_integral = #{refundIntegral,jdbcType=BIGINT},", |
||||
"`status` = #{status,jdbcType=INTEGER},", |
||||
"audit_remarks = #{auditRemarks,jdbcType=VARCHAR},", |
||||
"create_time = #{createTime,jdbcType=TIMESTAMP},", |
||||
"audit_time = #{auditTime,jdbcType=TIMESTAMP},", |
||||
"send_express_time = #{sendExpressTime,jdbcType=TIMESTAMP},", |
||||
"finish_time = #{finishTime,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(BsOrderAfterSalesApply record); |
||||
} |
@ -0,0 +1,7 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
/** |
||||
* mapper扩展类 |
||||
*/ |
||||
public interface BsOrderAfterSalesApplyMapperExt { |
||||
} |
@ -0,0 +1,598 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.BsOrderAfterSalesApply; |
||||
import com.hfkj.entity.BsOrderAfterSalesApplyExample.Criteria; |
||||
import com.hfkj.entity.BsOrderAfterSalesApplyExample.Criterion; |
||||
import com.hfkj.entity.BsOrderAfterSalesApplyExample; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import org.apache.ibatis.jdbc.SQL; |
||||
|
||||
public class BsOrderAfterSalesApplySqlProvider { |
||||
|
||||
public String countByExample(BsOrderAfterSalesApplyExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.SELECT("count(*)").FROM("bs_order_after_sales_apply"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String deleteByExample(BsOrderAfterSalesApplyExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.DELETE_FROM("bs_order_after_sales_apply"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String insertSelective(BsOrderAfterSalesApply record) { |
||||
SQL sql = new SQL(); |
||||
sql.INSERT_INTO("bs_order_after_sales_apply"); |
||||
|
||||
if (record.getUserId() != null) { |
||||
sql.VALUES("user_id", "#{userId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getUserPhone() != null) { |
||||
sql.VALUES("user_phone", "#{userPhone,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getMerId() != null) { |
||||
sql.VALUES("mer_id", "#{merId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getApplyNo() != null) { |
||||
sql.VALUES("apply_no", "#{applyNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getType() != null) { |
||||
sql.VALUES("`type`", "#{type,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getOrderNo() != null) { |
||||
sql.VALUES("order_no", "#{orderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getChildOrderNo() != null) { |
||||
sql.VALUES("child_order_no", "#{childOrderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getProductType() != null) { |
||||
sql.VALUES("product_type", "#{productType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getProductId() != null) { |
||||
sql.VALUES("product_id", "#{productId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getProductName() != null) { |
||||
sql.VALUES("product_name", "#{productName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getProductImg() != null) { |
||||
sql.VALUES("product_img", "#{productImg,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getProductSpecId() != null) { |
||||
sql.VALUES("product_spec_id", "#{productSpecId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getProductSpecName() != null) { |
||||
sql.VALUES("product_spec_name", "#{productSpecName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getProductCount() != null) { |
||||
sql.VALUES("product_count", "#{productCount,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getPhoto() != null) { |
||||
sql.VALUES("photo", "#{photo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getRemarks() != null) { |
||||
sql.VALUES("remarks", "#{remarks,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getSendExpressNo() != null) { |
||||
sql.VALUES("send_express_no", "#{sendExpressNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getRefundOrderNo() != null) { |
||||
sql.VALUES("refund_order_no", "#{refundOrderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getRefundPrice() != null) { |
||||
sql.VALUES("refund_price", "#{refundPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getRefundIntegral() != null) { |
||||
sql.VALUES("refund_integral", "#{refundIntegral,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getAuditRemarks() != null) { |
||||
sql.VALUES("audit_remarks", "#{auditRemarks,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getAuditTime() != null) { |
||||
sql.VALUES("audit_time", "#{auditTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getSendExpressTime() != null) { |
||||
sql.VALUES("send_express_time", "#{sendExpressTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getFinishTime() != null) { |
||||
sql.VALUES("finish_time", "#{finishTime,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(BsOrderAfterSalesApplyExample example) { |
||||
SQL sql = new SQL(); |
||||
if (example != null && example.isDistinct()) { |
||||
sql.SELECT_DISTINCT("id"); |
||||
} else { |
||||
sql.SELECT("id"); |
||||
} |
||||
sql.SELECT("user_id"); |
||||
sql.SELECT("user_phone"); |
||||
sql.SELECT("mer_id"); |
||||
sql.SELECT("apply_no"); |
||||
sql.SELECT("`type`"); |
||||
sql.SELECT("order_no"); |
||||
sql.SELECT("child_order_no"); |
||||
sql.SELECT("product_type"); |
||||
sql.SELECT("product_id"); |
||||
sql.SELECT("product_name"); |
||||
sql.SELECT("product_img"); |
||||
sql.SELECT("product_spec_id"); |
||||
sql.SELECT("product_spec_name"); |
||||
sql.SELECT("product_count"); |
||||
sql.SELECT("photo"); |
||||
sql.SELECT("remarks"); |
||||
sql.SELECT("send_express_no"); |
||||
sql.SELECT("refund_order_no"); |
||||
sql.SELECT("refund_price"); |
||||
sql.SELECT("refund_integral"); |
||||
sql.SELECT("`status`"); |
||||
sql.SELECT("audit_remarks"); |
||||
sql.SELECT("create_time"); |
||||
sql.SELECT("audit_time"); |
||||
sql.SELECT("send_express_time"); |
||||
sql.SELECT("finish_time"); |
||||
sql.SELECT("update_time"); |
||||
sql.SELECT("ext_1"); |
||||
sql.SELECT("ext_2"); |
||||
sql.SELECT("ext_3"); |
||||
sql.FROM("bs_order_after_sales_apply"); |
||||
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) { |
||||
BsOrderAfterSalesApply record = (BsOrderAfterSalesApply) parameter.get("record"); |
||||
BsOrderAfterSalesApplyExample example = (BsOrderAfterSalesApplyExample) parameter.get("example"); |
||||
|
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_order_after_sales_apply"); |
||||
|
||||
if (record.getId() != null) { |
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getUserId() != null) { |
||||
sql.SET("user_id = #{record.userId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getUserPhone() != null) { |
||||
sql.SET("user_phone = #{record.userPhone,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getMerId() != null) { |
||||
sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getApplyNo() != null) { |
||||
sql.SET("apply_no = #{record.applyNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getType() != null) { |
||||
sql.SET("`type` = #{record.type,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getOrderNo() != null) { |
||||
sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getChildOrderNo() != null) { |
||||
sql.SET("child_order_no = #{record.childOrderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getProductType() != null) { |
||||
sql.SET("product_type = #{record.productType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getProductId() != null) { |
||||
sql.SET("product_id = #{record.productId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getProductName() != null) { |
||||
sql.SET("product_name = #{record.productName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getProductImg() != null) { |
||||
sql.SET("product_img = #{record.productImg,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getProductSpecId() != null) { |
||||
sql.SET("product_spec_id = #{record.productSpecId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getProductSpecName() != null) { |
||||
sql.SET("product_spec_name = #{record.productSpecName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getProductCount() != null) { |
||||
sql.SET("product_count = #{record.productCount,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getPhoto() != null) { |
||||
sql.SET("photo = #{record.photo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getRemarks() != null) { |
||||
sql.SET("remarks = #{record.remarks,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getSendExpressNo() != null) { |
||||
sql.SET("send_express_no = #{record.sendExpressNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getRefundOrderNo() != null) { |
||||
sql.SET("refund_order_no = #{record.refundOrderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getRefundPrice() != null) { |
||||
sql.SET("refund_price = #{record.refundPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getRefundIntegral() != null) { |
||||
sql.SET("refund_integral = #{record.refundIntegral,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getAuditRemarks() != null) { |
||||
sql.SET("audit_remarks = #{record.auditRemarks,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getAuditTime() != null) { |
||||
sql.SET("audit_time = #{record.auditTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getSendExpressTime() != null) { |
||||
sql.SET("send_express_time = #{record.sendExpressTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getFinishTime() != null) { |
||||
sql.SET("finish_time = #{record.finishTime,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_order_after_sales_apply"); |
||||
|
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
sql.SET("user_id = #{record.userId,jdbcType=BIGINT}"); |
||||
sql.SET("user_phone = #{record.userPhone,jdbcType=VARCHAR}"); |
||||
sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}"); |
||||
sql.SET("apply_no = #{record.applyNo,jdbcType=VARCHAR}"); |
||||
sql.SET("`type` = #{record.type,jdbcType=INTEGER}"); |
||||
sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}"); |
||||
sql.SET("child_order_no = #{record.childOrderNo,jdbcType=VARCHAR}"); |
||||
sql.SET("product_type = #{record.productType,jdbcType=INTEGER}"); |
||||
sql.SET("product_id = #{record.productId,jdbcType=BIGINT}"); |
||||
sql.SET("product_name = #{record.productName,jdbcType=VARCHAR}"); |
||||
sql.SET("product_img = #{record.productImg,jdbcType=VARCHAR}"); |
||||
sql.SET("product_spec_id = #{record.productSpecId,jdbcType=BIGINT}"); |
||||
sql.SET("product_spec_name = #{record.productSpecName,jdbcType=VARCHAR}"); |
||||
sql.SET("product_count = #{record.productCount,jdbcType=INTEGER}"); |
||||
sql.SET("photo = #{record.photo,jdbcType=VARCHAR}"); |
||||
sql.SET("remarks = #{record.remarks,jdbcType=VARCHAR}"); |
||||
sql.SET("send_express_no = #{record.sendExpressNo,jdbcType=VARCHAR}"); |
||||
sql.SET("refund_order_no = #{record.refundOrderNo,jdbcType=VARCHAR}"); |
||||
sql.SET("refund_price = #{record.refundPrice,jdbcType=DECIMAL}"); |
||||
sql.SET("refund_integral = #{record.refundIntegral,jdbcType=BIGINT}"); |
||||
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); |
||||
sql.SET("audit_remarks = #{record.auditRemarks,jdbcType=VARCHAR}"); |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("audit_time = #{record.auditTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("send_express_time = #{record.sendExpressTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("finish_time = #{record.finishTime,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}"); |
||||
|
||||
BsOrderAfterSalesApplyExample example = (BsOrderAfterSalesApplyExample) parameter.get("example"); |
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByPrimaryKeySelective(BsOrderAfterSalesApply record) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_order_after_sales_apply"); |
||||
|
||||
if (record.getUserId() != null) { |
||||
sql.SET("user_id = #{userId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getUserPhone() != null) { |
||||
sql.SET("user_phone = #{userPhone,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getMerId() != null) { |
||||
sql.SET("mer_id = #{merId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getApplyNo() != null) { |
||||
sql.SET("apply_no = #{applyNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getType() != null) { |
||||
sql.SET("`type` = #{type,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getOrderNo() != null) { |
||||
sql.SET("order_no = #{orderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getChildOrderNo() != null) { |
||||
sql.SET("child_order_no = #{childOrderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getProductType() != null) { |
||||
sql.SET("product_type = #{productType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getProductId() != null) { |
||||
sql.SET("product_id = #{productId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getProductName() != null) { |
||||
sql.SET("product_name = #{productName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getProductImg() != null) { |
||||
sql.SET("product_img = #{productImg,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getProductSpecId() != null) { |
||||
sql.SET("product_spec_id = #{productSpecId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getProductSpecName() != null) { |
||||
sql.SET("product_spec_name = #{productSpecName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getProductCount() != null) { |
||||
sql.SET("product_count = #{productCount,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getPhoto() != null) { |
||||
sql.SET("photo = #{photo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getRemarks() != null) { |
||||
sql.SET("remarks = #{remarks,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getSendExpressNo() != null) { |
||||
sql.SET("send_express_no = #{sendExpressNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getRefundOrderNo() != null) { |
||||
sql.SET("refund_order_no = #{refundOrderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getRefundPrice() != null) { |
||||
sql.SET("refund_price = #{refundPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getRefundIntegral() != null) { |
||||
sql.SET("refund_integral = #{refundIntegral,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.SET("`status` = #{status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getAuditRemarks() != null) { |
||||
sql.SET("audit_remarks = #{auditRemarks,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getAuditTime() != null) { |
||||
sql.SET("audit_time = #{auditTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getSendExpressTime() != null) { |
||||
sql.SET("send_express_time = #{sendExpressTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getFinishTime() != null) { |
||||
sql.SET("finish_time = #{finishTime,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, BsOrderAfterSalesApplyExample 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()); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,125 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.BsOrderAfterSalesOpRecord; |
||||
import com.hfkj.entity.BsOrderAfterSalesOpRecordExample; |
||||
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 BsOrderAfterSalesOpRecordMapper extends BsOrderAfterSalesOpRecordMapperExt { |
||||
@SelectProvider(type=BsOrderAfterSalesOpRecordSqlProvider.class, method="countByExample") |
||||
long countByExample(BsOrderAfterSalesOpRecordExample example); |
||||
|
||||
@DeleteProvider(type=BsOrderAfterSalesOpRecordSqlProvider.class, method="deleteByExample") |
||||
int deleteByExample(BsOrderAfterSalesOpRecordExample example); |
||||
|
||||
@Delete({ |
||||
"delete from bs_order_after_sales_op_record", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int deleteByPrimaryKey(Long id); |
||||
|
||||
@Insert({ |
||||
"insert into bs_order_after_sales_op_record (apply_no, `status`, ", |
||||
"photo, remarks, ", |
||||
"op_user_type, op_user_id, ", |
||||
"op_user_name, create_time, ", |
||||
"ext_1, ext_2, ext_3)", |
||||
"values (#{applyNo,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ", |
||||
"#{photo,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR}, ", |
||||
"#{opUserType,jdbcType=INTEGER}, #{opUserId,jdbcType=BIGINT}, ", |
||||
"#{opUserName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ", |
||||
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" |
||||
}) |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insert(BsOrderAfterSalesOpRecord record); |
||||
|
||||
@InsertProvider(type=BsOrderAfterSalesOpRecordSqlProvider.class, method="insertSelective") |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insertSelective(BsOrderAfterSalesOpRecord record); |
||||
|
||||
@SelectProvider(type=BsOrderAfterSalesOpRecordSqlProvider.class, method="selectByExample") |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="apply_no", property="applyNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="photo", property="photo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="op_user_type", property="opUserType", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="op_user_id", property="opUserId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="op_user_name", property="opUserName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="create_time", property="createTime", 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<BsOrderAfterSalesOpRecord> selectByExample(BsOrderAfterSalesOpRecordExample example); |
||||
|
||||
@Select({ |
||||
"select", |
||||
"id, apply_no, `status`, photo, remarks, op_user_type, op_user_id, op_user_name, ", |
||||
"create_time, ext_1, ext_2, ext_3", |
||||
"from bs_order_after_sales_op_record", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="apply_no", property="applyNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="photo", property="photo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="op_user_type", property="opUserType", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="op_user_id", property="opUserId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="op_user_name", property="opUserName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="create_time", property="createTime", 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) |
||||
}) |
||||
BsOrderAfterSalesOpRecord selectByPrimaryKey(Long id); |
||||
|
||||
@UpdateProvider(type=BsOrderAfterSalesOpRecordSqlProvider.class, method="updateByExampleSelective") |
||||
int updateByExampleSelective(@Param("record") BsOrderAfterSalesOpRecord record, @Param("example") BsOrderAfterSalesOpRecordExample example); |
||||
|
||||
@UpdateProvider(type=BsOrderAfterSalesOpRecordSqlProvider.class, method="updateByExample") |
||||
int updateByExample(@Param("record") BsOrderAfterSalesOpRecord record, @Param("example") BsOrderAfterSalesOpRecordExample example); |
||||
|
||||
@UpdateProvider(type=BsOrderAfterSalesOpRecordSqlProvider.class, method="updateByPrimaryKeySelective") |
||||
int updateByPrimaryKeySelective(BsOrderAfterSalesOpRecord record); |
||||
|
||||
@Update({ |
||||
"update bs_order_after_sales_op_record", |
||||
"set apply_no = #{applyNo,jdbcType=VARCHAR},", |
||||
"`status` = #{status,jdbcType=INTEGER},", |
||||
"photo = #{photo,jdbcType=VARCHAR},", |
||||
"remarks = #{remarks,jdbcType=VARCHAR},", |
||||
"op_user_type = #{opUserType,jdbcType=INTEGER},", |
||||
"op_user_id = #{opUserId,jdbcType=BIGINT},", |
||||
"op_user_name = #{opUserName,jdbcType=VARCHAR},", |
||||
"create_time = #{createTime,jdbcType=TIMESTAMP},", |
||||
"ext_1 = #{ext1,jdbcType=VARCHAR},", |
||||
"ext_2 = #{ext2,jdbcType=VARCHAR},", |
||||
"ext_3 = #{ext3,jdbcType=VARCHAR}", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int updateByPrimaryKey(BsOrderAfterSalesOpRecord record); |
||||
} |
@ -0,0 +1,7 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
/** |
||||
* mapper扩展类 |
||||
*/ |
||||
public interface BsOrderAfterSalesOpRecordMapperExt { |
||||
} |
@ -0,0 +1,332 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.BsOrderAfterSalesOpRecord; |
||||
import com.hfkj.entity.BsOrderAfterSalesOpRecordExample.Criteria; |
||||
import com.hfkj.entity.BsOrderAfterSalesOpRecordExample.Criterion; |
||||
import com.hfkj.entity.BsOrderAfterSalesOpRecordExample; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import org.apache.ibatis.jdbc.SQL; |
||||
|
||||
public class BsOrderAfterSalesOpRecordSqlProvider { |
||||
|
||||
public String countByExample(BsOrderAfterSalesOpRecordExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.SELECT("count(*)").FROM("bs_order_after_sales_op_record"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String deleteByExample(BsOrderAfterSalesOpRecordExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.DELETE_FROM("bs_order_after_sales_op_record"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String insertSelective(BsOrderAfterSalesOpRecord record) { |
||||
SQL sql = new SQL(); |
||||
sql.INSERT_INTO("bs_order_after_sales_op_record"); |
||||
|
||||
if (record.getApplyNo() != null) { |
||||
sql.VALUES("apply_no", "#{applyNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getPhoto() != null) { |
||||
sql.VALUES("photo", "#{photo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getRemarks() != null) { |
||||
sql.VALUES("remarks", "#{remarks,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getOpUserType() != null) { |
||||
sql.VALUES("op_user_type", "#{opUserType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
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.getCreateTime() != null) { |
||||
sql.VALUES("create_time", "#{createTime,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(BsOrderAfterSalesOpRecordExample example) { |
||||
SQL sql = new SQL(); |
||||
if (example != null && example.isDistinct()) { |
||||
sql.SELECT_DISTINCT("id"); |
||||
} else { |
||||
sql.SELECT("id"); |
||||
} |
||||
sql.SELECT("apply_no"); |
||||
sql.SELECT("`status`"); |
||||
sql.SELECT("photo"); |
||||
sql.SELECT("remarks"); |
||||
sql.SELECT("op_user_type"); |
||||
sql.SELECT("op_user_id"); |
||||
sql.SELECT("op_user_name"); |
||||
sql.SELECT("create_time"); |
||||
sql.SELECT("ext_1"); |
||||
sql.SELECT("ext_2"); |
||||
sql.SELECT("ext_3"); |
||||
sql.FROM("bs_order_after_sales_op_record"); |
||||
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) { |
||||
BsOrderAfterSalesOpRecord record = (BsOrderAfterSalesOpRecord) parameter.get("record"); |
||||
BsOrderAfterSalesOpRecordExample example = (BsOrderAfterSalesOpRecordExample) parameter.get("example"); |
||||
|
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_order_after_sales_op_record"); |
||||
|
||||
if (record.getId() != null) { |
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getApplyNo() != null) { |
||||
sql.SET("apply_no = #{record.applyNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getPhoto() != null) { |
||||
sql.SET("photo = #{record.photo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getRemarks() != null) { |
||||
sql.SET("remarks = #{record.remarks,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getOpUserType() != null) { |
||||
sql.SET("op_user_type = #{record.opUserType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
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.getCreateTime() != null) { |
||||
sql.SET("create_time = #{record.createTime,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_order_after_sales_op_record"); |
||||
|
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
sql.SET("apply_no = #{record.applyNo,jdbcType=VARCHAR}"); |
||||
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); |
||||
sql.SET("photo = #{record.photo,jdbcType=VARCHAR}"); |
||||
sql.SET("remarks = #{record.remarks,jdbcType=VARCHAR}"); |
||||
sql.SET("op_user_type = #{record.opUserType,jdbcType=INTEGER}"); |
||||
sql.SET("op_user_id = #{record.opUserId,jdbcType=BIGINT}"); |
||||
sql.SET("op_user_name = #{record.opUserName,jdbcType=VARCHAR}"); |
||||
sql.SET("create_time = #{record.createTime,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}"); |
||||
|
||||
BsOrderAfterSalesOpRecordExample example = (BsOrderAfterSalesOpRecordExample) parameter.get("example"); |
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByPrimaryKeySelective(BsOrderAfterSalesOpRecord record) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_order_after_sales_op_record"); |
||||
|
||||
if (record.getApplyNo() != null) { |
||||
sql.SET("apply_no = #{applyNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.SET("`status` = #{status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getPhoto() != null) { |
||||
sql.SET("photo = #{photo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getRemarks() != null) { |
||||
sql.SET("remarks = #{remarks,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getOpUserType() != null) { |
||||
sql.SET("op_user_type = #{opUserType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
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.getCreateTime() != null) { |
||||
sql.SET("create_time = #{createTime,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, BsOrderAfterSalesOpRecordExample 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()); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,537 @@ |
||||
package com.hfkj.entity; |
||||
|
||||
import java.io.Serializable; |
||||
import java.math.BigDecimal; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* bs_order_after_sales_apply |
||||
* @author |
||||
*/ |
||||
/** |
||||
* |
||||
* 代码由工具生成 |
||||
* |
||||
**/ |
||||
public class BsOrderAfterSalesApply implements Serializable { |
||||
/** |
||||
* 主键ID |
||||
*/ |
||||
private Long id; |
||||
|
||||
/** |
||||
* 用户id |
||||
*/ |
||||
private Long userId; |
||||
|
||||
/** |
||||
* 用户电话 |
||||
*/ |
||||
private String userPhone; |
||||
|
||||
/** |
||||
* 商户id |
||||
*/ |
||||
private Long merId; |
||||
|
||||
/** |
||||
* 申请单号 |
||||
*/ |
||||
private String applyNo; |
||||
|
||||
/** |
||||
* 售后类型 1:退款申请 2:退货申请 |
||||
*/ |
||||
private Integer type; |
||||
|
||||
/** |
||||
* 订单号 |
||||
*/ |
||||
private String orderNo; |
||||
|
||||
/** |
||||
* 子订单号 |
||||
*/ |
||||
private String childOrderNo; |
||||
|
||||
/** |
||||
* 产品类型 |
||||
*/ |
||||
private Integer productType; |
||||
|
||||
/** |
||||
* 产品id |
||||
*/ |
||||
private Long productId; |
||||
|
||||
/** |
||||
* 产品名称 |
||||
*/ |
||||
private String productName; |
||||
|
||||
/** |
||||
* 产品图片 |
||||
*/ |
||||
private String productImg; |
||||
|
||||
/** |
||||
* 产品规格id |
||||
*/ |
||||
private Long productSpecId; |
||||
|
||||
/** |
||||
* 产品规格名称 |
||||
*/ |
||||
private String productSpecName; |
||||
|
||||
/** |
||||
* 产品数量 |
||||
*/ |
||||
private Integer productCount; |
||||
|
||||
/** |
||||
* 照片 |
||||
*/ |
||||
private String photo; |
||||
|
||||
/** |
||||
* 备注 |
||||
*/ |
||||
private String remarks; |
||||
|
||||
/** |
||||
* 邮寄快递单号 |
||||
*/ |
||||
private String sendExpressNo; |
||||
|
||||
/** |
||||
* 退款单号 |
||||
*/ |
||||
private String refundOrderNo; |
||||
|
||||
/** |
||||
* 退款金额 |
||||
*/ |
||||
private BigDecimal refundPrice; |
||||
|
||||
/** |
||||
* 退款积分金额 |
||||
*/ |
||||
private Long refundIntegral; |
||||
|
||||
/** |
||||
* 状态 1:审核中 2:审核驳回 3:待邮寄 4:邮寄中 5:完成 |
||||
*/ |
||||
private Integer status; |
||||
|
||||
/** |
||||
* 审核备注 |
||||
*/ |
||||
private String auditRemarks; |
||||
|
||||
/** |
||||
* 创建时间 |
||||
*/ |
||||
private Date createTime; |
||||
|
||||
/** |
||||
* 审核时间 |
||||
*/ |
||||
private Date auditTime; |
||||
|
||||
/** |
||||
* 邮寄时间 |
||||
*/ |
||||
private Date sendExpressTime; |
||||
|
||||
/** |
||||
* 完成时间 |
||||
*/ |
||||
private Date finishTime; |
||||
|
||||
/** |
||||
* 更新时间 |
||||
*/ |
||||
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 Long getUserId() { |
||||
return userId; |
||||
} |
||||
|
||||
public void setUserId(Long userId) { |
||||
this.userId = userId; |
||||
} |
||||
|
||||
public String getUserPhone() { |
||||
return userPhone; |
||||
} |
||||
|
||||
public void setUserPhone(String userPhone) { |
||||
this.userPhone = userPhone; |
||||
} |
||||
|
||||
public Long getMerId() { |
||||
return merId; |
||||
} |
||||
|
||||
public void setMerId(Long merId) { |
||||
this.merId = merId; |
||||
} |
||||
|
||||
public String getApplyNo() { |
||||
return applyNo; |
||||
} |
||||
|
||||
public void setApplyNo(String applyNo) { |
||||
this.applyNo = applyNo; |
||||
} |
||||
|
||||
public Integer getType() { |
||||
return type; |
||||
} |
||||
|
||||
public void setType(Integer type) { |
||||
this.type = type; |
||||
} |
||||
|
||||
public String getOrderNo() { |
||||
return orderNo; |
||||
} |
||||
|
||||
public void setOrderNo(String orderNo) { |
||||
this.orderNo = orderNo; |
||||
} |
||||
|
||||
public String getChildOrderNo() { |
||||
return childOrderNo; |
||||
} |
||||
|
||||
public void setChildOrderNo(String childOrderNo) { |
||||
this.childOrderNo = childOrderNo; |
||||
} |
||||
|
||||
public Integer getProductType() { |
||||
return productType; |
||||
} |
||||
|
||||
public void setProductType(Integer productType) { |
||||
this.productType = productType; |
||||
} |
||||
|
||||
public Long getProductId() { |
||||
return productId; |
||||
} |
||||
|
||||
public void setProductId(Long productId) { |
||||
this.productId = productId; |
||||
} |
||||
|
||||
public String getProductName() { |
||||
return productName; |
||||
} |
||||
|
||||
public void setProductName(String productName) { |
||||
this.productName = productName; |
||||
} |
||||
|
||||
public String getProductImg() { |
||||
return productImg; |
||||
} |
||||
|
||||
public void setProductImg(String productImg) { |
||||
this.productImg = productImg; |
||||
} |
||||
|
||||
public Long getProductSpecId() { |
||||
return productSpecId; |
||||
} |
||||
|
||||
public void setProductSpecId(Long productSpecId) { |
||||
this.productSpecId = productSpecId; |
||||
} |
||||
|
||||
public String getProductSpecName() { |
||||
return productSpecName; |
||||
} |
||||
|
||||
public void setProductSpecName(String productSpecName) { |
||||
this.productSpecName = productSpecName; |
||||
} |
||||
|
||||
public Integer getProductCount() { |
||||
return productCount; |
||||
} |
||||
|
||||
public void setProductCount(Integer productCount) { |
||||
this.productCount = productCount; |
||||
} |
||||
|
||||
public String getPhoto() { |
||||
return photo; |
||||
} |
||||
|
||||
public void setPhoto(String photo) { |
||||
this.photo = photo; |
||||
} |
||||
|
||||
public String getRemarks() { |
||||
return remarks; |
||||
} |
||||
|
||||
public void setRemarks(String remarks) { |
||||
this.remarks = remarks; |
||||
} |
||||
|
||||
public String getSendExpressNo() { |
||||
return sendExpressNo; |
||||
} |
||||
|
||||
public void setSendExpressNo(String sendExpressNo) { |
||||
this.sendExpressNo = sendExpressNo; |
||||
} |
||||
|
||||
public String getRefundOrderNo() { |
||||
return refundOrderNo; |
||||
} |
||||
|
||||
public void setRefundOrderNo(String refundOrderNo) { |
||||
this.refundOrderNo = refundOrderNo; |
||||
} |
||||
|
||||
public BigDecimal getRefundPrice() { |
||||
return refundPrice; |
||||
} |
||||
|
||||
public void setRefundPrice(BigDecimal refundPrice) { |
||||
this.refundPrice = refundPrice; |
||||
} |
||||
|
||||
public Long getRefundIntegral() { |
||||
return refundIntegral; |
||||
} |
||||
|
||||
public void setRefundIntegral(Long refundIntegral) { |
||||
this.refundIntegral = refundIntegral; |
||||
} |
||||
|
||||
public Integer getStatus() { |
||||
return status; |
||||
} |
||||
|
||||
public void setStatus(Integer status) { |
||||
this.status = status; |
||||
} |
||||
|
||||
public String getAuditRemarks() { |
||||
return auditRemarks; |
||||
} |
||||
|
||||
public void setAuditRemarks(String auditRemarks) { |
||||
this.auditRemarks = auditRemarks; |
||||
} |
||||
|
||||
public Date getCreateTime() { |
||||
return createTime; |
||||
} |
||||
|
||||
public void setCreateTime(Date createTime) { |
||||
this.createTime = createTime; |
||||
} |
||||
|
||||
public Date getAuditTime() { |
||||
return auditTime; |
||||
} |
||||
|
||||
public void setAuditTime(Date auditTime) { |
||||
this.auditTime = auditTime; |
||||
} |
||||
|
||||
public Date getSendExpressTime() { |
||||
return sendExpressTime; |
||||
} |
||||
|
||||
public void setSendExpressTime(Date sendExpressTime) { |
||||
this.sendExpressTime = sendExpressTime; |
||||
} |
||||
|
||||
public Date getFinishTime() { |
||||
return finishTime; |
||||
} |
||||
|
||||
public void setFinishTime(Date finishTime) { |
||||
this.finishTime = finishTime; |
||||
} |
||||
|
||||
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; |
||||
} |
||||
BsOrderAfterSalesApply other = (BsOrderAfterSalesApply) that; |
||||
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) |
||||
&& (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId())) |
||||
&& (this.getUserPhone() == null ? other.getUserPhone() == null : this.getUserPhone().equals(other.getUserPhone())) |
||||
&& (this.getMerId() == null ? other.getMerId() == null : this.getMerId().equals(other.getMerId())) |
||||
&& (this.getApplyNo() == null ? other.getApplyNo() == null : this.getApplyNo().equals(other.getApplyNo())) |
||||
&& (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType())) |
||||
&& (this.getOrderNo() == null ? other.getOrderNo() == null : this.getOrderNo().equals(other.getOrderNo())) |
||||
&& (this.getChildOrderNo() == null ? other.getChildOrderNo() == null : this.getChildOrderNo().equals(other.getChildOrderNo())) |
||||
&& (this.getProductType() == null ? other.getProductType() == null : this.getProductType().equals(other.getProductType())) |
||||
&& (this.getProductId() == null ? other.getProductId() == null : this.getProductId().equals(other.getProductId())) |
||||
&& (this.getProductName() == null ? other.getProductName() == null : this.getProductName().equals(other.getProductName())) |
||||
&& (this.getProductImg() == null ? other.getProductImg() == null : this.getProductImg().equals(other.getProductImg())) |
||||
&& (this.getProductSpecId() == null ? other.getProductSpecId() == null : this.getProductSpecId().equals(other.getProductSpecId())) |
||||
&& (this.getProductSpecName() == null ? other.getProductSpecName() == null : this.getProductSpecName().equals(other.getProductSpecName())) |
||||
&& (this.getProductCount() == null ? other.getProductCount() == null : this.getProductCount().equals(other.getProductCount())) |
||||
&& (this.getPhoto() == null ? other.getPhoto() == null : this.getPhoto().equals(other.getPhoto())) |
||||
&& (this.getRemarks() == null ? other.getRemarks() == null : this.getRemarks().equals(other.getRemarks())) |
||||
&& (this.getSendExpressNo() == null ? other.getSendExpressNo() == null : this.getSendExpressNo().equals(other.getSendExpressNo())) |
||||
&& (this.getRefundOrderNo() == null ? other.getRefundOrderNo() == null : this.getRefundOrderNo().equals(other.getRefundOrderNo())) |
||||
&& (this.getRefundPrice() == null ? other.getRefundPrice() == null : this.getRefundPrice().equals(other.getRefundPrice())) |
||||
&& (this.getRefundIntegral() == null ? other.getRefundIntegral() == null : this.getRefundIntegral().equals(other.getRefundIntegral())) |
||||
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) |
||||
&& (this.getAuditRemarks() == null ? other.getAuditRemarks() == null : this.getAuditRemarks().equals(other.getAuditRemarks())) |
||||
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) |
||||
&& (this.getAuditTime() == null ? other.getAuditTime() == null : this.getAuditTime().equals(other.getAuditTime())) |
||||
&& (this.getSendExpressTime() == null ? other.getSendExpressTime() == null : this.getSendExpressTime().equals(other.getSendExpressTime())) |
||||
&& (this.getFinishTime() == null ? other.getFinishTime() == null : this.getFinishTime().equals(other.getFinishTime())) |
||||
&& (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 + ((getUserId() == null) ? 0 : getUserId().hashCode()); |
||||
result = prime * result + ((getUserPhone() == null) ? 0 : getUserPhone().hashCode()); |
||||
result = prime * result + ((getMerId() == null) ? 0 : getMerId().hashCode()); |
||||
result = prime * result + ((getApplyNo() == null) ? 0 : getApplyNo().hashCode()); |
||||
result = prime * result + ((getType() == null) ? 0 : getType().hashCode()); |
||||
result = prime * result + ((getOrderNo() == null) ? 0 : getOrderNo().hashCode()); |
||||
result = prime * result + ((getChildOrderNo() == null) ? 0 : getChildOrderNo().hashCode()); |
||||
result = prime * result + ((getProductType() == null) ? 0 : getProductType().hashCode()); |
||||
result = prime * result + ((getProductId() == null) ? 0 : getProductId().hashCode()); |
||||
result = prime * result + ((getProductName() == null) ? 0 : getProductName().hashCode()); |
||||
result = prime * result + ((getProductImg() == null) ? 0 : getProductImg().hashCode()); |
||||
result = prime * result + ((getProductSpecId() == null) ? 0 : getProductSpecId().hashCode()); |
||||
result = prime * result + ((getProductSpecName() == null) ? 0 : getProductSpecName().hashCode()); |
||||
result = prime * result + ((getProductCount() == null) ? 0 : getProductCount().hashCode()); |
||||
result = prime * result + ((getPhoto() == null) ? 0 : getPhoto().hashCode()); |
||||
result = prime * result + ((getRemarks() == null) ? 0 : getRemarks().hashCode()); |
||||
result = prime * result + ((getSendExpressNo() == null) ? 0 : getSendExpressNo().hashCode()); |
||||
result = prime * result + ((getRefundOrderNo() == null) ? 0 : getRefundOrderNo().hashCode()); |
||||
result = prime * result + ((getRefundPrice() == null) ? 0 : getRefundPrice().hashCode()); |
||||
result = prime * result + ((getRefundIntegral() == null) ? 0 : getRefundIntegral().hashCode()); |
||||
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); |
||||
result = prime * result + ((getAuditRemarks() == null) ? 0 : getAuditRemarks().hashCode()); |
||||
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); |
||||
result = prime * result + ((getAuditTime() == null) ? 0 : getAuditTime().hashCode()); |
||||
result = prime * result + ((getSendExpressTime() == null) ? 0 : getSendExpressTime().hashCode()); |
||||
result = prime * result + ((getFinishTime() == null) ? 0 : getFinishTime().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(", userId=").append(userId); |
||||
sb.append(", userPhone=").append(userPhone); |
||||
sb.append(", merId=").append(merId); |
||||
sb.append(", applyNo=").append(applyNo); |
||||
sb.append(", type=").append(type); |
||||
sb.append(", orderNo=").append(orderNo); |
||||
sb.append(", childOrderNo=").append(childOrderNo); |
||||
sb.append(", productType=").append(productType); |
||||
sb.append(", productId=").append(productId); |
||||
sb.append(", productName=").append(productName); |
||||
sb.append(", productImg=").append(productImg); |
||||
sb.append(", productSpecId=").append(productSpecId); |
||||
sb.append(", productSpecName=").append(productSpecName); |
||||
sb.append(", productCount=").append(productCount); |
||||
sb.append(", photo=").append(photo); |
||||
sb.append(", remarks=").append(remarks); |
||||
sb.append(", sendExpressNo=").append(sendExpressNo); |
||||
sb.append(", refundOrderNo=").append(refundOrderNo); |
||||
sb.append(", refundPrice=").append(refundPrice); |
||||
sb.append(", refundIntegral=").append(refundIntegral); |
||||
sb.append(", status=").append(status); |
||||
sb.append(", auditRemarks=").append(auditRemarks); |
||||
sb.append(", createTime=").append(createTime); |
||||
sb.append(", auditTime=").append(auditTime); |
||||
sb.append(", sendExpressTime=").append(sendExpressTime); |
||||
sb.append(", finishTime=").append(finishTime); |
||||
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
@ -0,0 +1,232 @@ |
||||
package com.hfkj.entity; |
||||
|
||||
import java.io.Serializable; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* bs_order_after_sales_op_record |
||||
* @author |
||||
*/ |
||||
/** |
||||
* |
||||
* 代码由工具生成 |
||||
* |
||||
**/ |
||||
public class BsOrderAfterSalesOpRecord implements Serializable { |
||||
/** |
||||
* 主键ID |
||||
*/ |
||||
private Long id; |
||||
|
||||
/** |
||||
* 申请单号 |
||||
*/ |
||||
private String applyNo; |
||||
|
||||
/** |
||||
* 状态 1:审核中 2:审核驳回 3:待邮寄 4:邮寄中 5:完成 |
||||
*/ |
||||
private Integer status; |
||||
|
||||
/** |
||||
* 照片 |
||||
*/ |
||||
private String photo; |
||||
|
||||
/** |
||||
* 备注 |
||||
*/ |
||||
private String remarks; |
||||
|
||||
/** |
||||
* 操作人类型 1:系统人员 2:用户 |
||||
*/ |
||||
private Integer opUserType; |
||||
|
||||
/** |
||||
* 操作人id |
||||
*/ |
||||
private Long opUserId; |
||||
|
||||
/** |
||||
* 操作人名称 |
||||
*/ |
||||
private String opUserName; |
||||
|
||||
/** |
||||
* 创建时间 |
||||
*/ |
||||
private Date createTime; |
||||
|
||||
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 getApplyNo() { |
||||
return applyNo; |
||||
} |
||||
|
||||
public void setApplyNo(String applyNo) { |
||||
this.applyNo = applyNo; |
||||
} |
||||
|
||||
public Integer getStatus() { |
||||
return status; |
||||
} |
||||
|
||||
public void setStatus(Integer status) { |
||||
this.status = status; |
||||
} |
||||
|
||||
public String getPhoto() { |
||||
return photo; |
||||
} |
||||
|
||||
public void setPhoto(String photo) { |
||||
this.photo = photo; |
||||
} |
||||
|
||||
public String getRemarks() { |
||||
return remarks; |
||||
} |
||||
|
||||
public void setRemarks(String remarks) { |
||||
this.remarks = remarks; |
||||
} |
||||
|
||||
public Integer getOpUserType() { |
||||
return opUserType; |
||||
} |
||||
|
||||
public void setOpUserType(Integer opUserType) { |
||||
this.opUserType = opUserType; |
||||
} |
||||
|
||||
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 Date getCreateTime() { |
||||
return createTime; |
||||
} |
||||
|
||||
public void setCreateTime(Date createTime) { |
||||
this.createTime = createTime; |
||||
} |
||||
|
||||
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; |
||||
} |
||||
BsOrderAfterSalesOpRecord other = (BsOrderAfterSalesOpRecord) that; |
||||
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) |
||||
&& (this.getApplyNo() == null ? other.getApplyNo() == null : this.getApplyNo().equals(other.getApplyNo())) |
||||
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) |
||||
&& (this.getPhoto() == null ? other.getPhoto() == null : this.getPhoto().equals(other.getPhoto())) |
||||
&& (this.getRemarks() == null ? other.getRemarks() == null : this.getRemarks().equals(other.getRemarks())) |
||||
&& (this.getOpUserType() == null ? other.getOpUserType() == null : this.getOpUserType().equals(other.getOpUserType())) |
||||
&& (this.getOpUserId() == null ? other.getOpUserId() == null : this.getOpUserId().equals(other.getOpUserId())) |
||||
&& (this.getOpUserName() == null ? other.getOpUserName() == null : this.getOpUserName().equals(other.getOpUserName())) |
||||
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) |
||||
&& (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 + ((getApplyNo() == null) ? 0 : getApplyNo().hashCode()); |
||||
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); |
||||
result = prime * result + ((getPhoto() == null) ? 0 : getPhoto().hashCode()); |
||||
result = prime * result + ((getRemarks() == null) ? 0 : getRemarks().hashCode()); |
||||
result = prime * result + ((getOpUserType() == null) ? 0 : getOpUserType().hashCode()); |
||||
result = prime * result + ((getOpUserId() == null) ? 0 : getOpUserId().hashCode()); |
||||
result = prime * result + ((getOpUserName() == null) ? 0 : getOpUserName().hashCode()); |
||||
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().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(", applyNo=").append(applyNo); |
||||
sb.append(", status=").append(status); |
||||
sb.append(", photo=").append(photo); |
||||
sb.append(", remarks=").append(remarks); |
||||
sb.append(", opUserType=").append(opUserType); |
||||
sb.append(", opUserId=").append(opUserId); |
||||
sb.append(", opUserName=").append(opUserName); |
||||
sb.append(", createTime=").append(createTime); |
||||
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
@ -0,0 +1,76 @@ |
||||
package com.hfkj.service.order; |
||||
|
||||
import com.hfkj.entity.BsOrderAfterSalesApply; |
||||
import com.hfkj.sysenum.order.OrderAfterSalesApplyTypeEnum; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* 订单售后申请 |
||||
* @className: BsOrderAfterSalesApplyService |
||||
* @author: HuRui |
||||
* @date: 2024/5/15 |
||||
**/ |
||||
public interface BsOrderAfterSalesApplyService { |
||||
|
||||
/** |
||||
* 编辑数据 |
||||
* @param data 数据 |
||||
*/ |
||||
void editData(BsOrderAfterSalesApply data); |
||||
|
||||
/** |
||||
* 创建售后申请 |
||||
* @param applyType 申请类型 |
||||
* @param childOrderNo 子订单号 |
||||
* @param productCount 产品数量 |
||||
* @param photo 图片 |
||||
* @param remarks 备注 |
||||
*/ |
||||
void createApply(OrderAfterSalesApplyTypeEnum applyType, String childOrderNo, Integer productCount, String photo, String remarks); |
||||
|
||||
/** |
||||
* 审核 |
||||
* @param applyNo 申请单号 |
||||
* @param applyStatus 审核状态 true:通过 false:驳回 |
||||
* @param remarks 备注 |
||||
* @param opUserId 操作人 |
||||
*/ |
||||
void audit(String applyNo, Boolean applyStatus, String remarks, Long opUserId); |
||||
|
||||
/** |
||||
* 邮寄 |
||||
* @param applyNo 申请单号 |
||||
* @param sendExpressNo 快递单号 |
||||
*/ |
||||
void sendExpress(String applyNo, String sendExpressNo); |
||||
|
||||
/** |
||||
* 完成 |
||||
* @param applyNo 申请单号 |
||||
*/ |
||||
void finish(String applyNo, Long opUserId); |
||||
|
||||
/** |
||||
* 查询详情 |
||||
* @param applyNo |
||||
* @return |
||||
*/ |
||||
BsOrderAfterSalesApply getDetailByApplyNo(String applyNo); |
||||
/** |
||||
* 查询详情 |
||||
* @param childOrderNo |
||||
* @return |
||||
*/ |
||||
BsOrderAfterSalesApply getDetailByChildOrderNo(String childOrderNo); |
||||
|
||||
/** |
||||
* 查询列表 |
||||
* @param param |
||||
* @return |
||||
*/ |
||||
List<BsOrderAfterSalesApply> getApplyList(Map<String,Object> param); |
||||
|
||||
|
||||
} |
@ -0,0 +1,27 @@ |
||||
package com.hfkj.service.order; |
||||
|
||||
import com.hfkj.entity.BsOrderAfterSalesOpRecord; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @className: BsOrderAfterSalesOpRecordService |
||||
* @author: HuRui |
||||
* @date: 2024/5/15 |
||||
**/ |
||||
public interface BsOrderAfterSalesOpRecordService { |
||||
|
||||
/** |
||||
* 创建记录 |
||||
* @param data |
||||
*/ |
||||
void create(BsOrderAfterSalesOpRecord data); |
||||
|
||||
/** |
||||
* 查询操作列表 |
||||
* @param applyNo |
||||
* @return |
||||
*/ |
||||
List<BsOrderAfterSalesOpRecord> getRecordList(String applyNo); |
||||
|
||||
} |
@ -0,0 +1,49 @@ |
||||
package com.hfkj.service.order; |
||||
|
||||
import com.hfkj.entity.BsOrderRefund; |
||||
import com.hfkj.model.order.OrderModel; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @className: BsOrderRefundService |
||||
* @author: HuRui |
||||
* @date: 2024/5/14 |
||||
**/ |
||||
public interface BsOrderRefundService { |
||||
|
||||
/** |
||||
* 编辑数据 |
||||
* @param data |
||||
*/ |
||||
void editData(BsOrderRefund data); |
||||
|
||||
/** |
||||
* 退款金额 |
||||
* @return |
||||
*/ |
||||
boolean refundMoney(BsOrderRefund orderRefund); |
||||
|
||||
/** |
||||
* 交易订单退款 |
||||
* @param orderNo |
||||
* @return |
||||
*/ |
||||
OrderModel tradeOrderRefund(String orderNo, String remark); |
||||
|
||||
/** |
||||
* 交易子订单退款 |
||||
* @param childOrderNo 子订单号 |
||||
* @param productCount 退款产品数量 |
||||
* @return |
||||
*/ |
||||
BsOrderRefund tradeOrderChildRefund(String childOrderNo, Integer productCount, String remark); |
||||
|
||||
/** |
||||
* 查询退款列表 |
||||
* @param param |
||||
* @return |
||||
*/ |
||||
List<BsOrderRefund> getRefundList(Map<String,Object> param); |
||||
} |
@ -0,0 +1,292 @@ |
||||
package com.hfkj.service.order.impl; |
||||
|
||||
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.RandomUtils; |
||||
import com.hfkj.dao.BsOrderAfterSalesApplyMapper; |
||||
import com.hfkj.entity.*; |
||||
import com.hfkj.model.UserSessionObject; |
||||
import com.hfkj.model.order.OrderChildModel; |
||||
import com.hfkj.service.SecUserService; |
||||
import com.hfkj.service.order.*; |
||||
import com.hfkj.sysenum.order.OrderAfterSalesApplyStatusEnum; |
||||
import com.hfkj.sysenum.order.OrderAfterSalesApplyTypeEnum; |
||||
import com.hfkj.sysenum.order.OrderChildStatusEnum; |
||||
import com.hfkj.sysenum.order.OrderRefundStatusEnum; |
||||
import org.apache.commons.collections4.MapUtils; |
||||
import org.apache.commons.lang3.StringUtils; |
||||
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: BsOrderAfterSalesApplyServiceImpl |
||||
* @author: HuRui |
||||
* @date: 2024/5/15 |
||||
**/ |
||||
@Service("orderAfterSalesApplyService") |
||||
public class BsOrderAfterSalesApplyServiceImpl implements BsOrderAfterSalesApplyService { |
||||
@Resource |
||||
private BsOrderAfterSalesApplyMapper orderAfterSalesApplyMapper; |
||||
@Resource |
||||
private BsOrderAfterSalesOpRecordService orderAfterSalesOpRecordService; |
||||
@Resource |
||||
private BsOrderChildService orderChildService; |
||||
@Resource |
||||
private BsOrderService orderService; |
||||
@Resource |
||||
private BsOrderRefundService orderRefundService; |
||||
@Resource |
||||
private SecUserService secUserService; |
||||
@Override |
||||
public void editData(BsOrderAfterSalesApply data) { |
||||
data.setUpdateTime(new Date()); |
||||
if (data.getId() == null) { |
||||
data.setCreateTime(new Date()); |
||||
orderAfterSalesApplyMapper.insert(data); |
||||
} else { |
||||
orderAfterSalesApplyMapper.updateByPrimaryKey(data); |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
@Transactional(propagation= Propagation.REQUIRES_NEW,rollbackFor= {RuntimeException.class}) |
||||
public void createApply(OrderAfterSalesApplyTypeEnum applyType, String childOrderNo, Integer productCount, String photo, String remarks) { |
||||
// 查询子订单
|
||||
OrderChildModel orderChild = orderChildService.getDetail(childOrderNo); |
||||
if (orderChild == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
||||
} |
||||
if (!orderChild.getStatus().equals(OrderChildStatusEnum.status2.getCode()) |
||||
&& !orderChild.getStatus().equals(OrderChildStatusEnum.status3.getCode()) ) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "订单状态错误,无法提交"); |
||||
} |
||||
// 查询订单
|
||||
BsOrder order = orderService.getOrder(orderChild.getOrderNo()); |
||||
if (order == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的订单"); |
||||
} |
||||
// 查询子订单申请记录
|
||||
BsOrderAfterSalesApply record = getDetailByChildOrderNo(childOrderNo); |
||||
if (record != null |
||||
&& (!record.getStatus().equals(OrderAfterSalesApplyStatusEnum.type5.getCode()) && !record.getStatus().equals(OrderAfterSalesApplyStatusEnum.type2.getCode()))) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "此订单已提交售后,请勿重复提交"); |
||||
} |
||||
BsOrderAfterSalesApply apply = new BsOrderAfterSalesApply(); |
||||
apply.setType(applyType.getCode()); |
||||
apply.setUserId(order.getUserId()); |
||||
apply.setUserPhone(order.getUserPhone()); |
||||
apply.setMerId(orderChild.getMerId()); |
||||
// 子订单编号 + 5位随机数
|
||||
apply.setApplyNo(orderChild.getChildOrderNo() + RandomUtils.number(5,false)); |
||||
apply.setOrderNo(orderChild.getOrderNo()); |
||||
apply.setChildOrderNo(orderChild.getChildOrderNo()); |
||||
apply.setProductType(orderChild.getProductType()); |
||||
apply.setProductId(orderChild.getProductId()); |
||||
apply.setProductName(orderChild.getProductName()); |
||||
apply.setProductImg(orderChild.getProductImg()); |
||||
apply.setProductSpecId(orderChild.getProductSpecId()); |
||||
apply.setProductSpecName(orderChild.getProductSpecName()); |
||||
apply.setProductCount(productCount); |
||||
apply.setPhoto(photo); |
||||
apply.setRemarks(remarks); |
||||
apply.setStatus(OrderAfterSalesApplyStatusEnum.type1.getCode()); |
||||
editData(apply); |
||||
|
||||
// 操作记录
|
||||
BsOrderAfterSalesOpRecord opRecord = new BsOrderAfterSalesOpRecord(); |
||||
opRecord.setApplyNo(apply.getApplyNo()); |
||||
opRecord.setStatus(OrderAfterSalesApplyStatusEnum.type1.getCode()); |
||||
opRecord.setPhoto(photo); |
||||
opRecord.setRemarks(remarks); |
||||
opRecord.setOpUserType(2); |
||||
opRecord.setOpUserId(apply.getUserId()); |
||||
opRecord.setOpUserName(apply.getUserPhone()); |
||||
orderAfterSalesOpRecordService.create(opRecord); |
||||
} |
||||
|
||||
@Override |
||||
public void audit(String applyNo, Boolean applyStatus, String remarks, Long opUserId) { |
||||
// 查询申请
|
||||
BsOrderAfterSalesApply apply = getDetailByApplyNo(applyNo); |
||||
if (apply == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的申请"); |
||||
} |
||||
if (OrderAfterSalesApplyStatusEnum.type1.getCode() != apply.getStatus()) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "审核失败!当前申请不处于审核状态"); |
||||
} |
||||
SecUser secUser = secUserService.getDetail(opUserId); |
||||
if (secUser == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的操作人"); |
||||
} |
||||
|
||||
apply.setAuditTime(new Date()); |
||||
apply.setAuditRemarks(remarks); |
||||
|
||||
if (applyStatus.equals(true)) { |
||||
if (OrderAfterSalesApplyTypeEnum.type1.getCode() == apply.getType()) { |
||||
// 退款
|
||||
BsOrderRefund orderRefund = orderRefundService.tradeOrderChildRefund(apply.getChildOrderNo(), apply.getProductCount(), null); |
||||
if (orderRefund.getRefundStatus().equals(OrderRefundStatusEnum.status2.getCode())) { |
||||
apply.setRefundOrderNo(orderRefund.getRefundOrderNo()); |
||||
apply.setRefundPrice(orderRefund.getRefundPrice()); |
||||
apply.setRefundIntegral(orderRefund.getRefundIntegral()); |
||||
apply.setStatus(OrderAfterSalesApplyStatusEnum.type5.getCode()); |
||||
apply.setFinishTime(new Date()); |
||||
} else { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "退款失败!" + orderRefund.getRefundFailReason()); |
||||
} |
||||
} else if (OrderAfterSalesApplyTypeEnum.type2.getCode() == apply.getType()) { |
||||
apply.setStatus(OrderAfterSalesApplyStatusEnum.type3.getCode()); |
||||
|
||||
} else { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知申请类型"); |
||||
} |
||||
|
||||
} else { |
||||
apply.setStatus(OrderAfterSalesApplyStatusEnum.type2.getCode()); |
||||
} |
||||
|
||||
// 操作记录
|
||||
BsOrderAfterSalesOpRecord opRecord = new BsOrderAfterSalesOpRecord(); |
||||
opRecord.setApplyNo(apply.getApplyNo()); |
||||
opRecord.setStatus(apply.getStatus()); |
||||
opRecord.setRemarks(remarks); |
||||
opRecord.setOpUserType(1); |
||||
opRecord.setOpUserId(secUser.getId()); |
||||
opRecord.setOpUserName(secUser.getUserName()); |
||||
orderAfterSalesOpRecordService.create(opRecord); |
||||
|
||||
editData(apply); |
||||
} |
||||
|
||||
@Override |
||||
@Transactional(propagation= Propagation.REQUIRES_NEW,rollbackFor= {RuntimeException.class}) |
||||
public void sendExpress(String applyNo, String sendExpressNo) { |
||||
// 查询申请
|
||||
BsOrderAfterSalesApply apply = getDetailByApplyNo(applyNo); |
||||
if (apply == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的申请"); |
||||
} |
||||
if (OrderAfterSalesApplyStatusEnum.type3.getCode() != apply.getStatus()) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "审核失败!当前申请不处于待邮寄中"); |
||||
} |
||||
apply.setStatus(OrderAfterSalesApplyStatusEnum.type4.getCode()); |
||||
apply.setSendExpressNo(sendExpressNo); |
||||
apply.setSendExpressTime(new Date()); |
||||
editData(apply); |
||||
|
||||
// 操作记录
|
||||
BsOrderAfterSalesOpRecord opRecord = new BsOrderAfterSalesOpRecord(); |
||||
opRecord.setApplyNo(apply.getApplyNo()); |
||||
opRecord.setStatus(apply.getStatus()); |
||||
opRecord.setRemarks(sendExpressNo); |
||||
opRecord.setOpUserType(1); |
||||
opRecord.setOpUserId(apply.getId()); |
||||
opRecord.setOpUserName(apply.getUserPhone()); |
||||
orderAfterSalesOpRecordService.create(opRecord); |
||||
} |
||||
|
||||
@Override |
||||
public void finish(String applyNo, Long opUserId) { |
||||
// 查询申请
|
||||
BsOrderAfterSalesApply apply = getDetailByApplyNo(applyNo); |
||||
if (apply == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的申请"); |
||||
} |
||||
|
||||
// 退款
|
||||
BsOrderRefund orderRefund = orderRefundService.tradeOrderChildRefund(apply.getChildOrderNo(), apply.getProductCount(), null); |
||||
if (orderRefund.getRefundStatus().equals(OrderRefundStatusEnum.status2.getCode())) { |
||||
// 查询操作用户
|
||||
SecUser secUser = secUserService.getDetail(opUserId); |
||||
if (secUser == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的操作人"); |
||||
} |
||||
apply.setStatus(OrderAfterSalesApplyStatusEnum.type5.getCode()); |
||||
apply.setFinishTime(new Date()); |
||||
editData(apply); |
||||
|
||||
// 操作记录
|
||||
BsOrderAfterSalesOpRecord opRecord = new BsOrderAfterSalesOpRecord(); |
||||
opRecord.setApplyNo(apply.getApplyNo()); |
||||
opRecord.setStatus(apply.getStatus()); |
||||
opRecord.setOpUserType(1); |
||||
opRecord.setOpUserId(secUser.getId()); |
||||
opRecord.setOpUserName(secUser.getUserName()); |
||||
orderAfterSalesOpRecordService.create(opRecord); |
||||
} else { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "退款失败!" + orderRefund.getRefundFailReason()); |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public BsOrderAfterSalesApply getDetailByApplyNo(String applyNo) { |
||||
BsOrderAfterSalesApplyExample example = new BsOrderAfterSalesApplyExample(); |
||||
example.createCriteria().andApplyNoEqualTo(applyNo); |
||||
List<BsOrderAfterSalesApply> list = orderAfterSalesApplyMapper.selectByExample(example); |
||||
if (!list.isEmpty()) { |
||||
return list.get(0); |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
public BsOrderAfterSalesApply getDetailByChildOrderNo(String childOrderNo) { |
||||
BsOrderAfterSalesApplyExample example = new BsOrderAfterSalesApplyExample(); |
||||
example.createCriteria().andChildOrderNoEqualTo(childOrderNo); |
||||
List<BsOrderAfterSalesApply> list = orderAfterSalesApplyMapper.selectByExample(example); |
||||
if (!list.isEmpty()) { |
||||
return list.get(0); |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
public List<BsOrderAfterSalesApply> getApplyList(Map<String, Object> param) { |
||||
BsOrderAfterSalesApplyExample example = new BsOrderAfterSalesApplyExample(); |
||||
BsOrderAfterSalesApplyExample.Criteria criteria = example.createCriteria(); |
||||
|
||||
if (MapUtils.getLong(param, "userId") != null) { |
||||
criteria.andUserIdEqualTo(MapUtils.getLong(param, "userId")); |
||||
} |
||||
|
||||
if (MapUtils.getInteger(param, "type") != null) { |
||||
criteria.andTypeEqualTo(MapUtils.getInteger(param, "type")); |
||||
} |
||||
|
||||
if (StringUtils.isNotBlank(MapUtils.getString(param, "userPhone"))) { |
||||
criteria.andUserPhoneLike("%"+MapUtils.getString(param, "userPhone")+"%"); |
||||
} |
||||
|
||||
if (StringUtils.isNotBlank(MapUtils.getString(param, "childOrderNo"))) { |
||||
criteria.andChildOrderNoLike("%"+MapUtils.getString(param, "childOrderNo")+"%"); |
||||
} |
||||
|
||||
if (StringUtils.isNotBlank(MapUtils.getString(param, "applyNo"))) { |
||||
criteria.andApplyNoLike("%"+MapUtils.getString(param, "applyNo")+"%"); |
||||
} |
||||
|
||||
if (MapUtils.getInteger(param, "status") != null) { |
||||
criteria.andStatusEqualTo(MapUtils.getInteger(param, "status")); |
||||
} |
||||
|
||||
if (MapUtils.getLong(param, "createTimeS") != null) { |
||||
criteria.andCreateTimeGreaterThanOrEqualTo(new Date(MapUtils.getLong(param, "createTimeS"))); |
||||
} |
||||
|
||||
if (MapUtils.getLong(param, "createTimeE") != null) { |
||||
criteria.andCreateTimeLessThanOrEqualTo(new Date(MapUtils.getLong(param, "createTimeE"))); |
||||
} |
||||
|
||||
example.setOrderByClause("create_time desc"); |
||||
return orderAfterSalesApplyMapper.selectByExample(example); |
||||
} |
||||
} |
@ -0,0 +1,38 @@ |
||||
package com.hfkj.service.order.impl; |
||||
|
||||
import com.hfkj.dao.BsOrderAfterSalesOpRecordMapper; |
||||
import com.hfkj.entity.BsOrderAfterSalesOpRecord; |
||||
import com.hfkj.entity.BsOrderAfterSalesOpRecordExample; |
||||
import com.hfkj.service.order.BsOrderAfterSalesOpRecordService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @className: BsOrderAfterSalesOpRecordServiceImpl |
||||
* @author: HuRui |
||||
* @date: 2024/5/15 |
||||
**/ |
||||
@Service("orderAfterSalesOpRecordService") |
||||
public class BsOrderAfterSalesOpRecordServiceImpl implements BsOrderAfterSalesOpRecordService { |
||||
@Resource |
||||
private BsOrderAfterSalesOpRecordMapper orderAfterSalesOpRecordMapper; |
||||
|
||||
@Override |
||||
public void create(BsOrderAfterSalesOpRecord data) { |
||||
data.setCreateTime(new Date()); |
||||
orderAfterSalesOpRecordMapper.insert(data); |
||||
} |
||||
|
||||
@Override |
||||
public List<BsOrderAfterSalesOpRecord> getRecordList(String applyNo) { |
||||
BsOrderAfterSalesOpRecordExample example = new BsOrderAfterSalesOpRecordExample(); |
||||
example.createCriteria().andApplyNoEqualTo(applyNo); |
||||
example.setOrderByClause("create_time desc"); |
||||
return orderAfterSalesOpRecordMapper.selectByExample(example); |
||||
} |
||||
|
||||
|
||||
} |
@ -0,0 +1,210 @@ |
||||
package com.hfkj.service.order.impl; |
||||
|
||||
import com.alibaba.fastjson.JSONObject; |
||||
import com.hfkj.common.exception.BaseException; |
||||
import com.hfkj.common.exception.ErrorCode; |
||||
import com.hfkj.common.exception.ErrorHelp; |
||||
import com.hfkj.common.exception.SysCode; |
||||
import com.hfkj.common.utils.DateUtil; |
||||
import com.hfkj.common.utils.RandomUtils; |
||||
import com.hfkj.dao.BsOrderRefundMapper; |
||||
import com.hfkj.entity.BsOrder; |
||||
import com.hfkj.entity.BsOrderRefund; |
||||
import com.hfkj.entity.BsOrderRefundExample; |
||||
import com.hfkj.model.order.OrderChildModel; |
||||
import com.hfkj.model.order.OrderModel; |
||||
import com.hfkj.service.order.BsOrderChildService; |
||||
import com.hfkj.service.order.BsOrderRefundService; |
||||
import com.hfkj.service.order.BsOrderService; |
||||
import com.hfkj.service.pay.HuiPayService; |
||||
import com.hfkj.sysenum.order.*; |
||||
import org.apache.commons.collections4.MapUtils; |
||||
import org.apache.commons.lang3.StringUtils; |
||||
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.math.BigDecimal; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @className: BsOrderRefundServiceImpl |
||||
* @author: HuRui |
||||
* @date: 2024/5/14 |
||||
**/ |
||||
@Service("orderRefundService") |
||||
public class BsOrderRefundServiceImpl implements BsOrderRefundService { |
||||
|
||||
@Resource |
||||
public BsOrderRefundMapper orderRefundMapper; |
||||
@Resource |
||||
private BsOrderService orderService; |
||||
@Resource |
||||
private BsOrderChildService orderChildService; |
||||
@Override |
||||
public void editData(BsOrderRefund data) { |
||||
data.setUpdateTime(new Date()); |
||||
if (data.getId() == null) { |
||||
data.setCreateTime(new Date()); |
||||
orderRefundMapper.insert(data); |
||||
} else { |
||||
orderRefundMapper.updateByPrimaryKey(data); |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public boolean refundMoney(BsOrderRefund orderRefund) { |
||||
try { |
||||
if (OrderPayChannelEnum.type1.getCode() == orderRefund.getRefundPayChannel()) { |
||||
// 渠道退款
|
||||
JSONObject refund = HuiPayService.refund(orderRefund.getAccountMerchantNo(), orderRefund.getOrderNo(), orderRefund.getRefundOrderNo(), orderRefund.getRefundPrice()); |
||||
if (refund.getString("").equals("000000")) { |
||||
JSONObject data = refund.getJSONObject("return_data"); |
||||
orderRefund.setRefundPayChannelOrderNo(data.getString("refundTradeNo")); |
||||
orderRefund.setRefundSerialNo(data.getString("accTradeNo")); |
||||
orderRefund.setRefundStatus(OrderRefundStatusEnum.status2.getCode()); |
||||
editData(orderRefund); |
||||
return true; |
||||
} else { |
||||
orderRefund.setRefundStatus(OrderRefundStatusEnum.status3.getCode()); |
||||
orderRefund.setRefundFailReason(refund.getString("return_msg")); |
||||
editData(orderRefund); |
||||
} |
||||
|
||||
}/* else if (OrderPayChannelEnum.type2.getCode() == orderRefund.getRefundPayChannel()) { |
||||
// TODO 暂无该支付方式
|
||||
|
||||
} else if (OrderPayChannelEnum.type3.getCode() ==orderRefund.getRefundPayChannel()) { |
||||
// TODO 暂无该支付方式
|
||||
}*/ else { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "退款失败!未知的支付方式"); |
||||
} |
||||
} catch (BaseException e) { |
||||
orderRefund.setRefundStatus(OrderRefundStatusEnum.status3.getCode()); |
||||
orderRefund.setRefundFailReason(e.getErrorMsg()); |
||||
editData(orderRefund); |
||||
|
||||
} catch (Exception e) { |
||||
orderRefund.setRefundStatus(OrderRefundStatusEnum.status3.getCode()); |
||||
orderRefund.setRefundFailReason("未知问题"); |
||||
editData(orderRefund); |
||||
} |
||||
return false; |
||||
} |
||||
|
||||
@Override |
||||
@Transactional(propagation= Propagation.REQUIRES_NEW,rollbackFor= {RuntimeException.class}) |
||||
public OrderModel tradeOrderRefund(String orderNo, String remark) { |
||||
// 查询交易订单
|
||||
OrderModel order = orderService.getDetail(orderNo); |
||||
if (order == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "该账户已被禁用,无法进行交易"); |
||||
} |
||||
if (!order.getOrderStatus().equals(OrderStatusEnum.status2.getCode())) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "该账户已被禁用,无法进行交易"); |
||||
} |
||||
|
||||
boolean refundSuccess = true; |
||||
for (OrderChildModel orderChild : order.getOrderChildList()) { |
||||
try { |
||||
tradeOrderChildRefund(orderChild.getChildOrderNo(), orderChild.getProductCount(), remark); |
||||
} catch (Exception e) { |
||||
refundSuccess = false; |
||||
} |
||||
} |
||||
order.setOrderStatus(refundSuccess ? OrderStatusEnum.status4.getCode() : order.getOrderStatus()); |
||||
order.setRefundTime(refundSuccess ? new Date() : null); |
||||
orderService.editData(order); |
||||
// 更新缓存
|
||||
orderService.cache(order); |
||||
return order; |
||||
} |
||||
|
||||
@Override |
||||
public BsOrderRefund tradeOrderChildRefund(String childOrderNo, Integer productCount, String remark) { |
||||
// 查询子订单
|
||||
OrderChildModel orderChild = orderChildService.getDetail(childOrderNo); |
||||
if (orderChild == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的子订单"); |
||||
} |
||||
if (productCount > orderChild.getProductCount()) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "退款失败!退货数量超过子订单可退数量"); |
||||
} |
||||
// 查询交易订单
|
||||
BsOrder order = orderService.getOrder(orderChild.getOrderNo()); |
||||
if (order == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的交易订单"); |
||||
} |
||||
// 创建退款订单
|
||||
BsOrderRefund orderRefund = new BsOrderRefund(); |
||||
orderRefund.setMerId(orderChild.getMerId()); |
||||
orderRefund.setOrderNo(orderChild.getOrderNo()); |
||||
orderRefund.setOrderChildNo(orderChild.getChildOrderNo()); |
||||
orderRefund.setUserId(order.getUserId()); |
||||
orderRefund.setUserPhone(order.getUserPhone()); |
||||
// 退款订单号 退款标识:R + 时间 + 随机3位数字
|
||||
orderRefund.setRefundOrderNo("R"+DateUtil.date2String(new Date(), "yyMMddHHmmss") + RandomUtils.number(3, false)); |
||||
orderRefund.setRefundPayChannel(order.getPayChannel()); |
||||
orderRefund.setReufndPayType(order.getPayType()); |
||||
|
||||
if (orderChild.getSurplusRefundCount().equals(productCount)) { |
||||
// 全部退款
|
||||
orderRefund.setRefundPrice(orderChild.getSurplusRefundPrice()); |
||||
orderRefund.setRefundIntegral(orderChild.getSurplusRefundIntegral()); |
||||
} else { |
||||
// 部分退款
|
||||
// 计算单价
|
||||
BigDecimal unitPrice = orderChild.getSurplusRefundPrice().divide(new BigDecimal(productCount.toString()), 2, BigDecimal.ROUND_DOWN).setScale(2); |
||||
BigDecimal unitPriceIntegral = new BigDecimal(orderChild.getSurplusRefundIntegral().toString()).divide(new BigDecimal("100")) |
||||
.divide(new BigDecimal(productCount.toString()), 2, BigDecimal.ROUND_DOWN).setScale(2); |
||||
|
||||
orderRefund.setRefundPrice(unitPrice.multiply(new BigDecimal(productCount.toString()))); |
||||
orderRefund.setRefundIntegral(unitPriceIntegral.multiply(new BigDecimal("100")).longValue()); |
||||
} |
||||
orderRefund.setRefundRemark(remark); |
||||
orderRefund.setRefundStatus(OrderRefundStatusEnum.status1.getCode()); |
||||
editData(orderRefund); |
||||
|
||||
// 资金退款
|
||||
orderRefund.setRefundStatus(refundMoney(orderRefund)?OrderRefundStatusEnum.status2.getCode():OrderRefundStatusEnum.status3.getCode()); |
||||
editData(orderRefund); |
||||
|
||||
// 退款成功
|
||||
if (orderRefund.getRefundStatus().equals(OrderRefundStatusEnum.status2.getCode())) { |
||||
// 修改子订单可退数量、金额、积分
|
||||
orderChild.setSurplusRefundCount(orderChild.getSurplusRefundCount() - productCount); |
||||
orderChild.setSurplusRefundPrice(orderChild.getSurplusRefundPrice().subtract(orderRefund.getRefundPrice())); |
||||
orderChild.setSurplusRefundIntegral(orderChild.getSurplusRefundIntegral() - orderRefund.getRefundIntegral()); |
||||
orderChild.setStatus(orderChild.getProductCount()==0?OrderChildStatusEnum.status4.getCode():orderChild.getStatus()); |
||||
orderChildService.editData(orderChild); |
||||
} |
||||
return orderRefund; |
||||
|
||||
} |
||||
|
||||
@Override |
||||
public List<BsOrderRefund> getRefundList(Map<String, Object> param) { |
||||
BsOrderRefundExample example = new BsOrderRefundExample(); |
||||
BsOrderRefundExample.Criteria criteria = example.createCriteria(); |
||||
|
||||
if (StringUtils.isNotBlank(MapUtils.getString(param, "orderNo"))) { |
||||
criteria.andOrderNoEqualTo(MapUtils.getString(param, "orderNo")); |
||||
} |
||||
|
||||
if (StringUtils.isNotBlank(MapUtils.getString(param, "orderChildNo"))) { |
||||
criteria.andOrderNoEqualTo(MapUtils.getString(param, "orderChildNo")); |
||||
} |
||||
|
||||
if (StringUtils.isNotBlank(MapUtils.getString(param, "refundOrderNo"))) { |
||||
criteria.andOrderNoEqualTo(MapUtils.getString(param, "refundOrderNo")); |
||||
} |
||||
|
||||
example.setOrderByClause("create_time desc"); |
||||
return orderRefundMapper.selectByExample(example); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,44 @@ |
||||
package com.hfkj.sysenum.order; |
||||
|
||||
import lombok.Getter; |
||||
|
||||
/** |
||||
* 售后状态 |
||||
* @className: OrderAfterSalesApplyStatusEnum |
||||
* @author: HuRui |
||||
* @date: 2024/4/15 |
||||
**/ |
||||
@Getter |
||||
public enum OrderAfterSalesApplyStatusEnum { |
||||
|
||||
/** |
||||
* 审核中 |
||||
*/ |
||||
type1(1, "审核中"), |
||||
/** |
||||
* 审核驳回 |
||||
*/ |
||||
type2(2, "审核驳回"), |
||||
/** |
||||
* 待邮寄 |
||||
*/ |
||||
type3(3, "待邮寄"), |
||||
/** |
||||
* 邮寄中 |
||||
*/ |
||||
type4(4, "邮寄中"), |
||||
/** |
||||
* 完成 |
||||
*/ |
||||
type5(5, "完成"), |
||||
; |
||||
|
||||
private int code; |
||||
|
||||
private String name; |
||||
|
||||
OrderAfterSalesApplyStatusEnum(int code, String name) { |
||||
this.code = code; |
||||
this.name = name; |
||||
} |
||||
} |
@ -0,0 +1,42 @@ |
||||
package com.hfkj.sysenum.order; |
||||
|
||||
import lombok.Getter; |
||||
|
||||
import java.util.Objects; |
||||
|
||||
/** |
||||
* 售后类型 |
||||
* @className: OrderAfterSalesApplyTypeEnum |
||||
* @author: HuRui |
||||
* @date: 2024/4/15 |
||||
**/ |
||||
@Getter |
||||
public enum OrderAfterSalesApplyTypeEnum { |
||||
|
||||
/** |
||||
* 退款申请 |
||||
*/ |
||||
type1(1, "退款申请"), |
||||
/** |
||||
* 退货申请 |
||||
*/ |
||||
type2(2, "退货申请"), |
||||
; |
||||
|
||||
private int code; |
||||
|
||||
private String name; |
||||
|
||||
|
||||
OrderAfterSalesApplyTypeEnum(int code, String name) { |
||||
this.code = code; |
||||
this.name = name; |
||||
} |
||||
|
||||
public static OrderAfterSalesApplyTypeEnum getData(Integer type) { |
||||
for (OrderAfterSalesApplyTypeEnum ele : values()) { |
||||
if(Objects.equals(type,ele.getCode())) return ele; |
||||
} |
||||
return null; |
||||
} |
||||
} |
@ -0,0 +1,34 @@ |
||||
package com.hfkj.sysenum.order; |
||||
|
||||
import lombok.Getter; |
||||
|
||||
/** |
||||
* @className: OrderRefundStatusEnum |
||||
* @author: HuRui |
||||
* @date: 2024/5/14 |
||||
**/ |
||||
@Getter |
||||
public enum OrderRefundStatusEnum { |
||||
/** |
||||
* 退款中 |
||||
*/ |
||||
status1(1, "退款中"), |
||||
/** |
||||
* 退款成功 |
||||
*/ |
||||
status2(2, "退款成功"), |
||||
/** |
||||
* 退款失败 |
||||
*/ |
||||
status3(3, "退款失败"), |
||||
; |
||||
|
||||
private final int code; |
||||
|
||||
private final String name; |
||||
|
||||
OrderRefundStatusEnum(int code, String name) { |
||||
this.code = code; |
||||
this.name = name; |
||||
} |
||||
} |
Loading…
Reference in new issue