| @@ -10,6 +10,7 @@ import com.iformall.controller.base.BaseController; | |||||
| import com.iformall.controller.mem.BillDailyAsyncTask; | import com.iformall.controller.mem.BillDailyAsyncTask; | ||||
| import com.iformall.domain.po.MallUserInfo; | import com.iformall.domain.po.MallUserInfo; | ||||
| import com.iformall.domain.po.WxBillDaily; | import com.iformall.domain.po.WxBillDaily; | ||||
| import com.iformall.enums.EnumBillDailyBuildWay; | |||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.service.WxBillDailyService; | import com.iformall.service.WxBillDailyService; | ||||
| import com.iformall.utils.Constant; | import com.iformall.utils.Constant; | ||||
| @@ -75,6 +76,7 @@ public class WxBillDailyController extends BaseController { | |||||
| MallUserInfo user = getUser(); | MallUserInfo user = getUser(); | ||||
| wxBillDaily.setTenantId(user.getTenantId()); | wxBillDaily.setTenantId(user.getTenantId()); | ||||
| wxBillDaily.setUserId(user.getId()); | wxBillDaily.setUserId(user.getId()); | ||||
| wxBillDaily.setBuildWay(EnumBillDailyBuildWay.HAND.getCode()); | |||||
| return wxBillDailyService.saveOrUpdate(wxBillDaily, user); | return wxBillDailyService.saveOrUpdate(wxBillDaily, user); | ||||
| } | } | ||||
| @@ -0,0 +1 @@ | |||||
| alter table wx_bill_daily add column build_way tinyint(3) default 1 comment '创建方式1手动2自动3导入'; | |||||
| @@ -133,6 +133,7 @@ public class PowerBillAutoBuildSchedule { | |||||
| wxBillDaily.setStarttime(startdate); | wxBillDaily.setStarttime(startdate); | ||||
| wxBillDaily.setEndtime(enddate); | wxBillDaily.setEndtime(enddate); | ||||
| wxBillDaily.setPriceDetail(priceDetals.toJSONString()); | wxBillDaily.setPriceDetail(priceDetals.toJSONString()); | ||||
| wxBillDaily.setBuildWay(EnumBillDailyBuildWay.AUTO.getCode()); | |||||
| wxBillDailyService.saveOrUpdate(wxBillDaily, mallUserInfo); | wxBillDailyService.saveOrUpdate(wxBillDaily, mallUserInfo); | ||||
| } | } | ||||
| @@ -108,4 +108,8 @@ public class WxBillDaily extends BaseEntity{ | |||||
| private Date endtime; | private Date endtime; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "冻结状态,0正常1冻结", name = "freeze") | @io.swagger.annotations.ApiModelProperty(value = "冻结状态,0正常1冻结", name = "freeze") | ||||
| private Integer freeze; | private Integer freeze; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "创建方式1手动2自动3导入", name = "buildWay") | |||||
| private Integer buildWay; | |||||
| } | } | ||||
| @@ -0,0 +1,38 @@ | |||||
| package com.iformall.enums; | |||||
| /** | |||||
| * @author gongbiao | |||||
| */ | |||||
| public enum EnumBillDailyBuildWay { | |||||
| HAND(1, "手动"), | |||||
| AUTO(2, "自动"), | |||||
| IMPORT(3, "导入"),; | |||||
| public static EnumBillDailyBuildWay getEnum(Integer code) { | |||||
| for (EnumBillDailyBuildWay value : values()) { | |||||
| if (value.getCode().equals(code)) { | |||||
| return value; | |||||
| } | |||||
| } | |||||
| return null; | |||||
| } | |||||
| private Integer code; | |||||
| private String message; | |||||
| EnumBillDailyBuildWay(Integer code, String message) { | |||||
| this.code = code; | |||||
| this.message = message; | |||||
| } | |||||
| public Integer getCode() { | |||||
| return code; | |||||
| } | |||||
| public String getMessage() { | |||||
| return message; | |||||
| } | |||||
| } | |||||
| @@ -1169,6 +1169,7 @@ public class WxBillAllServiceImpl implements WxBillAllService { | |||||
| WxBillRent expiredDayAndStatus = getExpiredDayAndStatus(bill.getReceiveDate(), bill.getPayDate(), receivePay, pay, false); | WxBillRent expiredDayAndStatus = getExpiredDayAndStatus(bill.getReceiveDate(), bill.getPayDate(), receivePay, pay, false); | ||||
| daily.setExpiredDay(expiredDayAndStatus.getExpiredDay()); | daily.setExpiredDay(expiredDayAndStatus.getExpiredDay()); | ||||
| daily.setStatus(expiredDayAndStatus.getStatus()); | daily.setStatus(expiredDayAndStatus.getStatus()); | ||||
| daily.setBuildWay(EnumBillDailyBuildWay.IMPORT.getCode()); | |||||
| wxBillDailyMapper.insertSelective(daily); | wxBillDailyMapper.insertSelective(daily); | ||||
| if (pay > 0) { | if (pay > 0) { | ||||
| addActionImport(daily.getId(), bill.getPayWay(), bill.getPayDate(), user, bill.getPayStr()); | addActionImport(daily.getId(), bill.getPayWay(), bill.getPayDate(), user, bill.getPayStr()); | ||||
| @@ -27,13 +27,14 @@ | |||||
| <result column="starttime" property="starttime"/> | <result column="starttime" property="starttime"/> | ||||
| <result column="endtime" property="endtime"/> | <result column="endtime" property="endtime"/> | ||||
| <result column="freeze" property="freeze"/> | <result column="freeze" property="freeze"/> | ||||
| <result column="build_way" property="buildWay"/> | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`,`receive_pay`,`pay`,`receive_date`,`pay_date`,`createtime`,`expired_day`, | `id`,`receive_pay`,`pay`,`receive_date`,`pay_date`,`createtime`,`expired_day`, | ||||
| `tenant_id`,`owe`,`status`,`is_del`,`merchant_id`,`user_id`,`shop_id`,`updatetime`,`type`, | `tenant_id`,`owe`,`status`,`is_del`,`merchant_id`,`user_id`,`shop_id`,`updatetime`,`type`, | ||||
| `rent_shop_type`,`pay_way`,`price_detail`,`starttime`,`endtime`,freeze | |||||
| `rent_shop_type`,`pay_way`,`price_detail`,`starttime`,`endtime`,freeze,build_way | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
| @@ -56,6 +57,8 @@ | |||||
| <if test=" null != type "> and `type` = #{type} </if> | <if test=" null != type "> and `type` = #{type} </if> | ||||
| <if test=" null != rentShopType ">and `rent_shop_type` = #{rentShopType}</if> | <if test=" null != rentShopType ">and `rent_shop_type` = #{rentShopType}</if> | ||||
| <if test=" null != payWay ">and `pay_way` = #{payWay}</if> | <if test=" null != payWay ">and `pay_way` = #{payWay}</if> | ||||
| <if test=" null != buildWay ">and `build_way` = #{buildWay}</if> | |||||
| <if test=" null != ids "> | <if test=" null != ids "> | ||||
| and id in | and id in | ||||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | ||||
| @@ -74,7 +77,7 @@ | |||||
| select br.`id`,br.`receive_pay`,br.`pay`,br.`receive_date`,br.`pay_date`,br.`createtime`,br.`expired_day` , | select br.`id`,br.`receive_pay`,br.`pay`,br.`receive_date`,br.`pay_date`,br.`createtime`,br.`expired_day` , | ||||
| case when br.status=1 then br.owe else 0 end owe,br.`status`,m.`name` merchant_name,s.shop_number, | case when br.status=1 then br.owe else 0 end owe,br.`status`,m.`name` merchant_name,s.shop_number, | ||||
| br.`updatetime`,br.`merchant_id`,br.shop_id,br.type,br.`rent_shop_type`,br.pay_way,br.price_detail, | br.`updatetime`,br.`merchant_id`,br.shop_id,br.type,br.`rent_shop_type`,br.pay_way,br.price_detail, | ||||
| br.`starttime`,br.`endtime` | |||||
| br.`starttime`,br.`endtime`,br.`build_way` | |||||
| from wx_bill_daily br left join wx_merchant m on br.merchant_id=m.id | from wx_bill_daily br left join wx_merchant m on br.merchant_id=m.id | ||||
| left join wx_shop s on br.shop_id=s.id | left join wx_shop s on br.shop_id=s.id | ||||
| <where> | <where> | ||||
| @@ -88,6 +91,8 @@ | |||||
| <if test=" null != payWay ">and br.`pay_way` = #{payWay}</if> | <if test=" null != payWay ">and br.`pay_way` = #{payWay}</if> | ||||
| <if test=" null != starttime and null!=endtime ">and br.`receive_date` between #{starttime} and #{endtime} | <if test=" null != starttime and null!=endtime ">and br.`receive_date` between #{starttime} and #{endtime} | ||||
| </if> | </if> | ||||
| <if test=" null != buildWay ">and br.`build_way` = #{buildWay}</if> | |||||
| </where> | </where> | ||||