| @@ -545,7 +545,12 @@ public class WxFinanceController extends BaseController { | |||||
| if (StringUtils.isNotBlank(record.getRemark())) { | if (StringUtils.isNotBlank(record.getRemark())) { | ||||
| receive.setRemark(record.getRemark()); | receive.setRemark(record.getRemark()); | ||||
| } | } | ||||
| //TODO 如果此笔单据里面有预冲的,如果此预冲的费用被别的单据抵扣了,则不能作废。 | |||||
| //如果此笔单据里面有预冲或者押金的,如果此詹丹的费用被别的单据抵扣了,则不能作废。 | |||||
| Integer count = wxFinanceService.getAdvanceUsedBillCount(receive,receive.getId()); | |||||
| if (null != count && count.intValue() > 0 ) { | |||||
| return new ResultData(Result.ERROR,"单据押金或者预冲已被冲抵使用,不能操作"); | |||||
| } | |||||
| wxFinanceService.invalidReceive(receive, getUser(),"收款单作废"); | wxFinanceService.invalidReceive(receive, getUser(),"收款单作废"); | ||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| @@ -9,6 +9,7 @@ import lombok.Data; | |||||
| import lombok.EqualsAndHashCode; | import lombok.EqualsAndHashCode; | ||||
| import lombok.ToString; | import lombok.ToString; | ||||
| import java.util.Date; | import java.util.Date; | ||||
| import java.util.List; | |||||
| /** | /** | ||||
| */ | */ | ||||
| @TableName(value = "wx_finance_receive_setoff") | @TableName(value = "wx_finance_receive_setoff") | ||||
| @@ -64,4 +65,6 @@ public class WxFinanceReceiveSetoff extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value = "是否已删除", name = "isDel") | @io.swagger.annotations.ApiModelProperty(value = "是否已删除", name = "isDel") | ||||
| private Integer isDel; | private Integer isDel; | ||||
| @TableField(exist = false) | |||||
| private List<Long> advanceIdList; | |||||
| } | } | ||||
| @@ -12,6 +12,8 @@ public interface WxFinanceReceiveSetoffMapper extends CommonMapper<WxFinanceRece | |||||
| List<WxFinanceReceiveSetoff> findList(WxFinanceReceiveSetoff wxBillRent); | List<WxFinanceReceiveSetoff> findList(WxFinanceReceiveSetoff wxBillRent); | ||||
| Integer findCount(WxFinanceReceiveSetoff wxBillRent); | Integer findCount(WxFinanceReceiveSetoff wxBillRent); | ||||
| List<Long> findAdvanceIdList(WxFinanceReceiveSetoff wxBillRent); | |||||
| WxFinanceReceiveSetoff selectById(@Param("id")Long id,@Param("tenantId")String tenantId); | WxFinanceReceiveSetoff selectById(@Param("id")Long id,@Param("tenantId")String tenantId); | ||||
| void deleteByConditon(WxFinanceReceiveSetoff wxBillRent); | void deleteByConditon(WxFinanceReceiveSetoff wxBillRent); | ||||
| @@ -66,6 +66,7 @@ public interface WxFinanceService { | |||||
| List<WxAllBill> calcuetSetOff(FinanceSetOffDTO dto,MallUserInfo user); | List<WxAllBill> calcuetSetOff(FinanceSetOffDTO dto,MallUserInfo user); | ||||
| //List<WxFinanceReceive> getSetOffList(FinanceSetOffDTO dto,boolean isMerge); | //List<WxFinanceReceive> getSetOffList(FinanceSetOffDTO dto,boolean isMerge); | ||||
| PageInfo<WxFinanceReceiveSetoff> receiveSetoffListAsPage(WxFinanceReceive record, Integer pageIndex, Integer pageSize); | PageInfo<WxFinanceReceiveSetoff> receiveSetoffListAsPage(WxFinanceReceive record, Integer pageIndex, Integer pageSize); | ||||
| Integer getAdvanceUsedBillCount(TenantEntity tenantEntity,Long receiveId); | |||||
| BigDecimal getBillSetoffSum(WxShop wxShop); | BigDecimal getBillSetoffSum(WxShop wxShop); | ||||
| BigDecimal getBillDepositSum(WxShop wxShop); | BigDecimal getBillDepositSum(WxShop wxShop); | ||||
| @@ -1691,6 +1691,23 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||||
| } | } | ||||
| return page; | return page; | ||||
| } | } | ||||
| @Override | |||||
| public Integer getAdvanceUsedBillCount(TenantEntity tenantEntity,Long receiveId) { | |||||
| WxFinanceReceiveSetoff aidq = new WxFinanceReceiveSetoff(); | |||||
| aidq.updateTenantInfo(tenantEntity); | |||||
| aidq.setReceiveId(receiveId); | |||||
| List<Long> advanceIdList = wxFinanceReceiveSetoffMapper.findAdvanceIdList(aidq); | |||||
| if (null == advanceIdList || advanceIdList.size() <= 0 ) { | |||||
| return 0; | |||||
| } | |||||
| ; | |||||
| WxFinanceReceiveSetoff rsq = new WxFinanceReceiveSetoff(); | |||||
| rsq.updateTenantInfo(tenantEntity); | |||||
| rsq.setAdvanceIdList(advanceIdList); | |||||
| rsq.setIsDel(EnumYesOrNo.NO.getCode()); | |||||
| return wxFinanceReceiveSetoffMapper.findCount(rsq); | |||||
| } | |||||
| @Override | @Override | ||||
| public PageInfo<WxFinanceFinish> finishListAsPage(WxFinanceFinish record, Integer pageIndex, Integer pageSize) { | public PageInfo<WxFinanceFinish> finishListAsPage(WxFinanceFinish record, Integer pageIndex, Integer pageSize) { | ||||
| @@ -40,6 +40,12 @@ | |||||
| <if test=" null != advanceId ">and `advance_id` = #{advanceId}</if> | <if test=" null != advanceId ">and `advance_id` = #{advanceId}</if> | ||||
| <if test=" null != shopId ">and `shop_id` = #{shopId}</if> | <if test=" null != shopId ">and `shop_id` = #{shopId}</if> | ||||
| <if test=" null != isDel ">and `is_del` = #{isDel}</if> | <if test=" null != isDel ">and `is_del` = #{isDel}</if> | ||||
| <if test=" null != advanceIdList "> | |||||
| and advance_id in | |||||
| <foreach collection="advanceIdList" index="index" item="aidItem" open="(" separator="," close=")"> | |||||
| #{aidItem} | |||||
| </foreach> | |||||
| </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=")"> | ||||
| @@ -62,6 +68,12 @@ | |||||
| <include refid="dynamicWhereConditions"/> | <include refid="dynamicWhereConditions"/> | ||||
| </select> | </select> | ||||
| <select id="findAdvanceIdList" parameterType="com.iformall.domain.po.WxFinanceReceiveSetoff" resultType="Long"> | |||||
| select distinct advance_id | |||||
| from wx_finance_receive_setoff | |||||
| <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"/> | ||||