| @@ -55,9 +55,9 @@ public class WxCardPayController extends BaseController { | |||||
| @ApiOperation("C端扫B端储值卡交易流水SUM") | @ApiOperation("C端扫B端储值卡交易流水SUM") | ||||
| @GetMapping("sum") | @GetMapping("sum") | ||||
| public ResultData sumCardOrderList(@ModelAttribute WxCardSpendVo wxCardSpend) { | |||||
| public ResultData sumCardSpendList(@ModelAttribute WxCardSpendVo wxCardSpend) { | |||||
| String ipStr = getIpAddr(); | String ipStr = getIpAddr(); | ||||
| logger.info("sumCardOrderList: " + ipStr + " :" + wxCardSpend.toString()); | |||||
| logger.info("sumCardSpendList: " + ipStr + " :" + wxCardSpend.toString()); | |||||
| if (wxCardSpend == null) wxCardSpend = new WxCardSpendVo(); | if (wxCardSpend == null) wxCardSpend = new WxCardSpendVo(); | ||||
| WxMerchantBUser user = getUser(); | WxMerchantBUser user = getUser(); | ||||
| wxCardSpend.setTenantId(user.getTenantId()); | wxCardSpend.setTenantId(user.getTenantId()); | ||||
| @@ -142,7 +142,7 @@ public class WxCardPayController extends BaseController { | |||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | ||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | ||||
| public ResultData cardOrderList(@ModelAttribute WxCardSpendVo wxCardSpend, Integer pageNum, Integer pageSize) { | |||||
| public ResultData cardSpendList(@ModelAttribute WxCardSpendVo wxCardSpend, Integer pageNum, Integer pageSize) { | |||||
| String ipStr = getIpAddr(); | String ipStr = getIpAddr(); | ||||
| logger.info("saveCardPayOrder: " + ipStr + " :" + wxCardSpend.toString()); | logger.info("saveCardPayOrder: " + ipStr + " :" + wxCardSpend.toString()); | ||||
| if (wxCardSpend == null) wxCardSpend = new WxCardSpendVo(); | if (wxCardSpend == null) wxCardSpend = new WxCardSpendVo(); | ||||
| @@ -151,4 +151,16 @@ public class WxCardPayController extends BaseController { | |||||
| final PageInfo<WxCardSpendVo> page = wxCardSpendService.listAsPage(wxCardSpend, pageNum, pageSize); | final PageInfo<WxCardSpendVo> page = wxCardSpendService.listAsPage(wxCardSpend, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @ApiOperation("C端扫B端储值卡交易流水SUM接口") | |||||
| @GetMapping("sum") | |||||
| public ResultData sumCardSpendList(@ModelAttribute WxCardSpendVo wxCardSpend) { | |||||
| String ipStr = getIpAddr(); | |||||
| logger.info("sumCardSpendList: " + ipStr + " :" + wxCardSpend.toString()); | |||||
| if (wxCardSpend == null) wxCardSpend = new WxCardSpendVo(); | |||||
| WxCUser user = getUser(); | |||||
| wxCardSpend.setTenantId(user.getTenantId()); | |||||
| final Map map = wxCardSpendService.sumCardSpend(wxCardSpend); | |||||
| return new ResultData(map); | |||||
| } | |||||
| } | } | ||||
| @@ -67,6 +67,10 @@ public class WxCardSpend implements Serializable { | |||||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | ||||
| private Date updateDate; | private Date updateDate; | ||||
| /**状态*/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="状态(0:未分帐,1:已分账)",name="payStatus") | |||||
| private Integer payStatus; | |||||
| public static enum Field | public static enum Field | ||||
| { | { | ||||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | ||||
| @@ -84,6 +88,7 @@ public class WxCardSpend implements Serializable { | |||||
| ,CardBeforeRealAmount_ASC("`card_before_real_amount` ASC"),CardBeforeRealAmount_DESC("`card_before_real_amount` DESC") | ,CardBeforeRealAmount_ASC("`card_before_real_amount` ASC"),CardBeforeRealAmount_DESC("`card_before_real_amount` DESC") | ||||
| ,CreateDate_ASC("`create_date` ASC"),CreateDate_DESC("`create_date` DESC") | ,CreateDate_ASC("`create_date` ASC"),CreateDate_DESC("`create_date` DESC") | ||||
| ,UpdateDate_ASC("`update_date` ASC"),UpdateDate_DESC("`update_date` DESC") | ,UpdateDate_ASC("`update_date` ASC"),UpdateDate_DESC("`update_date` DESC") | ||||
| ,Status_ASC("`pay_status` ASC"),Status_DESC("`pay_status` DESC") | |||||
| ; | ; | ||||
| private String value; | private String value; | ||||
| Field(String value){ | Field(String value){ | ||||
| @@ -9,6 +9,8 @@ public interface WxCardSpendMapper extends CommonMapper<WxCardSpend, Long> { | |||||
| List<WxCardSpend> findList(WxCardSpend wxCardSpend); | List<WxCardSpend> findList(WxCardSpend wxCardSpend); | ||||
| int updateByCond(WxCardSpend wxCardSpend); | |||||
| List<WxCardSpendVo> findCardSpendVoList(WxCardSpend wxCardSpend); | List<WxCardSpendVo> findCardSpendVoList(WxCardSpend wxCardSpend); | ||||
| Map sumCardSpendVo(WxCardSpend wxCardSpend); | Map sumCardSpendVo(WxCardSpend wxCardSpend); | ||||
| @@ -9,6 +9,8 @@ public interface WxMerchantSubsidyMapper extends CommonMapper<WxMerchantSubsidy, | |||||
| List<WxMerchantSubsidy> findList(WxMerchantSubsidy wxMerchantSubsidy); | List<WxMerchantSubsidy> findList(WxMerchantSubsidy wxMerchantSubsidy); | ||||
| int updateByCond(WxMerchantSubsidy wxMerchantSubsidy); | |||||
| List<WxMerchantSubsidyVo> findVoList(WxMerchantSubsidy wxMerchantSubsidy); | List<WxMerchantSubsidyVo> findVoList(WxMerchantSubsidy wxMerchantSubsidy); | ||||
| Map<String, Object> sumVoList(WxMerchantSubsidy wxMerchantSubsidy); | Map<String, Object> sumVoList(WxMerchantSubsidy wxMerchantSubsidy); | ||||
| @@ -41,6 +41,13 @@ public interface WxMerchantSubsidyService { | |||||
| */ | */ | ||||
| ResultData saveOrUpdate(WxMerchantSubsidy record); | ResultData saveOrUpdate(WxMerchantSubsidy record); | ||||
| /** | |||||
| * 更新实体 | |||||
| * | |||||
| * @param record | |||||
| */ | |||||
| ResultData update(WxMerchantSubsidy record); | |||||
| /** | /** | ||||
| * 根据Id删除实体 | * 根据Id删除实体 | ||||
| * | * | ||||
| @@ -197,7 +197,18 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { | |||||
| } | } | ||||
| // 9. 分账 | // 9. 分账 | ||||
| shareForCardPay(record.getTenantId(), record.getCardId(), record.getOrderId(), record.getId()); | |||||
| try { | |||||
| shareForCardPay(record.getTenantId(), record.getCardId(), record.getOrderId(), record.getId()); | |||||
| } catch (MallinkException e) { | |||||
| logger.error(e.getMessage()); | |||||
| if(ErrorCode.PROFIT_SHARING_NUM_UP_LIMIT.getCode() == e.getErrorCode()) { | |||||
| // 分账已到20次限制,后面只记录,无法分账 | |||||
| logger.error("分账已到20次限制,后面只记录,无法分账"); | |||||
| } else { | |||||
| throw new MallinkException(e.getErrorCode(), e.getMessage()); | |||||
| } | |||||
| } | |||||
| return new ResultData(record); | return new ResultData(record); | ||||
| } | } | ||||
| @@ -49,6 +49,12 @@ public class WxMerchantSubsidyServiceImpl implements WxMerchantSubsidyService { | |||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| @Override | |||||
| public ResultData update(WxMerchantSubsidy record) { | |||||
| int num = wxMerchantSubsidyMapper.updateByCond(record); | |||||
| return new ResultData(num); | |||||
| } | |||||
| @Override | @Override | ||||
| public void deleteById(Long id) { | public void deleteById(Long id) { | ||||
| wxMerchantSubsidyMapper.deleteByPrimaryKey(id); | wxMerchantSubsidyMapper.deleteByPrimaryKey(id); | ||||
| @@ -17,11 +17,13 @@ | |||||
| <result column="card_before_real_amount" jdbcType="INTEGER" property="cardBeforeRealAmount" /> | <result column="card_before_real_amount" jdbcType="INTEGER" property="cardBeforeRealAmount" /> | ||||
| <result column="create_date" jdbcType="TIMESTAMP" property="createDate" /> | <result column="create_date" jdbcType="TIMESTAMP" property="createDate" /> | ||||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> | <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> | ||||
| <result column="pay_status" jdbcType="INTEGER" property="payStatus" /> | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`,`tenant_id`,`card_id`,`owner_id`,`merchant_id`,`order_id`,`deduction_amount`,`payment`,`real_payment`, | `id`,`tenant_id`,`card_id`,`owner_id`,`merchant_id`,`order_id`,`deduction_amount`,`payment`,`real_payment`, | ||||
| `card_remain_amount`,`card_before_amount`,`card_remain_real_amount`,`card_before_real_amount`,`create_date`,`update_date` | |||||
| `card_remain_amount`,`card_before_amount`,`card_remain_real_amount`,`card_before_real_amount`, | |||||
| `create_date`,`update_date`, `pay_status` | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
| @@ -71,6 +73,9 @@ | |||||
| <if test=" null != updateDate "> | <if test=" null != updateDate "> | ||||
| and `update_date` = #{updateDate} | and `update_date` = #{updateDate} | ||||
| </if> | </if> | ||||
| <if test=" null != status "> | |||||
| and `pay_status` = #{payStatus} | |||||
| </if> | |||||
| <if test=" null != startdate and null!=enddate"> | <if test=" null != startdate and null!=enddate"> | ||||
| and `create_date` between #{startdate} and #{enddate} | and `create_date` between #{startdate} and #{enddate} | ||||
| </if> | </if> | ||||
| @@ -88,6 +93,12 @@ | |||||
| <include refid="dynamicWhereConditions" /> | <include refid="dynamicWhereConditions" /> | ||||
| </select> | </select> | ||||
| <select id="updateByCond" parameterType="com.iformall.domain.po.WxCardSpend" resultMap="BaseResultMap"> | |||||
| update wx_card_spend | |||||
| set `pay_status` = #{payStatus} | |||||
| <include refid="dynamicWhereConditions" /> | |||||
| </select> | |||||
| <resultMap id="VoResultMap" type="com.iformall.domain.vo.WxCardSpendVo"> | <resultMap id="VoResultMap" type="com.iformall.domain.vo.WxCardSpendVo"> | ||||
| <id column="id" jdbcType="BIGINT" property="id" /> | <id column="id" jdbcType="BIGINT" property="id" /> | ||||
| @@ -105,6 +116,7 @@ | |||||
| <result column="card_before_real_amount" jdbcType="INTEGER" property="cardBeforeRealAmount" /> | <result column="card_before_real_amount" jdbcType="INTEGER" property="cardBeforeRealAmount" /> | ||||
| <result column="create_date" jdbcType="TIMESTAMP" property="createDate" /> | <result column="create_date" jdbcType="TIMESTAMP" property="createDate" /> | ||||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> | <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> | ||||
| <result column="pay_status" jdbcType="INTEGER" property="payStatus" /> | |||||
| <result column="title" jdbcType="VARCHAR" property="title"/> | <result column="title" jdbcType="VARCHAR" property="title"/> | ||||
| @@ -120,10 +132,11 @@ | |||||
| <sql id="allVoColumns"> | <sql id="allVoColumns"> | ||||
| cs.`id`,cs.`tenant_id`,cs.`card_id`,cs.`owner_id`,cs.`merchant_id`,cs.`order_id`,cs.`deduction_amount`,cs.`payment`,cs.`real_payment`, | cs.`id`,cs.`tenant_id`,cs.`card_id`,cs.`owner_id`,cs.`merchant_id`,cs.`order_id`,cs.`deduction_amount`,cs.`payment`,cs.`real_payment`, | ||||
| cs.`card_remain_amount`,cs.`card_before_amount`,cs.`card_remain_real_amount`,cs.`card_before_real_amount`,cs.`create_date`,cs.`update_date`, | |||||
| cs.`card_remain_amount`,cs.`card_before_amount`,cs.`card_remain_real_amount`,cs.`card_before_real_amount`, | |||||
| cs.`create_date`,cs.`update_date`, cs.`pay_status` | |||||
| m.`name`, c.`title`, | m.`name`, c.`title`, | ||||
| ms.`subsidy`,ms.`real_subsidy`,ms.`status`, | ms.`subsidy`,ms.`real_subsidy`,ms.`status`, | ||||
| ou.`nick_name` as onick_name, ou.`phone` as ou_phone | |||||
| ou.`nick_name` as onick_name, ou.`phone` as ou_phone | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicVoWhereConditions"> | <sql id="dynamicVoWhereConditions"> | ||||
| @@ -173,6 +186,12 @@ | |||||
| <if test=" null != updateDate "> | <if test=" null != updateDate "> | ||||
| and cs.`update_date` = #{updateDate} | and cs.`update_date` = #{updateDate} | ||||
| </if> | </if> | ||||
| <if test=" null != payStatus "> | |||||
| and cs.`pay_status` = #{payStatus} | |||||
| </if> | |||||
| <if test=" null != status "> | |||||
| and ms.`status` = #{status} | |||||
| </if> | |||||
| <if test=" null != ouPhone "> | <if test=" null != ouPhone "> | ||||
| and ou.`phone` = #{ouPhone} | and ou.`phone` = #{ouPhone} | ||||
| </if> | </if> | ||||
| @@ -203,7 +222,9 @@ | |||||
| select | select | ||||
| IFNULL(SUM(cs.`deduction_amount`),0) as sum_deduction_amount, | IFNULL(SUM(cs.`deduction_amount`),0) as sum_deduction_amount, | ||||
| IFNULL(SUM(cs.`payment`),0) as sum_payment, | IFNULL(SUM(cs.`payment`),0) as sum_payment, | ||||
| IFNULL(SUM(cs.`real_payment`),0) as sum_real_payment | |||||
| IFNULL(SUM(cs.`real_payment`),0) as sum_real_payment, | |||||
| IFNULL(SUM(ms.`subsidy`), 0) as sum_subsidy, | |||||
| IFNULL(SUM(ms.`real_subsidy`), 0) as sum_real_subsidy | |||||
| from wx_card_spend cs | from wx_card_spend cs | ||||
| left join wx_coupon_order co on co.id = cs.card_id | left join wx_coupon_order co on co.id = cs.card_id | ||||
| left join wx_coupon c on c.id = co.coupon_id | left join wx_coupon c on c.id = co.coupon_id | ||||
| @@ -83,6 +83,12 @@ | |||||
| <include refid="dynamicWhereConditions" /> | <include refid="dynamicWhereConditions" /> | ||||
| </select> | </select> | ||||
| <select id="updateByCond" parameterType="com.iformall.domain.po.WxMerchantSubsidy" resultMap="BaseResultMap"> | |||||
| update wx_merchant_subsidy | |||||
| set `status` = #{status} | |||||
| <include refid="dynamicWhereConditions" /> | |||||
| </select> | |||||
| <resultMap id="VoBaseResultMap" type="com.iformall.domain.vo.WxMerchantSubsidyVo"> | <resultMap id="VoBaseResultMap" type="com.iformall.domain.vo.WxMerchantSubsidyVo"> | ||||
| <id column="id" jdbcType="BIGINT" property="id" /> | <id column="id" jdbcType="BIGINT" property="id" /> | ||||