| @@ -40,7 +40,7 @@ public class WxMerchantSubsidyController extends BaseController { | |||
| @ApiOperation("补贴记录汇总") | |||
| @GetMapping("sum") | |||
| @SystemControllerLog(description = "商户-补贴记录-汇总") | |||
| public ResultData count(@ModelAttribute WxMerchantSubsidy wxMerchantSubsidy) { | |||
| public ResultData count(@ModelAttribute WxMerchantSubsidyVo wxMerchantSubsidy) { | |||
| String ipStr = getIpAddr(); | |||
| logger.info("subsidy/sum: " + ipStr + " :" + wxMerchantSubsidy.toString()); | |||
| if (wxMerchantSubsidy == null) { | |||
| @@ -92,7 +92,7 @@ public class WxMerchantSubsidyController extends BaseController { | |||
| @ApiOperation("更新补贴记录") | |||
| @PostMapping("updateSubsidied") | |||
| @SystemControllerLog(description = "商户-更新补贴记录") | |||
| public ResultData updateSubsidied(@RequestBody WxMerchantSubsidy wxMerchantSubsidy) { | |||
| public ResultData updateSubsidied(@RequestBody WxMerchantSubsidyVo wxMerchantSubsidy) { | |||
| String ipStr = getIpAddr(); | |||
| logger.info("subsidy/update: " + ipStr + " :" + wxMerchantSubsidy.toString()); | |||
| if (wxMerchantSubsidy == null) { | |||
| @@ -117,7 +117,7 @@ public class WxMerchantSubsidyController extends BaseController { | |||
| @ApiOperation("补贴记录导出") | |||
| @GetMapping("/exportData") | |||
| @SystemControllerLog(description = "商户-补贴记录-导出") | |||
| public void exportData(@ModelAttribute WxMerchantSubsidy wxMerchantSubsidy, HttpServletRequest request, HttpServletResponse response) { | |||
| public void exportData(@ModelAttribute WxMerchantSubsidyVo wxMerchantSubsidy, HttpServletRequest request, HttpServletResponse response) { | |||
| logger.info("[" + getIpAddr() + "] subsidy/exportData"); | |||
| if (wxMerchantSubsidy == null) { | |||
| throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "过滤条件不能为空"); | |||
| @@ -59,17 +59,17 @@ public class WxMerchantSubsidy extends BaseEntity { | |||
| private Integer receiverPayment; | |||
| @Transient | |||
| @Excel(name="本次消费(元)",width = 20,orderNum = "4") | |||
| @Excel(name="本次消费(元)",width = 20,orderNum = "5") | |||
| @io.swagger.annotations.ApiModelProperty(value="订单金额",name="orderPaymentStr") | |||
| private String orderPaymentStr; | |||
| @Transient | |||
| @Excel(name="商户应收(元)",width = 20,orderNum = "5") | |||
| @Excel(name="商户应收(元)",width = 20,orderNum = "6") | |||
| @io.swagger.annotations.ApiModelProperty(value="接收金额(包含通道费)",name="receiverPaymentStr") | |||
| private String receiverPaymentStr; | |||
| @Transient | |||
| @Excel(name="补贴(元)",width = 20,orderNum = "6") | |||
| @Excel(name="补贴(元)",width = 20,orderNum = "7") | |||
| @io.swagger.annotations.ApiModelProperty(value="补贴额(包含通道费)",name="subsidyStr") | |||
| private String subsidyStr; | |||
| @@ -81,11 +81,11 @@ public class WxMerchantSubsidy extends BaseEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value="线上补贴额/实收补贴额(通道费扣除)",name="realSubsidy") | |||
| private Integer realSubsidy; | |||
| @Excel(name="补贴状态",width = 20,orderNum = "7",replace = { "未补贴_0", "已自动补贴_1","已手工补贴_2"}) | |||
| @Excel(name="补贴状态",width = 20,orderNum = "8",replace = { "未补贴_0", "已自动补贴_1","已手工补贴_2"}) | |||
| @io.swagger.annotations.ApiModelProperty(value="状态(0:未补贴, 1:已补贴, 2:已手工补贴)",name="status") | |||
| private Integer status; | |||
| @Excel(name="交易时间",width = 20,orderNum = "3",format="yyyy-MM-dd HH:mm") | |||
| @Excel(name="交易时间",width = 20,orderNum = "4",format="yyyy-MM-dd HH:mm") | |||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | |||
| private Date createDate; | |||
| @@ -12,36 +12,30 @@ import javax.persistence.Transient; | |||
| @ToString(callSuper = true) | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class WxMerchantSubsidyVo extends WxMerchantSubsidy { | |||
| /**卡信息*/ | |||
| /**封面图**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="封面图",name="coverImg") | |||
| private String coverImg; | |||
| /**券名称**/ | |||
| @Excel(name="活动名称",width = 20,orderNum = "3") | |||
| @io.swagger.annotations.ApiModelProperty(value="券名称",name="title") | |||
| private String title; | |||
| /**副标题**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="副标题",name="subTitle") | |||
| private String subTitle; | |||
| /**单位**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="单位0:钱分,1:小时",name="unit") | |||
| private Integer unit; | |||
| /**须知**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="须知",name="detail") | |||
| private String detail; | |||
| /**购买须知**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="购买须知",name="remark") | |||
| private String remark; | |||
| /**使用商户名**/ | |||
| @Excel(name="消费商户",width = 20,orderNum = "2") | |||
| @io.swagger.annotations.ApiModelProperty(value="商户名",name="name") | |||
| private String merchantName; | |||
| /**持有人昵称**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="持有人昵称",name="nickName") | |||
| private String nickName; | |||
| /**持有人手机**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="持有人手机",name="phone") | |||
| private String phone; | |||
| @@ -17,7 +17,7 @@ public interface WxMerchantSubsidyService { | |||
| * @param record | |||
| * @return | |||
| */ | |||
| List<Map<String, Object>> sumForSubsidy(WxMerchantSubsidy record); | |||
| List<Map<String, Object>> sumForSubsidy(WxMerchantSubsidyVo record); | |||
| /** | |||
| * 根据实体查询分页列表 | |||
| @@ -31,7 +31,7 @@ public class WxMerchantSubsidyServiceImpl implements WxMerchantSubsidyService { | |||
| ExcelService excelService; | |||
| @Override | |||
| public List<Map<String, Object>> sumForSubsidy(WxMerchantSubsidy record) { | |||
| public List<Map<String, Object>> sumForSubsidy(WxMerchantSubsidyVo record) { | |||
| return wxMerchantSubsidyMapper.sumVoList(record); | |||
| } | |||
| @@ -74,7 +74,7 @@ public class WxMerchantSubsidyServiceImpl implements WxMerchantSubsidyService { | |||
| wxMerchantSubsidyMapper.deleteByPrimaryKey(id); | |||
| } | |||
| @Override | |||
| @Override | |||
| public void exportData(WxMerchantSubsidy wxMerchantSubsidy, HttpServletRequest request, HttpServletResponse response) { | |||
| List<WxMerchantSubsidyVo> list = wxMerchantSubsidyMapper.findVoList(wxMerchantSubsidy); | |||
| excelService.exportExcel(list, null, "补贴记录", WxMerchantSubsidyVo.class, "补贴记录.xlsx", response, false); | |||
| @@ -95,8 +95,19 @@ | |||
| <update id="updateByCond" parameterType="com.iformall.domain.po.WxMerchantSubsidy"> | |||
| update wx_merchant_subsidy | |||
| set `status` = #{status} | |||
| where `tenant_id`=#{tenantId} and merchant_id=#{merchantId} | |||
| and id in (${idStr}) | |||
| where 1=1 | |||
| <if test=" null != tenantId "> | |||
| and `tenant_id`=#{tenantId} | |||
| </if> | |||
| <if test=" null != merchantId "> | |||
| and `merchant_id`=#{merchantId} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| </update> | |||
| @@ -228,7 +239,7 @@ | |||
| <include refid="dynamicVoWhereConditions" /> | |||
| </select> | |||
| <select id="sumVoList" parameterType="com.iformall.domain.po.WxMerchantSubsidy" resultType="hashmap"> | |||
| <select id="sumVoList" parameterType="com.iformall.domain.vo.WxMerchantSubsidyVo" resultType="hashmap"> | |||
| select ms.`merchant_id` merchantId, m.`name` as merchantName, | |||
| IFNULL(sum(ms.`order_payment`),0) as sumOrderPayment, | |||
| IFNULL(sum(ms.`receiver_payment`),0) as sumReceiverPayment, | |||
| @@ -245,6 +256,9 @@ | |||
| <if test=" null != merchantId "> | |||
| and ms.`merchant_id` = #{merchantId} | |||
| </if> | |||
| <if test=" null != title "> | |||
| and c.`title` like concat('%', #{title},'%') | |||
| </if> | |||
| <if test=" null != statusS "> | |||
| and ms.`status` in | |||
| <foreach collection="statusS" index="index" item="sItem" open="(" separator="," close=")"> | |||