| @@ -133,6 +133,9 @@ public class WxBillDailyController extends BillBaseController { | |||||
| wxBillDaily.updateTenantInfo(user); | wxBillDaily.updateTenantInfo(user); | ||||
| wxBillDaily.setUserId(user.getId()); | wxBillDaily.setUserId(user.getId()); | ||||
| wxBillDaily.setBuildWay(EnumBillDailyBuildWay.HAND.getCode()); | wxBillDaily.setBuildWay(EnumBillDailyBuildWay.HAND.getCode()); | ||||
| wxBillDaily.setPayWay(null); | |||||
| wxBillDaily.setPayDate(null); | |||||
| wxBillDaily.setReceiveDate(wxBillDaily.getStarttime()); | |||||
| return wxBillDailyService.saveOrUpdate(wxBillDaily, user); | return wxBillDailyService.saveOrUpdate(wxBillDaily, user); | ||||
| } | } | ||||
| @@ -141,6 +144,9 @@ public class WxBillDailyController extends BillBaseController { | |||||
| MallUserInfo user = getUser(); | MallUserInfo user = getUser(); | ||||
| wxBillDaily.updateTenantInfo(user); | wxBillDaily.updateTenantInfo(user); | ||||
| wxBillDaily.setUserId(user.getId()); | wxBillDaily.setUserId(user.getId()); | ||||
| wxBillDaily.setPayWay(null); | |||||
| wxBillDaily.setPayDate(null); | |||||
| wxBillDaily.setReceiveDate(wxBillDaily.getStarttime()); | |||||
| return wxBillDailyService.saveOrUpdate(wxBillDaily, user); | return wxBillDailyService.saveOrUpdate(wxBillDaily, user); | ||||
| } | } | ||||
| @@ -110,6 +110,9 @@ public class WxBillOtherController extends BillBaseController { | |||||
| MallUserInfo user = getUser(); | MallUserInfo user = getUser(); | ||||
| wxBillOther.updateTenantInfo(user); | wxBillOther.updateTenantInfo(user); | ||||
| wxBillOther.setUserId(user.getId()); | wxBillOther.setUserId(user.getId()); | ||||
| wxBillOther.setPayWay(null); | |||||
| wxBillOther.setPayDate(null); | |||||
| wxBillOther.setReceiveDate(wxBillOther.getStarttime()); | |||||
| return wxBillOtherService.saveOrUpdate(wxBillOther, user); | return wxBillOtherService.saveOrUpdate(wxBillOther, user); | ||||
| } | } | ||||
| @@ -118,6 +121,9 @@ public class WxBillOtherController extends BillBaseController { | |||||
| MallUserInfo user = getUser(); | MallUserInfo user = getUser(); | ||||
| wxBillOther.updateTenantInfo(user); | wxBillOther.updateTenantInfo(user); | ||||
| wxBillOther.setUserId(user.getId()); | wxBillOther.setUserId(user.getId()); | ||||
| wxBillOther.setPayWay(null); | |||||
| wxBillOther.setPayDate(null); | |||||
| wxBillOther.setReceiveDate(wxBillOther.getStarttime()); | |||||
| return wxBillOtherService.saveOrUpdate(wxBillOther, user); | return wxBillOtherService.saveOrUpdate(wxBillOther, user); | ||||
| } | } | ||||
| @@ -110,6 +110,9 @@ public class WxBillOtherDepositController extends BillBaseController { | |||||
| MallUserInfo user = getUser(); | MallUserInfo user = getUser(); | ||||
| wxBillOtherDeposit.updateTenantInfo(user); | wxBillOtherDeposit.updateTenantInfo(user); | ||||
| wxBillOtherDeposit.setUserId(user.getId()); | wxBillOtherDeposit.setUserId(user.getId()); | ||||
| wxBillOtherDeposit.setPayWay(null); | |||||
| wxBillOtherDeposit.setPayDate(null); | |||||
| wxBillOtherDeposit.setReceiveDate(wxBillOtherDeposit.getStarttime()); | |||||
| return wxBillOtherDepositService.saveOrUpdate(wxBillOtherDeposit, user); | return wxBillOtherDepositService.saveOrUpdate(wxBillOtherDeposit, user); | ||||
| } | } | ||||
| @@ -118,6 +121,9 @@ public class WxBillOtherDepositController extends BillBaseController { | |||||
| MallUserInfo user = getUser(); | MallUserInfo user = getUser(); | ||||
| wxBillOtherDeposit.updateTenantInfo(user); | wxBillOtherDeposit.updateTenantInfo(user); | ||||
| wxBillOtherDeposit.setUserId(user.getId()); | wxBillOtherDeposit.setUserId(user.getId()); | ||||
| wxBillOtherDeposit.setPayWay(null); | |||||
| wxBillOtherDeposit.setPayDate(null); | |||||
| wxBillOtherDeposit.setReceiveDate(wxBillOtherDeposit.getStarttime()); | |||||
| return wxBillOtherDepositService.saveOrUpdate(wxBillOtherDeposit, user); | return wxBillOtherDepositService.saveOrUpdate(wxBillOtherDeposit, user); | ||||
| } | } | ||||
| @@ -105,6 +105,8 @@ public class WxBillDaily extends WxBillBaseEntity { | |||||
| private String serviceChargePayUpdate; | private String serviceChargePayUpdate; | ||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private List<Long> merchantIds; | private List<Long> merchantIds; | ||||
| @TableField(exist = false) | |||||
| private List<Long> notInIds; | |||||
| //TODO billTypeName应该也这么处理,不应该到mapper.xml里面写,后面再改 | //TODO billTypeName应该也这么处理,不应该到mapper.xml里面写,后面再改 | ||||
| @Override | @Override | ||||
| @@ -106,6 +106,9 @@ public class WxBillOther extends WxBillBaseEntity { | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private List<Long> merchantIds; | private List<Long> merchantIds; | ||||
| @TableField(exist = false) | |||||
| private List<Long> notInIds; | |||||
| //TODO billTypeName应该也这么处理,不应该到mapper.xml里面写,后面再改 | //TODO billTypeName应该也这么处理,不应该到mapper.xml里面写,后面再改 | ||||
| @Override | @Override | ||||
| public Integer getBillType() { | public Integer getBillType() { | ||||
| @@ -115,6 +115,9 @@ public class WxBillOtherDeposit extends WxBillBaseEntity { | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private List<Long> merchantIds; | private List<Long> merchantIds; | ||||
| @TableField(exist = false) | |||||
| private List<Long> notInIds; | |||||
| //TODO billTypeName应该也这么处理,不应该到mapper.xml里面写,后面再改 | //TODO billTypeName应该也这么处理,不应该到mapper.xml里面写,后面再改 | ||||
| @Override | @Override | ||||
| public Integer getBillType() { | public Integer getBillType() { | ||||
| @@ -243,15 +243,18 @@ public class WxBillDailyServiceImpl extends WxBillBaseService implements WxBillD | |||||
| dailyQuery.setType(record.getType()); | dailyQuery.setType(record.getType()); | ||||
| dailyQuery.updateTenantInfo(user); | dailyQuery.updateTenantInfo(user); | ||||
| dailyQuery.setMerchantId(record.getMerchantId()); | dailyQuery.setMerchantId(record.getMerchantId()); | ||||
| dailyQuery.setReceiveDate(record.getReceiveDate()); | |||||
| //dailyQuery.setReceiveDate(record.getReceiveDate()); | |||||
| dailyQuery.setStarttime(record.getStarttime()); | |||||
| dailyQuery.setEndtime(record.getEndtime()); | |||||
| dailyQuery.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | dailyQuery.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | ||||
| List<WxBillDaily> dailyList = wxBillDailyMapper.findList(dailyQuery); | List<WxBillDaily> dailyList = wxBillDailyMapper.findList(dailyQuery); | ||||
| if (null != dailyList && dailyList.size() > 0 ) { | if (null != dailyList && dailyList.size() > 0 ) { | ||||
| return new ResultData(ErrorCode.BILL_IS_FOUND); | |||||
| return new ResultData(ErrorCode.BILL_IS_FOUND.getCode(),"商户已存在包含该时间端的费用账单"); | |||||
| } | } | ||||
| final IdWorker idWorker = IdWorker.get(); | final IdWorker idWorker = IdWorker.get(); | ||||
| record.setId(idWorker.nextId()); | record.setId(idWorker.nextId()); | ||||
| record.setStatus(record.getReceiveDate().after(date)?EnumBillStatus.WAIT_PAY.getCode():EnumBillStatus.NOT_PAID.getCode()); | |||||
| //record.setStatus(record.getReceiveDate().after(date)?EnumBillStatus.WAIT_PAY.getCode():EnumBillStatus.NOT_PAID.getCode()); | |||||
| record.setStatus(EnumBillStatus.WAIT_PAY.getCode()); | |||||
| record.setCreatetime(date); | record.setCreatetime(date); | ||||
| record.setUpdatetime(date); | record.setUpdatetime(date); | ||||
| record.setExpiredDay(0L); | record.setExpiredDay(0L); | ||||
| @@ -271,6 +274,21 @@ public class WxBillDailyServiceImpl extends WxBillBaseService implements WxBillD | |||||
| if(wxBillDaily==null){ | if(wxBillDaily==null){ | ||||
| return new ResultData(ErrorCode.BILL_ROUTINE_IS_NOT_FOUND); | return new ResultData(ErrorCode.BILL_ROUTINE_IS_NOT_FOUND); | ||||
| } | } | ||||
| WxBillDaily dailyQuery = new WxBillDaily(); | |||||
| dailyQuery.setType(record.getType()); | |||||
| dailyQuery.updateTenantInfo(user); | |||||
| dailyQuery.setMerchantId(record.getMerchantId()); | |||||
| //dailyQuery.setReceiveDate(record.getReceiveDate()); | |||||
| dailyQuery.setStarttime(record.getStarttime()); | |||||
| dailyQuery.setEndtime(record.getEndtime()); | |||||
| dailyQuery.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | |||||
| List<Long> notinidlist = new ArrayList<Long>(); | |||||
| notinidlist.add(record.getId()); | |||||
| dailyQuery.setNotInIds(notinidlist); | |||||
| List<WxBillDaily> dailyList = wxBillDailyMapper.findList(dailyQuery); | |||||
| if (null != dailyList && dailyList.size() > 0 ) { | |||||
| return new ResultData(ErrorCode.BILL_IS_FOUND.getCode(),"商户已存在其他包含该时间端的费用账单"); | |||||
| } | |||||
| wxBillDaily.setUpdatetime(date); | wxBillDaily.setUpdatetime(date); | ||||
| wxBillDailyMapper.updateById(wxBillDaily); | wxBillDailyMapper.updateById(wxBillDaily); | ||||
| return new ResultData(Result.SUCCESS, "更新日常账单成功"); | return new ResultData(Result.SUCCESS, "更新日常账单成功"); | ||||
| @@ -246,12 +246,14 @@ public class WxBillOtherDepositServiceImpl extends WxBillBaseService implements | |||||
| WxBillOtherDeposit otherDepositQuery = new WxBillOtherDeposit(); | WxBillOtherDeposit otherDepositQuery = new WxBillOtherDeposit(); | ||||
| otherDepositQuery.updateTenantInfo(user); | otherDepositQuery.updateTenantInfo(user); | ||||
| otherDepositQuery.setMerchantId(record.getMerchantId()); | otherDepositQuery.setMerchantId(record.getMerchantId()); | ||||
| otherDepositQuery.setReceiveDate(record.getReceiveDate()); | |||||
| //otherDepositQuery.setReceiveDate(record.getReceiveDate()); | |||||
| otherDepositQuery.setStarttime(record.getStarttime()); | |||||
| otherDepositQuery.setEndtime(record.getEndtime()); | |||||
| otherDepositQuery.setComments(record.getComments()); | otherDepositQuery.setComments(record.getComments()); | ||||
| otherDepositQuery.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | otherDepositQuery.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | ||||
| List<WxBillOtherDeposit> otherDeposit = wxBillOtherDepositMapper.findList(otherDepositQuery); | List<WxBillOtherDeposit> otherDeposit = wxBillOtherDepositMapper.findList(otherDepositQuery); | ||||
| if (otherDeposit != null && otherDeposit.size() > 0 ) { | if (otherDeposit != null && otherDeposit.size() > 0 ) { | ||||
| return new ResultData(ErrorCode.BILL_IS_FOUND); | |||||
| return new ResultData(ErrorCode.BILL_IS_FOUND.getCode(),"商户已存在包含该时间端的费用账单"); | |||||
| } | } | ||||
| final IdWorker idWorker = IdWorker.get(); | final IdWorker idWorker = IdWorker.get(); | ||||
| @@ -276,6 +278,21 @@ public class WxBillOtherDepositServiceImpl extends WxBillBaseService implements | |||||
| if (wxBillOtherDeposit == null) { | if (wxBillOtherDeposit == null) { | ||||
| return new ResultData(ErrorCode.BILL_ROUTINE_IS_NOT_FOUND); | return new ResultData(ErrorCode.BILL_ROUTINE_IS_NOT_FOUND); | ||||
| } | } | ||||
| WxBillOtherDeposit otherDepositQuery = new WxBillOtherDeposit(); | |||||
| otherDepositQuery.updateTenantInfo(user); | |||||
| otherDepositQuery.setMerchantId(record.getMerchantId()); | |||||
| //otherDepositQuery.setReceiveDate(record.getReceiveDate()); | |||||
| otherDepositQuery.setStarttime(record.getStarttime()); | |||||
| otherDepositQuery.setEndtime(record.getEndtime()); | |||||
| otherDepositQuery.setComments(record.getComments()); | |||||
| otherDepositQuery.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | |||||
| List<Long> notinidlist = new ArrayList<Long>(); | |||||
| notinidlist.add(record.getId()); | |||||
| otherDepositQuery.setNotInIds(notinidlist); | |||||
| List<WxBillOtherDeposit> otherDeposit = wxBillOtherDepositMapper.findList(otherDepositQuery); | |||||
| if (otherDeposit != null && otherDeposit.size() > 0 ) { | |||||
| return new ResultData(ErrorCode.BILL_IS_FOUND.getCode(),"商户已存在包含该时间端的费用账单"); | |||||
| } | |||||
| record.setUpdatetime(date); | record.setUpdatetime(date); | ||||
| wxBillOtherDepositMapper.updateById(record); | wxBillOtherDepositMapper.updateById(record); | ||||
| return new ResultData(Result.SUCCESS, "更新其他账单成功"); | return new ResultData(Result.SUCCESS, "更新其他账单成功"); | ||||
| @@ -246,16 +246,19 @@ public class WxBillOtherServiceImpl extends WxBillBaseService implements WxBillO | |||||
| WxBillOther otherQuery = new WxBillOther(); | WxBillOther otherQuery = new WxBillOther(); | ||||
| otherQuery.updateTenantInfo(user); | otherQuery.updateTenantInfo(user); | ||||
| otherQuery.setMerchantId(record.getMerchantId()); | otherQuery.setMerchantId(record.getMerchantId()); | ||||
| otherQuery.setReceiveDate(record.getReceiveDate()); | |||||
| //otherQuery.setReceiveDate(record.getReceiveDate()); | |||||
| otherQuery.setStarttime(record.getStarttime()); | |||||
| otherQuery.setEndtime(record.getEndtime()); | |||||
| otherQuery.setName(record.getName()); | otherQuery.setName(record.getName()); | ||||
| otherQuery.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | otherQuery.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | ||||
| List<WxBillOther> other = wxBillOtherMapper.findList(otherQuery); | List<WxBillOther> other = wxBillOtherMapper.findList(otherQuery); | ||||
| if (other != null && other.size() > 0) { | if (other != null && other.size() > 0) { | ||||
| return new ResultData(ErrorCode.BILL_IS_FOUND); | |||||
| return new ResultData(ErrorCode.BILL_IS_FOUND.getCode(),"商户已存在包含该时间端的费用账单"); | |||||
| } | } | ||||
| final IdWorker idWorker = IdWorker.get(); | final IdWorker idWorker = IdWorker.get(); | ||||
| record.setId(idWorker.nextId()); | record.setId(idWorker.nextId()); | ||||
| record.setStatus(record.getReceiveDate().after(date)?EnumBillStatus.WAIT_PAY.getCode():EnumBillStatus.NOT_PAID.getCode()); | |||||
| //record.setStatus(record.getReceiveDate().after(date)?EnumBillStatus.WAIT_PAY.getCode():EnumBillStatus.NOT_PAID.getCode()); | |||||
| record.setStatus(EnumBillStatus.WAIT_PAY.getCode()); | |||||
| record.setCreatetime(date); | record.setCreatetime(date); | ||||
| record.setUpdatetime(date); | record.setUpdatetime(date); | ||||
| record.setExpiredDay(0L); | record.setExpiredDay(0L); | ||||
| @@ -276,6 +279,21 @@ public class WxBillOtherServiceImpl extends WxBillBaseService implements WxBillO | |||||
| if(wxBillOther==null){ | if(wxBillOther==null){ | ||||
| return new ResultData(ErrorCode.BILL_ROUTINE_IS_NOT_FOUND); | return new ResultData(ErrorCode.BILL_ROUTINE_IS_NOT_FOUND); | ||||
| } | } | ||||
| WxBillOther otherQuery = new WxBillOther(); | |||||
| otherQuery.updateTenantInfo(user); | |||||
| otherQuery.setMerchantId(record.getMerchantId()); | |||||
| //otherQuery.setReceiveDate(record.getReceiveDate()); | |||||
| otherQuery.setStarttime(record.getStarttime()); | |||||
| otherQuery.setEndtime(record.getEndtime()); | |||||
| otherQuery.setName(record.getName()); | |||||
| otherQuery.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | |||||
| List<Long> notinidlist = new ArrayList<Long>(); | |||||
| notinidlist.add(record.getId()); | |||||
| otherQuery.setNotInIds(notinidlist); | |||||
| List<WxBillOther> other = wxBillOtherMapper.findList(otherQuery); | |||||
| if (other != null && other.size() > 0) { | |||||
| return new ResultData(ErrorCode.BILL_IS_FOUND.getCode(),"商户已存在其他包含该时间端的费用账单"); | |||||
| } | |||||
| record.setUpdatetime(date); | record.setUpdatetime(date); | ||||
| wxBillOtherMapper.updateById(record); | wxBillOtherMapper.updateById(record); | ||||
| return new ResultData(Result.SUCCESS, "更新其他押金账单成功"); | return new ResultData(Result.SUCCESS, "更新其他押金账单成功"); | ||||
| @@ -75,7 +75,15 @@ | |||||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | ||||
| #{idItem} | #{idItem} | ||||
| </foreach> | </foreach> | ||||
| </if> | |||||
| </if> | |||||
| <if test=" null != notInIds "> | |||||
| and id not in | |||||
| <foreach collection="notInIds" index="index" item="nidItem" open="(" separator="," close=")"> | |||||
| #{nidItem} | |||||
| </foreach> | |||||
| </if> | |||||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | <if test=" null != sortColumns"> order by ${sortColumns} </if> | ||||
| </sql> | </sql> | ||||
| @@ -122,6 +130,12 @@ | |||||
| #{midItem} | #{midItem} | ||||
| </foreach> | </foreach> | ||||
| </if> | </if> | ||||
| <if test=" null != notInIds "> | |||||
| and br.`id` not in | |||||
| <foreach collection="notInIds" index="index" item="nidItem" open="(" separator="," close=")"> | |||||
| #{nidItem} | |||||
| </foreach> | |||||
| </if> | |||||
| </where> | </where> | ||||
| </sql> | </sql> | ||||
| @@ -78,6 +78,13 @@ | |||||
| #{idItem} | #{idItem} | ||||
| </foreach> | </foreach> | ||||
| </if> | </if> | ||||
| <if test=" null != notInIds "> | |||||
| and id not in | |||||
| <foreach collection="notInIds" index="index" item="nidItem" open="(" separator="," close=")"> | |||||
| #{nidItem} | |||||
| </foreach> | |||||
| </if> | |||||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | <if test=" null != sortColumns">order by ${sortColumns}</if> | ||||
| </sql> | </sql> | ||||
| @@ -126,6 +133,13 @@ | |||||
| <foreach collection="merchantIds" index="index" item="midItem" open="(" separator="," close=")"> | <foreach collection="merchantIds" index="index" item="midItem" open="(" separator="," close=")"> | ||||
| #{midItem} | #{midItem} | ||||
| </foreach> | </foreach> | ||||
| <if test=" null != notInIds "> | |||||
| and br.id not in | |||||
| <foreach collection="notInIds" index="index" item="nidItem" open="(" separator="," close=")"> | |||||
| #{nidItem} | |||||
| </foreach> | |||||
| </if> | |||||
| </if> | </if> | ||||
| </where> | </where> | ||||
| @@ -77,6 +77,13 @@ | |||||
| #{idItem} | #{idItem} | ||||
| </foreach> | </foreach> | ||||
| </if> | </if> | ||||
| <if test=" null != notInIds "> | |||||
| and id not in | |||||
| <foreach collection="notInIds" index="index" item="nidItem" open="(" separator="," close=")"> | |||||
| #{nidItem} | |||||
| </foreach> | |||||
| </if> | |||||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | <if test=" null != sortColumns"> order by ${sortColumns} </if> | ||||
| </sql> | </sql> | ||||
| @@ -121,6 +128,13 @@ | |||||
| #{midItem} | #{midItem} | ||||
| </foreach> | </foreach> | ||||
| </if> | </if> | ||||
| <if test=" null != notInIds "> | |||||
| and br.id not in | |||||
| <foreach collection="notInIds" index="index" item="nidItem" open="(" separator="," close=")"> | |||||
| #{nidItem} | |||||
| </foreach> | |||||
| </if> | |||||
| </where> | </where> | ||||
| </sql> | </sql> | ||||