| @@ -276,7 +276,6 @@ public class WxEnergyController extends BaseController { | |||||
| @PostMapping("readingIsDel") | @PostMapping("readingIsDel") | ||||
| public ResultData readingIsDel(@RequestBody WxEnergyMeterReading record) { | public ResultData readingIsDel(@RequestBody WxEnergyMeterReading record) { | ||||
| record.updateTenantInfo(getTenantInfo()); | record.updateTenantInfo(getTenantInfo()); | ||||
| record.setIsDel(EnumYesOrNo.YES.getCode()); | |||||
| wxEnergyService.setReadingIsDel(record); | wxEnergyService.setReadingIsDel(record); | ||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| @@ -440,6 +440,7 @@ public class WxFinanceController extends BaseController { | |||||
| WxFinanceReceive rq = new WxFinanceReceive(); | WxFinanceReceive rq = new WxFinanceReceive(); | ||||
| rq.setCreateTimeBegin(finish.getStartDate()); | rq.setCreateTimeBegin(finish.getStartDate()); | ||||
| rq.setCreateTimeEnd(finish.getEndDate()); | rq.setCreateTimeEnd(finish.getEndDate()); | ||||
| //正常和已红冲的都可以结账 | |||||
| rq.setFinishStatus(EnumYesOrNo.YES.getCode()); | rq.setFinishStatus(EnumYesOrNo.YES.getCode()); | ||||
| rq.setIsFinish(EnumYesOrNo.NO.getCode()); | rq.setIsFinish(EnumYesOrNo.NO.getCode()); | ||||
| rq.updateTenantInfo(record); | rq.updateTenantInfo(record); | ||||
| @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableField; | |||||
| import com.baomidou.mybatisplus.annotation.TableName; | import com.baomidou.mybatisplus.annotation.TableName; | ||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.enums.EnumFinanceCashierType; | import com.iformall.enums.EnumFinanceCashierType; | ||||
| import com.iformall.enums.EnumFinanceFinishStatus; | |||||
| import com.iformall.enums.EnumFinanceReceiveStatus; | import com.iformall.enums.EnumFinanceReceiveStatus; | ||||
| import com.iformall.enums.EnumFinanceReceiveType; | import com.iformall.enums.EnumFinanceReceiveType; | ||||
| @@ -53,7 +54,7 @@ public class WxFinanceFinish extends TenantEntity { | |||||
| private String statusName; | private String statusName; | ||||
| public String getStatusName() { | public String getStatusName() { | ||||
| if (null != status) { | if (null != status) { | ||||
| return EnumFinanceReceiveStatus.getEnum(status).getMessage(); | |||||
| return EnumFinanceFinishStatus.getEnum(status).getMessage(); | |||||
| } | } | ||||
| return null; | return null; | ||||
| } | } | ||||
| @@ -145,6 +145,9 @@ public class WxFinanceReceiveVo implements Serializable { | |||||
| @io.swagger.annotations.ApiModelProperty(value = "是否已删除", name = "isDel") | @io.swagger.annotations.ApiModelProperty(value = "是否已删除", name = "isDel") | ||||
| private Integer isDel; | private Integer isDel; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "是否已结账完成", name = "isFinish") | |||||
| private Integer isFinish; | |||||
| public void initByReceive(WxFinanceReceive receive,WxFinanceReceiveBill receiveBill) { | public void initByReceive(WxFinanceReceive receive,WxFinanceReceiveBill receiveBill) { | ||||
| @@ -164,7 +167,7 @@ public class WxFinanceReceiveVo implements Serializable { | |||||
| this.merchantId = receive.getMerchantId(); | this.merchantId = receive.getMerchantId(); | ||||
| this.remark = receive.getRemark(); | this.remark = receive.getRemark(); | ||||
| this.isPrint = receive.getIsPrint(); | this.isPrint = receive.getIsPrint(); | ||||
| this.isFinish = receive.getIsFinish(); | |||||
| if (null != receiveBill) { | if (null != receiveBill) { | ||||
| this.rid = receiveBill.getId(); | this.rid = receiveBill.getId(); | ||||
| this.receiveId = receiveBill.getReceiveId(); | this.receiveId = receiveBill.getReceiveId(); | ||||
| @@ -14,6 +14,8 @@ public interface WxFinanceReceiveMapper extends CommonMapper<WxFinanceReceive, L | |||||
| List<WxFinanceReceive> findList(WxFinanceReceive wxBillRent); | List<WxFinanceReceive> findList(WxFinanceReceive wxBillRent); | ||||
| Integer findCount(WxFinanceReceive wxBillRent); | |||||
| WxFinanceReceive selectById(@Param("id")Long id,@Param("tenantId")String tenantId); | WxFinanceReceive selectById(@Param("id")Long id,@Param("tenantId")String tenantId); | ||||
| void setIsDel(@Param("id")Long id,@Param("tenantId")String tenantId,@Param("isDel")Integer isDel); | void setIsDel(@Param("id")Long id,@Param("tenantId")String tenantId,@Param("isDel")Integer isDel); | ||||
| @@ -25,5 +27,7 @@ public interface WxFinanceReceiveMapper extends CommonMapper<WxFinanceReceive, L | |||||
| WxFinanceReceiveSumVo getReceiveSum(WxFinanceReceive record); | WxFinanceReceiveSumVo getReceiveSum(WxFinanceReceive record); | ||||
| List<WxFinanceReceivePayway> getReceivePayWaySum(WxFinanceReceive record); | List<WxFinanceReceivePayway> getReceivePayWaySum(WxFinanceReceive record); | ||||
| } | } | ||||
| @@ -59,6 +59,8 @@ public interface WxAllBillService { | |||||
| void backPay(WxBillPayDTO dto,MallUserInfo user); | void backPay(WxBillPayDTO dto,MallUserInfo user); | ||||
| void toMechantBackPay(WxBillPayDTO dto,MallUserInfo user); | |||||
| void rentContractStop(WxRentContract rentContract,MallUserInfo user); | void rentContractStop(WxRentContract rentContract,MallUserInfo user); | ||||
| void propertyContractStop(WxPropertyContract propertyContract,MallUserInfo user); | void propertyContractStop(WxPropertyContract propertyContract,MallUserInfo user); | ||||
| @@ -312,6 +312,10 @@ public class WxBillAllHelper { | |||||
| wxAllBillService.backPay(dto, user); | wxAllBillService.backPay(dto, user); | ||||
| } | } | ||||
| public void toMechantBackPay(WxBillPayDTO dto,MallUserInfo user) { | |||||
| wxAllBillService.toMechantBackPay(dto, user); | |||||
| } | |||||
| public void updatePay(WxBillPayDTO dto,MallUserInfo user) { | public void updatePay(WxBillPayDTO dto,MallUserInfo user) { | ||||
| wxAllBillService.updatePay(dto, user); | wxAllBillService.updatePay(dto, user); | ||||
| } | } | ||||
| @@ -520,6 +520,24 @@ public class WxAllBillServiceImpl extends WxBillBaseService implements WxAllBill | |||||
| dto.getAddpay(), dto.getAddpay(),dto.getSetOff(),wxBillRent.getPayDate(),dto.getPayWayObject(),dto.getRemark(),null,null, user); | dto.getAddpay(), dto.getAddpay(),dto.getSetOff(),wxBillRent.getPayDate(),dto.getPayWayObject(),dto.getRemark(),null,null, user); | ||||
| } | } | ||||
| @Override | |||||
| public void toMechantBackPay(WxBillPayDTO dto, MallUserInfo user) { | |||||
| WxAllBill dbBill = wxAllBillMapper.selectById(dto.getId(),dto.getTenantId()); | |||||
| BigDecimal oldreturnPay = new BigDecimal(0); | |||||
| if (StringUtils.isNotBlank(dbBill.getReturnPay())) { | |||||
| oldreturnPay = new BigDecimal(dbBill.getReturnPay()); | |||||
| } | |||||
| WxAllBill wxBillRent = new WxAllBill(); | |||||
| wxBillRent.setId(dto.getId()); | |||||
| wxBillRent.updateTenantInfo(dto); | |||||
| wxBillRent.setUpdatetime(new Date()); | |||||
| wxBillRent.setReturnPay(oldreturnPay.subtract(new BigDecimal(dto.getPayToMerchant())).toPlainString()); | |||||
| wxAllBillMapper.updateById(wxBillRent); | |||||
| EnumBillAction action = EnumBillAction.RETURN; | |||||
| this.addBillAction(action, dto.getBillTypeValue(),dto.getId(), | |||||
| oldreturnPay.toPlainString(), dto.getPayToMerchant(),null,null,null,dto.getRemark(),null,null, user); | |||||
| } | |||||
| @Override | @Override | ||||
| public void rentContractStop(WxRentContract rentContract,MallUserInfo user) { | public void rentContractStop(WxRentContract rentContract,MallUserInfo user) { | ||||
| //删除草稿状态的账单 | //删除草稿状态的账单 | ||||
| @@ -918,7 +918,8 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||||
| public void invalidReceive(WxFinanceReceive record, MallUserInfo user,boolean isRedSetoff) { | public void invalidReceive(WxFinanceReceive record, MallUserInfo user,boolean isRedSetoff) { | ||||
| //如果自身是预充单,则被冲抵了就不能作废 | //如果自身是预充单,则被冲抵了就不能作废 | ||||
| if (record.getType().intValue() == EnumFinanceReceiveType.ADVANCE.getCode().intValue()) { | |||||
| if (record.getType().intValue() == EnumFinanceCashierType.RECEIVE.getCode().intValue() && | |||||
| record.getReceiveType().intValue() == EnumFinanceReceiveType.ADVANCE.getCode().intValue()) { | |||||
| WxFinanceReceiveSetoff rsq0 = new WxFinanceReceiveSetoff(); | WxFinanceReceiveSetoff rsq0 = new WxFinanceReceiveSetoff(); | ||||
| rsq0.updateTenantInfo(record); | rsq0.updateTenantInfo(record); | ||||
| rsq0.setAdvanceId(record.getId()); | rsq0.setAdvanceId(record.getId()); | ||||
| @@ -964,13 +965,23 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||||
| payDto.updateTenantInfo(record); | payDto.updateTenantInfo(record); | ||||
| payDto.setId(bill.getId()); | payDto.setId(bill.getId()); | ||||
| payDto.setBillTypeValue(bill.getBillType()); | payDto.setBillTypeValue(bill.getBillType()); | ||||
| payDto.setAddpay(rb.getReceive()); | |||||
| if (isRedSetoff) { | |||||
| payDto.setRemark("收款单红冲,自动回退"); | |||||
| if (record.getType().intValue() == EnumFinanceCashierType.RECEIVE.getCode().intValue()) { | |||||
| payDto.setAddpay(rb.getReceive()); | |||||
| if (isRedSetoff) { | |||||
| payDto.setRemark("收款单红冲,自动回退"); | |||||
| }else { | |||||
| payDto.setRemark("收款单作废,自动回退"); | |||||
| } | |||||
| wxBillAllHelper.backPay(payDto, user); | |||||
| }else { | }else { | ||||
| payDto.setRemark("收款单作废,自动回退"); | |||||
| payDto.setPayToMerchant(rb.getPay()); | |||||
| if (isRedSetoff) { | |||||
| payDto.setRemark("付款单红冲,自动回退"); | |||||
| }else { | |||||
| payDto.setRemark("付款单作废,自动回退"); | |||||
| } | |||||
| wxBillAllHelper.toMechantBackPay(payDto, user); | |||||
| } | } | ||||
| wxBillAllHelper.backPay(payDto, user); | |||||
| }else { | }else { | ||||
| //预收单冲抵回退 | //预收单冲抵回退 | ||||
| @@ -1148,7 +1159,7 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||||
| @Override | @Override | ||||
| public Integer getReceiveUnFinisedCount(WxFinanceReceive record) { | public Integer getReceiveUnFinisedCount(WxFinanceReceive record) { | ||||
| return null; | |||||
| return wxFinanceReceiveMapper.findCount(record); | |||||
| } | } | ||||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | ||||
| @@ -83,6 +83,12 @@ | |||||
| <include refid="dynamicWhereConditions"/> | <include refid="dynamicWhereConditions"/> | ||||
| </select> | </select> | ||||
| <select id="findCount" parameterType="com.iformall.domain.po.WxFinanceReceive" resultType="Integer"> | |||||
| select count(1) | |||||
| from wx_finance_receive | |||||
| <include refid="dynamicWhereConditions"/> | |||||
| </select> | |||||
| <select id="selectById" parameterType="HashMap" resultMap="BaseResultMap"> | <select id="selectById" parameterType="HashMap" resultMap="BaseResultMap"> | ||||
| select | select | ||||
| <include refid="allColumns"/> | <include refid="allColumns"/> | ||||