| @@ -123,8 +123,8 @@ public class WxFinanceController extends BaseController { | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation("预收类型列表") | |||
| @GetMapping("advanceTypeList") | |||
| @ApiOperation("预收科目列表") | |||
| @GetMapping("advanceFeesList") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true), | |||
| @@ -274,4 +274,18 @@ public class WxFinanceController extends BaseController { | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("作废") | |||
| @PostMapping("receiveInvalid") | |||
| public ResultData receiveInvalid(@RequestBody WxFinanceReceive record) { | |||
| WxFinanceReceive receive = wxFinanceService.getReceiveById(this.getTenantInfo(), record.getId()); | |||
| if (receive.getStatus().intValue() != EnumFinanceReceiveStatus.NORMAL.getCode().intValue()) { | |||
| return new ResultData(Result.ERROR,"该状态不允许操作"); | |||
| } | |||
| Map<Integer,EnumFinanceReceiveType> tmap = new HashMap<Integer,EnumFinanceReceiveType>(); | |||
| for (EnumFinanceReceiveType t : EnumFinanceReceiveType.values()) { | |||
| tmap.put(t.getCode(), t); | |||
| } | |||
| return new ResultData(tmap); | |||
| } | |||
| } | |||
| @@ -2499,35 +2499,6 @@ alter table wx_bill_other_deposit_97 add column energy_fees_id bigint(20) N | |||
| alter table wx_bill_other_deposit_98 add column energy_fees_id bigint(20) NOT NULL COMMENT '科目编号';; | |||
| alter table wx_bill_other_deposit_99 add column energy_fees_id bigint(20) NOT NULL COMMENT '科目编号';; | |||
| CREATE TABLE `wx_finance_advance_type` ( | |||
| `id` bigint(20) NOT NULL COMMENT '主键ID', | |||
| `tenant_id` varchar(5) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '租户ID', | |||
| `parent_tenant_id` varchar(5) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '父租户ID', | |||
| `create_time` timestamp NULL DEFAULT NULL, | |||
| `update_time` timestamp NULL DEFAULT NULL, | |||
| `is_del` int(1) NOT NULL DEFAULT '0', | |||
| `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '表名称', | |||
| `rate` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '最高抵扣比例', | |||
| PRIMARY KEY (`id`), | |||
| UNIQUE KEY `id_UNIQUE` (`id`) | |||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='能耗表'; | |||
| CREATE TABLE `wx_finance_advance_type_fees` ( | |||
| `id` bigint(20) NOT NULL COMMENT '主键ID', | |||
| `tenant_id` varchar(5) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '租户ID', | |||
| `parent_tenant_id` varchar(5) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '父租户ID', | |||
| `create_time` timestamp NULL DEFAULT NULL, | |||
| `update_time` timestamp NULL DEFAULT NULL, | |||
| `advance_type_id` bigint(20) NOT NULL COMMENT 'advance_type编码', | |||
| `fees_id` bigint(20) NOT NULL COMMENT '科目编码', | |||
| PRIMARY KEY (`id`), | |||
| UNIQUE KEY `id_UNIQUE` (`id`), | |||
| KEY `T_A_F` (`tenant_id`,`advance_type_id`,`fees_id`) | |||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='能耗表'; | |||
| insert into wx_energy_fees_3 (id,tenant_id,parent_tenant_id,create_time,update_time,is_del,NAME,bill_type,is_system,fixed_price) values | |||
| (1,'1003',null,now(),now(),0,'租金',1,1,0), | |||
| (2,'1003',null,now(),now(),0,'商业管理费',1,1,0), | |||
| @@ -2619,25 +2590,34 @@ insert into wx_energy_fees_89 (id,tenant_id,parent_tenant_id,create_time,upda | |||
| (5,'789',null,now(),now(),0,'物业费',1,1,0), | |||
| (6,'789',null,now(),now(),0,'物业押金',1,1,1); | |||
| CREATE TABLE `wx_finance_advance` ( | |||
| CREATE TABLE `wx_bill_advance` ( | |||
| `id` bigint(20) NOT NULL COMMENT '主键ID', | |||
| `tenant_id` varchar(5) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '租户ID', | |||
| `parent_tenant_id` varchar(5) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '父租户ID', | |||
| `create_time` timestamp NULL DEFAULT NULL, | |||
| `update_time` timestamp NULL DEFAULT NULL, | |||
| `is_del` int(1) NOT NULL DEFAULT '0', | |||
| `advance_type_id` bigint(20) NOT NULL COMMENT '类型id', | |||
| `merchant_id` bigint(20) NOT NULL COMMENT '商户编码', | |||
| `rent_shop_type` int(1) NOT NULL COMMENT '租赁商铺类型', | |||
| `createtime` timestamp NULL DEFAULT NULL, | |||
| `updatetime` timestamp NULL DEFAULT NULL, | |||
| `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', | |||
| `create_by_name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, | |||
| `update_by` bigint(20) DEFAULT NULL, | |||
| `update_by_name` bigint(100) DEFAULT NULL, | |||
| `money` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '金额', | |||
| `remain_money` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '剩余金额', | |||
| `receive_pay` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '应收金额', | |||
| `pay` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '已付金额', | |||
| `pay_way` bigint(20) DEFAULT NULL COMMENT '支付方式', | |||
| `pay_date` timestamp NULL DEFAULT NULL COMMENT '支付时间', | |||
| `set_off` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '冲抵金额', | |||
| `starttime` timestamp NULL DEFAULT NULL COMMENT '开始时间', | |||
| `endtime` timestamp NULL DEFAULT NULL COMMENT '结束时间', | |||
| `energy_fees_id` bigint(20) NOT NULL COMMENT '预收科目', | |||
| `remark` varchar(1000) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', | |||
| PRIMARY KEY (`id`), | |||
| UNIQUE KEY `id_UNIQUE` (`id`) | |||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='能耗表'; | |||
| CREATE TABLE `wx_finance_receive` ( | |||
| `id` bigint(20) NOT NULL COMMENT '主键ID', | |||
| `tenant_id` varchar(5) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '租户ID', | |||
| @@ -0,0 +1,62 @@ | |||
| package com.iformall.domain.po; | |||
| import com.baomidou.mybatisplus.annotation.TableField; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import com.iformall.domain.po.base.WxBillBaseEntity; | |||
| import com.iformall.enums.EnumBillAllType; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| import lombok.ToString; | |||
| /** | |||
| */ | |||
| @TableName(value = "wx_bill_advance") | |||
| @Data | |||
| @ToString(callSuper = true) | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class WxBillAdvance extends WxBillBaseEntity { | |||
| private static final long serialVersionUID = -4337916787670692258L; | |||
| @io.swagger.annotations.ApiModelProperty(value="应收金额(最初应收)",name="needPay") | |||
| private String remark; | |||
| @Override | |||
| public Integer getBillType() { | |||
| return EnumBillAllType.ADVANCE.getCode(); | |||
| } | |||
| @Override | |||
| public String getBillTypeName() { | |||
| return EnumBillAllType.ADVANCE.getMessage(); | |||
| } | |||
| @Override | |||
| public String getBillRemark() { | |||
| return remark; | |||
| } | |||
| @Override | |||
| public String getReturnPay() { | |||
| return "0"; | |||
| } | |||
| @Override | |||
| public String getBillLatePay() { | |||
| return "0"; | |||
| } | |||
| @Override | |||
| public String getBillServicePay() { | |||
| return "0"; | |||
| } | |||
| @TableField(exist = false) | |||
| private String totalFee; | |||
| public void calcuteTotalFee(Integer decimalSize) { | |||
| this.totalFee = receivePay; | |||
| } | |||
| } | |||
| @@ -21,6 +21,8 @@ import java.math.BigDecimal; | |||
| import java.text.SimpleDateFormat; | |||
| import java.util.Calendar; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| /** | |||
| */ | |||
| @@ -180,5 +182,24 @@ public class WxEnergyFees extends TenantEntity { | |||
| @TableField(exist = false) | |||
| private Integer notEnergy; | |||
| @TableField(exist = false) | |||
| private List<Long> feesIds;//冲抵科目 | |||
| @TableField(exist = false) | |||
| private String feesName; | |||
| public String getFeesIdsName(Map<Long, WxEnergyFees> feesMap) { | |||
| if (null != feesIds) { | |||
| StringBuffer sb= new StringBuffer(); | |||
| for (int i = 0 ; i < feesIds.size(); i++) { | |||
| Long feid = feesIds.get(i); | |||
| WxEnergyFees f = feesMap.get(feid); | |||
| if (null != f) { | |||
| sb.append(f.getName()).append(","); | |||
| } | |||
| } | |||
| return sb.toString(); | |||
| } | |||
| return null; | |||
| } | |||
| } | |||
| @@ -1,67 +0,0 @@ | |||
| package com.iformall.domain.po; | |||
| import com.baomidou.mybatisplus.annotation.TableField; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| import lombok.ToString; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| /** | |||
| */ | |||
| @TableName(value = "wx_finance_advance") | |||
| @Data | |||
| @ToString(callSuper = true) | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class WxFinanceAdvance extends TenantEntity { | |||
| private static final long serialVersionUID = 7009117540201976664L; | |||
| @io.swagger.annotations.ApiModelProperty(value="id",name="id") | |||
| private Long id; | |||
| @io.swagger.annotations.ApiModelProperty(value="createTime",name="createTime") | |||
| private Date createTime; | |||
| @TableField(exist = false) | |||
| private Date createBegin; | |||
| @TableField(exist = false) | |||
| private Date createEnd; | |||
| @io.swagger.annotations.ApiModelProperty(value="updateTime",name="updateTime") | |||
| private Date updateTime; | |||
| @io.swagger.annotations.ApiModelProperty(value = "isDel", name = "isDel") | |||
| private Integer isDel; | |||
| @io.swagger.annotations.ApiModelProperty(value="advanceTypeId",name="advanceTypeId") | |||
| private Long advanceTypeId; | |||
| @TableField(exist = false) | |||
| private String advanceTypeName; | |||
| @TableField(exist = false) | |||
| private List<Long> advanceTypeIdList; | |||
| @io.swagger.annotations.ApiModelProperty(value="advanceTypeId",name="advanceTypeId") | |||
| private Long merchantId; | |||
| @TableField(exist = false) | |||
| private String merchantName; | |||
| @TableField(exist = false) | |||
| private String shopNumber; | |||
| @io.swagger.annotations.ApiModelProperty(value="createBy",name="createBy") | |||
| private Long createBy; | |||
| @io.swagger.annotations.ApiModelProperty(value="createByName",name="createByName") | |||
| private String createByName; | |||
| @io.swagger.annotations.ApiModelProperty(value="updateBy",name="updateBy") | |||
| private Long updateBy; | |||
| @io.swagger.annotations.ApiModelProperty(value="updateByName",name="updateByName") | |||
| private String updateByName; | |||
| @io.swagger.annotations.ApiModelProperty(value="预充总金额",name="money") | |||
| private String money; | |||
| @io.swagger.annotations.ApiModelProperty(value="剩余总金额",name="remainMoney") | |||
| private String remainMoney; | |||
| } | |||
| @@ -75,6 +75,9 @@ public class WxFinanceReceive extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value = "remark", name = "remark") | |||
| private String remark; | |||
| @io.swagger.annotations.ApiModelProperty(value = "预收款类型,", name = "advanceTypeId") | |||
| private Long advanceTypeId; | |||
| @TableField(exist = false) | |||
| private List<WxBillBaseEntity> bills; | |||
| @TableField(exist = false) | |||
| @@ -106,7 +106,7 @@ public class WxBillBaseEntity extends TenantEntity { | |||
| return "0"; | |||
| } | |||
| @Excel(name = "状态", replace = {"欠缴_1", "待缴_2", "已结清_3", "未到期_4", "已退还_5", "失效_6", "坏账_7", "退租待结算_8"}, width = 20, orderNum = "10") | |||
| @Excel(name = "状态", replace = {"欠缴_1", "待缴_2", "已结清_3", "未到期_4", "已退还_5", "失效_6", "坏账_7", "退租待结算_8","预收待抵扣_9"}, width = 20, orderNum = "10") | |||
| @io.swagger.annotations.ApiModelProperty(value = "账单状态EnumBillStatus", name = "status") | |||
| public Integer status; | |||
| @TableField(exist = false) | |||
| @@ -13,7 +13,8 @@ public enum EnumBillAllType { | |||
| PROPERTY_DEPOSIT(21,"物业押金",6L,true), | |||
| DAILY(3, "日常(水电空调)费",null,false), | |||
| OTHER(4, "其他费用",null,false), | |||
| OTHER_DEPOSIT(5, "其他押金",null,true) | |||
| OTHER_DEPOSIT(5, "其他押金",null,true), | |||
| ADVANCE(6,"预收",null,true) | |||
| ; | |||
| public static EnumBillAllType getEnum(Integer code) { | |||
| @@ -59,7 +60,7 @@ public enum EnumBillAllType { | |||
| return ret; | |||
| } | |||
| //可以自定义科目的非能源类型 | |||
| //财务可以自定义的除了能源和冲抵的科目 | |||
| public static EnumBillAllType[] getOperateNotEnergyTypes() { | |||
| EnumBillAllType[] ret = new EnumBillAllType[] {RENT_DEPOSIT,PROPERTY,OTHER,OTHER_DEPOSIT}; | |||
| return ret; | |||
| @@ -13,7 +13,8 @@ public enum EnumBillStatus { | |||
| PAID(3, "已结清"), | |||
| INVALID(6, "失效"), | |||
| BAD(7, "坏账"), | |||
| STOP_TO_SETTLE(8,"退租待结算") | |||
| STOP_TO_SETTLE(8,"退租待结算"), | |||
| SET_OFF(9,"预收待抵扣") | |||
| ; | |||
| public static EnumBillStatus getEnum(Integer code) { | |||
| @@ -9,6 +9,7 @@ public enum EnumFinanceReceiveStatus { | |||
| NORMAL(1,"正常"), | |||
| INVALID(2,"作废"), | |||
| SETOFF(3, "红冲"), | |||
| FINISH(4,"已审核过账") | |||
| ; | |||
| public static EnumFinanceReceiveStatus getEnum(Integer code) { | |||
| @@ -0,0 +1,22 @@ | |||
| package com.iformall.mapper; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.WxBillAdvance; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import java.util.List; | |||
| /** | |||
| */ | |||
| public interface WxBillAdvanceMapper extends CommonMapper<WxBillAdvance, Long> { | |||
| List<WxBillAdvance> queryBillList(WxBillAdvance record); | |||
| List<WxBillAdvance> findList(WxBillAdvance wxBillRent); | |||
| List<Long> getMerchantIdList(WxBillAdvance wxBillRent); | |||
| WxBillAdvance selectById(@Param("id")Long id,@Param("tenantId")String tenantId); | |||
| void deleteById(@Param("id")Long id,@Param("tenantId")String tenantId); | |||
| } | |||
| @@ -1,21 +0,0 @@ | |||
| package com.iformall.mapper; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.WxFinanceAdvance; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import java.util.List; | |||
| /** | |||
| */ | |||
| public interface WxFinanceAdvanceMapper extends CommonMapper<WxFinanceAdvance, Long> { | |||
| List<WxFinanceAdvance> findList(WxFinanceAdvance wxBillRent); | |||
| WxFinanceAdvance selectById(@Param("id")Long id,@Param("tenantId")String tenantId); | |||
| void setIsDel(@Param("id")Long id,@Param("tenantId")String tenantId,@Param("isDel")Integer isDel); | |||
| List<WxFinanceAdvance> getMerchantAdvanceGroupSumList(WxFinanceAdvance wxBillRent); | |||
| } | |||
| @@ -0,0 +1,64 @@ | |||
| package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.dto.WxBillPayDTO; | |||
| import com.iformall.domain.dto.WxBillReceiveUpdateDTO; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.WxBillAdvance; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.domain.po.WxMerchantBUser; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import java.util.List; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| /** | |||
| * @author gongbiao | |||
| */ | |||
| public interface WxBillAdvanceService { | |||
| /** | |||
| * 根据实体查询列表 | |||
| * @param record | |||
| * @param pageIndex | |||
| * @param pageSize | |||
| * @return | |||
| */ | |||
| PageInfo<WxBillAdvance> listAsPage(WxBillAdvance record, Integer pageIndex, Integer pageSize); | |||
| /** | |||
| * 根据Id获得实体 | |||
| * | |||
| * @param id | |||
| * @return | |||
| */ | |||
| WxBillAdvance getById(TenantEntity tenantEntity,Long id); | |||
| /** | |||
| * 保存或更新实体 | |||
| * | |||
| * @param record | |||
| * @param user | |||
| */ | |||
| ResultData saveOrUpdate(WxBillAdvance record, MallUserInfo user); | |||
| /** | |||
| * 根据Id删除实体 | |||
| * | |||
| * @param id | |||
| */ | |||
| void deleteById(TenantEntity tenantEntity,Long id); | |||
| List<Long> getMerchantIds(WxBillAdvance wxBillRent); | |||
| void updateReceivePay(WxBillReceiveUpdateDTO dto,MallUserInfo user,boolean forcePaid); | |||
| void updatePay(WxBillPayDTO dto,MallUserInfo user); | |||
| void updatePayByMerchant(WxBillPayDTO dto,WxMerchantBUser user,boolean isOnline); | |||
| void bad(WxBillPayDTO dto,MallUserInfo user); | |||
| // void rentContractStop(WxRentContract rentContract,MallUserInfo user); | |||
| // void completeBill(EnumBillStatus status,WxMerchant wxMerchant,MallUserInfo user); | |||
| } | |||
| @@ -6,7 +6,6 @@ import com.github.pagehelper.PageInfo; | |||
| import com.iformall.domain.dto.FinanceSetOffDTO; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.WxBillPayWay; | |||
| import com.iformall.domain.po.WxFinanceAdvance; | |||
| import com.iformall.domain.po.WxFinanceAdvanceType; | |||
| import com.iformall.domain.po.WxFinanceReceive; | |||
| import com.iformall.domain.po.WxFinanceReceiveBill; | |||
| @@ -32,11 +31,6 @@ public interface WxFinanceService { | |||
| Map<Long,WxFinanceAdvanceType> getAdvanceTypeMap(WxFinanceAdvanceType record); | |||
| //预收款 | |||
| PageInfo<WxFinanceAdvance> advanceListAsPage(WxFinanceAdvance record, Integer pageIndex, Integer pageSize); | |||
| WxFinanceAdvance getAdvanceById(TenantEntity tenantEntity,Long id); | |||
| void saveOrUpdateAdvance(WxFinanceAdvance record,MallUserInfo user); | |||
| void updateAdvanceIsDel(WxFinanceAdvance record); | |||
| List<WxFinanceAdvance> getMerchantAdvanceGroupSumList(WxFinanceAdvance record); | |||
| List<Map> getSetOffList(FinanceSetOffDTO dto); | |||
| WxBillBaseEntity setOff(FinanceSetOffDTO dto,MallUserInfo user); | |||
| List<WxBillBaseEntity> getBills(TenantEntity tenantEntity,List<WxBillBaseEntity> bills); | |||
| @@ -46,4 +40,6 @@ public interface WxFinanceService { | |||
| List<WxBillBaseEntity> createReceive(WxFinanceReceive record,MallUserInfo user); | |||
| void saveOrUpdateReceive(WxFinanceReceive record,MallUserInfo user); | |||
| void saveOrUpdateReceiveBill(WxFinanceReceiveBill record); | |||
| WxFinanceReceive getReceiveById(TenantEntity tenantEntity,Long id); | |||
| void invalidReceive(WxFinanceReceive record,MallUserInfo user); | |||
| } | |||
| @@ -23,6 +23,7 @@ import com.iformall.domain.dto.WxBillPayDTO; | |||
| import com.iformall.domain.dto.WxBillReceiveUpdateDTO; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.WxBillAction; | |||
| import com.iformall.domain.po.WxBillAdvance; | |||
| import com.iformall.domain.po.WxBillDaily; | |||
| import com.iformall.domain.po.WxBillDeposit; | |||
| import com.iformall.domain.po.WxBillOther; | |||
| @@ -50,6 +51,7 @@ import com.iformall.enums.EnumRentContractManageFeeType; | |||
| import com.iformall.enums.EnumSystemUserType; | |||
| import com.iformall.enums.EnumYesOrNo; | |||
| import com.iformall.service.WxBillActionService; | |||
| import com.iformall.service.WxBillAdvanceService; | |||
| import com.iformall.service.WxBillDailyService; | |||
| import com.iformall.service.WxBillDepositService; | |||
| import com.iformall.service.WxBillOtherDepositService; | |||
| @@ -96,6 +98,9 @@ public class WxBillAllHelper { | |||
| @Autowired | |||
| private WxBillOtherDepositService wxBillOtherDepositService; | |||
| @Autowired | |||
| private WxBillAdvanceService wxBillAdvanceService; | |||
| @Autowired | |||
| private WxShopService wxShopService; | |||
| @@ -561,6 +566,11 @@ public class WxBillAllHelper { | |||
| updateQueryParm(wxMerchant, wxBillOtherDeposit,wxMerchant.getStarttime(),wxMerchant.getEndtime()); | |||
| wxBillOtherDeposit.setSortColumns("starttime asc"); | |||
| return wxBillOtherDepositService.listAsPage(wxBillOtherDeposit, pageNum, pageSize); | |||
| }else if (billType == EnumBillAllType.ADVANCE) { | |||
| WxBillAdvance wxBillAdvance = new WxBillAdvance(); | |||
| updateQueryParm(wxMerchant, wxBillAdvance,wxMerchant.getStarttime(),wxMerchant.getEndtime()); | |||
| wxBillAdvance.setSortColumns("starttime asc"); | |||
| return wxBillAdvanceService.listAsPage(wxBillAdvance, pageNum, pageSize); | |||
| } | |||
| return null; | |||
| } | |||
| @@ -676,6 +686,8 @@ public class WxBillAllHelper { | |||
| return wxBillOtherService.getById(tenantEntity, id); | |||
| }else if (billType == EnumBillAllType.OTHER_DEPOSIT) { | |||
| return wxBillOtherDepositService.getById(tenantEntity, id); | |||
| }else if (billType == EnumBillAllType.ADVANCE) { | |||
| return wxBillAdvanceService.getById(tenantEntity, id); | |||
| } | |||
| return null; | |||
| } | |||
| @@ -919,6 +931,8 @@ public class WxBillAllHelper { | |||
| wxBillOtherService.updateReceivePay(dto, user, forcePaid); | |||
| }else if (dto.getBillTypeValue().intValue() == EnumBillAllType.OTHER_DEPOSIT.getCode().intValue()) { | |||
| wxBillOtherDepositService.updateReceivePay(dto, user, forcePaid); | |||
| }else if (dto.getBillTypeValue().intValue() == EnumBillAllType.ADVANCE.getCode().intValue()) { | |||
| wxBillAdvanceService.updateReceivePay(dto, user, forcePaid); | |||
| } | |||
| } | |||
| @@ -964,6 +978,8 @@ public class WxBillAllHelper { | |||
| wxBillOtherService.updatePay(dto, user); | |||
| }else if (dto.getBillTypeValue().intValue() == EnumBillAllType.OTHER_DEPOSIT.getCode().intValue()) { | |||
| wxBillOtherDepositService.updatePay(dto, user); | |||
| }else if (dto.getBillTypeValue().intValue() == EnumBillAllType.ADVANCE.getCode().intValue()) { | |||
| wxBillAdvanceService.updatePay(dto, user); | |||
| } | |||
| } | |||
| @@ -986,6 +1002,8 @@ public class WxBillAllHelper { | |||
| wxBillOtherService.updatePayByMerchant(dto, user,isOnline); | |||
| }else if (dto.getBillTypeValue().intValue() == EnumBillAllType.OTHER_DEPOSIT.getCode().intValue()) { | |||
| wxBillOtherDepositService.updatePayByMerchant(dto, user,isOnline); | |||
| }else if (dto.getBillTypeValue().intValue() == EnumBillAllType.ADVANCE.getCode().intValue()) { | |||
| wxBillAdvanceService.updatePayByMerchant(dto, user,isOnline); | |||
| } | |||
| } | |||
| @@ -1008,6 +1026,8 @@ public class WxBillAllHelper { | |||
| return wxBillOtherService.getById(wxMerchant,billId); | |||
| }else if (billType == EnumBillAllType.OTHER_DEPOSIT) { | |||
| return wxBillOtherDepositService.getById(wxMerchant,billId); | |||
| }else if (billType == EnumBillAllType.ADVANCE) { | |||
| return wxBillAdvanceService.getById(wxMerchant,billId); | |||
| } | |||
| return null; | |||
| } | |||
| @@ -1041,6 +1061,8 @@ public class WxBillAllHelper { | |||
| wxBillOtherService.bad(dto, user); | |||
| }else if (dto.getBillTypeValue().intValue() == EnumBillAllType.OTHER_DEPOSIT.getCode().intValue()) { | |||
| wxBillOtherDepositService.bad(dto, user); | |||
| }else if (dto.getBillTypeValue().intValue() == EnumBillAllType.ADVANCE.getCode().intValue()) { | |||
| wxBillAdvanceService.bad(dto, user); | |||
| } | |||
| } | |||
| @@ -1053,6 +1075,7 @@ public class WxBillAllHelper { | |||
| wxBillDailyService.completeBill(status,wxMerchant, user); | |||
| wxBillOtherService.completeBill(status,wxMerchant, user); | |||
| wxBillOtherDepositService.completeBill(status,wxMerchant, user); | |||
| //wxBillAdvanceService.completeBill(status,wxMerchant, user); | |||
| } | |||
| /** | |||
| @@ -1218,6 +1241,7 @@ public class WxBillAllHelper { | |||
| wxBillDailyService.stopMerchantBills(wxMerchant, user); | |||
| wxBillOtherService.stopMerchantBills(wxMerchant, user); | |||
| wxBillOtherDepositService.stopMerchantBills(wxMerchant, user); | |||
| //wxBillAdvanceService.stopMerchantBills(wxMerchant, user); | |||
| } | |||
| } | |||
| @@ -0,0 +1,415 @@ | |||
| package com.iformall.service.impl; | |||
| import com.alibaba.fastjson.JSONObject; | |||
| import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.IdWorker; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.dto.WxBillPayDTO; | |||
| import com.iformall.domain.dto.WxBillReceiveUpdateDTO; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.WxBillAction; | |||
| import com.iformall.domain.po.WxBillAdvance; | |||
| import com.iformall.domain.po.WxBillDeposit; | |||
| import com.iformall.domain.po.WxBillPayWay; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.domain.po.WxMerchantBUser; | |||
| import com.iformall.domain.po.WxPayAccountBill; | |||
| import com.iformall.domain.po.WxRentContract; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.vo.RatioVo; | |||
| import com.iformall.enums.EnumBillAction; | |||
| import com.iformall.enums.EnumBillStatus; | |||
| import com.iformall.enums.EnumBusRatioTime; | |||
| import com.iformall.enums.EnumDelStatus; | |||
| import com.iformall.enums.EnumGetRatioFrom; | |||
| import com.iformall.enums.EnumMissTimeType; | |||
| import com.iformall.enums.EnumRentContractType; | |||
| import com.iformall.enums.EnumRentShopType; | |||
| import com.iformall.enums.EnumYesOrNo; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.mapper.WxBillActionMapper; | |||
| import com.iformall.mapper.WxBillAdvanceMapper; | |||
| import com.iformall.mapper.WxBillDepositMapper; | |||
| import com.iformall.mapper.WxBillRentManageMapper; | |||
| import com.iformall.mapper.WxBillRentMapper; | |||
| import com.iformall.mapper.WxRentContractMapper; | |||
| import com.iformall.service.ExcelService; | |||
| import com.iformall.service.WxBillActionService; | |||
| import com.iformall.service.WxBillAdvanceService; | |||
| import com.iformall.service.WxBillDepositService; | |||
| import com.iformall.service.WxBillRentService; | |||
| import com.iformall.service.WxFinanceService; | |||
| import com.iformall.service.WxMerchantService; | |||
| import com.iformall.service.WxMerchantTradeDailyService; | |||
| import com.iformall.service.WxPayAccountBillService; | |||
| import com.iformall.service.WxShopService; | |||
| import com.iformall.service.helper.WxBillAllHelper; | |||
| import com.iformall.utils.Constant; | |||
| import com.iformall.utils.DateUtils; | |||
| import org.apache.commons.collections.CollectionUtils; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.joda.time.DateTime; | |||
| import org.joda.time.Months; | |||
| import org.joda.time.format.DateTimeFormat; | |||
| import org.joda.time.format.DateTimeFormatter; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.context.annotation.Lazy; | |||
| import org.springframework.stereotype.Service; | |||
| import org.springframework.transaction.annotation.Transactional; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| import java.math.BigDecimal; | |||
| import java.math.RoundingMode; | |||
| import java.text.SimpleDateFormat; | |||
| import java.util.ArrayList; | |||
| import java.util.Calendar; | |||
| import java.util.Date; | |||
| import java.util.HashMap; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| import java.util.Set; | |||
| import java.util.stream.Collectors; | |||
| /** | |||
| * @author gongbiao | |||
| */ | |||
| @Service | |||
| public class WxBillAdvanceServiceImpl extends WxBillBaseService implements WxBillAdvanceService { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| WxBillAdvanceMapper wxBillAdvanceMapper; | |||
| @Autowired | |||
| WxBillActionService wxBillActionService; | |||
| @Autowired | |||
| ExcelService excelService; | |||
| @Autowired | |||
| WxPayAccountBillService wxPayAccountBillService; | |||
| @Lazy | |||
| @Autowired | |||
| WxMerchantService wxMerchantService; | |||
| @Lazy | |||
| @Autowired | |||
| WxShopService wxShopService; | |||
| @Lazy | |||
| @Autowired | |||
| WxBillAllHelper wxBillAllHelper; | |||
| @Lazy | |||
| @Autowired | |||
| WxFinanceService wxFinanceService; | |||
| @Override | |||
| public PageInfo<WxBillAdvance> listAsPage(WxBillAdvance record, Integer pageIndex, Integer pageSize) { | |||
| return getBillRentPropertyList(pageIndex,pageSize,record); | |||
| } | |||
| private PageInfo<WxBillAdvance> getBillRentPropertyList(Integer pageIndex, Integer pageSize,WxBillAdvance wxBillRent) { | |||
| updateQueryParam(wxBillRent); | |||
| PageInfo<WxBillAdvance> billRentList = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxBillAdvanceMapper.queryBillList(wxBillRent)); | |||
| if (null == billRentList) { | |||
| return null; | |||
| } | |||
| if (null != billRentList.getList()) { | |||
| WxMerchant wq = new WxMerchant(); | |||
| wq.updateTenantInfo(wxBillRent); | |||
| Map<Long,WxMerchant> merchantMap = wxMerchantService.findMerchantMap(wq); | |||
| Map<Long, String> shopNumberMap = wxShopService.getMerchantShopNumberMap(wq, null, null); | |||
| for (int i = 0 ; i < billRentList.getList().size() ; i ++) { | |||
| WxBillAdvance e = billRentList.getList().get(i); | |||
| if (null != e.getMerchantId() && null != merchantMap) { | |||
| WxMerchant m = merchantMap.get(e.getMerchantId()); | |||
| if (null != m) { | |||
| e.setMerchantName(m.getName()); | |||
| } | |||
| String shopNumber = shopNumberMap.get(e.getMerchantId()); | |||
| e.setShopNumber(shopNumber); | |||
| } | |||
| } | |||
| } | |||
| return billRentList; | |||
| } | |||
| private void updateQueryParam(WxBillAdvance wxBillRent) { | |||
| if (null != wxBillRent.getFloorForRule() || null != wxBillRent.getFloor() || null != wxBillRent.getBuilding()) { | |||
| List<Long> merchantIds = wxMerchantService.getFloorBuildMerchantIds(wxBillRent, wxBillRent.getFloorForRule(), wxBillRent.getBuilding(), wxBillRent.getFloor(), 0, 0); | |||
| if (null != merchantIds) { | |||
| wxBillRent.setMerchantIdList(merchantIds); | |||
| }else { | |||
| wxBillRent.setId(-1L); | |||
| } | |||
| } | |||
| if (StringUtils.isNotBlank(wxBillRent.getMerchantName())) { | |||
| WxMerchant mq = new WxMerchant(); | |||
| mq.updateTenantInfo(wxBillRent); | |||
| mq.setName(StringUtils.trimToNull(wxBillRent.getMerchantName())); | |||
| List<Long> mids = wxMerchantService.findIdList(mq); | |||
| if (null != mids && mids.size() > 0 ) { | |||
| if (null != wxBillRent.getMerchantIdList()) { | |||
| List<Long> _mids = (List<Long>) CollectionUtils.intersection(mids, wxBillRent.getMerchantIdList()); | |||
| if (null == _mids || _mids.size() <= 0) { | |||
| wxBillRent.setId(-1L); | |||
| }else { | |||
| wxBillRent.setMerchantIdList(_mids); | |||
| } | |||
| }else { | |||
| wxBillRent.setMerchantIdList(mids); | |||
| } | |||
| }else { | |||
| wxBillRent.setId(-1L); | |||
| } | |||
| } | |||
| } | |||
| @Override | |||
| public WxBillAdvance getById(TenantEntity tenantEntity,Long id) { | |||
| WxBillAdvance record = new WxBillAdvance(); | |||
| record.setId(id); | |||
| record.updateTenantInfo(tenantEntity); | |||
| PageInfo<WxBillAdvance> rp = getBillRentPropertyList(1,1,record); | |||
| WxBillAdvance rent = rp.getList().get(0); | |||
| return rent; | |||
| } | |||
| @Override | |||
| public ResultData saveOrUpdate(WxBillAdvance record, MallUserInfo user) { | |||
| //String receivepay = StringUtils.isBlank(record.getRealReceivePay()) ? "0" : record.getRealReceivePay(); | |||
| String receivepay = StringUtils.isBlank(record.getReceivePay()) ? "0" : record.getReceivePay(); | |||
| String pay = StringUtils.isBlank(record.getPay()) ? "0" : record.getPay(); | |||
| if(new BigDecimal(pay).compareTo(new BigDecimal(receivepay)) > 0 ){ | |||
| return new ResultData(ErrorCode.BILL_PAY_ERROR.getCode(), "实收金额不能大于实际应收总金额"); | |||
| } | |||
| Date date = new Date(); | |||
| if (record.getId() == null) { | |||
| logger.info("新增租赁账单"); | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| record.setId(idWorker.nextId()); | |||
| record.setCreatetime(date); | |||
| record.setUpdatetime(date); | |||
| record.setUpdateBy(user.getId()); | |||
| record.setUpdateByName(user.getName()); | |||
| record.setCreateBy(user.getId()); | |||
| record.setCreateByName(user.getName()); | |||
| record.updateTenantInfo(user); | |||
| try { | |||
| wxBillAdvanceMapper.insert(record); | |||
| } catch (Exception e) { | |||
| logger.error("保存租赁账单失败,e:" + e.getMessage()); | |||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | |||
| } | |||
| return new ResultData(Result.SUCCESS, "保存租赁账单成功"); | |||
| } else { | |||
| return new ResultData(); | |||
| } | |||
| } | |||
| @Override | |||
| public void deleteById(TenantEntity tenantEntity,Long id) { | |||
| wxBillAdvanceMapper.deleteById(id,tenantEntity.getTenantId()); | |||
| } | |||
| @Override | |||
| public List<Long> getMerchantIds(WxBillAdvance wxBillRent) { | |||
| updateQueryParam(wxBillRent); | |||
| return wxBillAdvanceMapper.getMerchantIdList(wxBillRent); | |||
| } | |||
| @Override | |||
| public void updateReceivePay(WxBillReceiveUpdateDTO dto, MallUserInfo user, boolean forcePaid) { | |||
| WxBillAdvance dbBill = wxBillAdvanceMapper.selectById(dto.getId(),dto.getTenantId()); | |||
| WxBillAdvance wxBillRent = new WxBillAdvance(); | |||
| wxBillRent.setId(dto.getId()); | |||
| wxBillRent.updateTenantInfo(dto); | |||
| wxBillRent.setUpdatetime(new Date()); | |||
| wxBillRent.setUpdateBy(user.getId()); | |||
| wxBillRent.setUpdateByName(user.getName()); | |||
| if (forcePaid) { | |||
| wxBillRent.setReceivePay(dbBill.getPay()); | |||
| wxBillRent.setStatus(EnumBillStatus.PAID.getCode()); | |||
| wxBillAdvanceMapper.updateById(wxBillRent); | |||
| String remark = StringUtils.trimToEmpty(dto.getRemark())+ ";【系统】账单被强制为结清。"; | |||
| this.addBillAction(EnumBillAction.SETOFF, dto.getBillTypeValue(),dto.getId(), dbBill.getPay(), dbBill.getPay(),null,null,remark,null,null, user); | |||
| }else { | |||
| // if (StringUtils.isNotBlank(dto.getOldLatePrice()) && StringUtils.isNotBlank(dto.getNewLatePrice())) { | |||
| // wxBillRent.setLatePayPrice(dto.getNewLatePrice()); | |||
| // wxBillRentMapper.updateById(wxBillRent); | |||
| // this.addBillAction(EnumBillAction.UPDATE_LATE_PAY_MONEY, dto.getBillTypeValue(), dto.getId(), | |||
| // dto.getOldLatePrice(), dto.getNewLatePrice(),null,null,dto.getRemark(),null,null, user); | |||
| // }else if (StringUtils.isNotBlank(dto.getServiceChargePayBefore()) && StringUtils.isNotBlank(dto.getServiceChargePayUpdate())) { | |||
| // wxBillRent.setServiceChargePay(dto.getServiceChargePayUpdate()); | |||
| // wxBillRentMapper.updateById(wxBillRent); | |||
| // this.addBillAction(EnumBillAction.UPDATE_SERVICE_MONEY, dto.getBillTypeValue(), dto.getId(), | |||
| // dto.getServiceChargePayBefore(), dto.getServiceChargePayUpdate(),null,null,dto.getRemark(),null,null, user); | |||
| // }else { | |||
| //租赁账单更新 | |||
| wxBillRent.setReceivePay(dto.getNewPrice()); | |||
| Date payDate = null; | |||
| WxBillPayWay payWay = null; | |||
| String remark = StringUtils.trimToEmpty(dto.getRemark()); | |||
| if (new BigDecimal(dto.getNewPrice()).compareTo(new BigDecimal(dbBill.getPay())) <= 0) { | |||
| wxBillRent.setStatus(EnumBillStatus.PAID.getCode()); | |||
| payDate = new Date(); | |||
| payWay = wxFinanceService.getPayWayById(dto, Constant.bill_pay_way_system); | |||
| remark = remark + ";【系统】账单预收金额调整至小于等于已冲抵金额,自动归结为结清。"; | |||
| } | |||
| wxBillAdvanceMapper.updateById(wxBillRent); | |||
| //账单日志 | |||
| this.addBillAction(EnumBillAction.SETOFF, dto.getBillTypeValue(),dto.getId(), | |||
| dto.getOldPrice(), dto.getNewPrice(),payDate,payWay,remark,null,null, user); | |||
| // } | |||
| } | |||
| } | |||
| @Override | |||
| public void updatePay(WxBillPayDTO dto, MallUserInfo user) { | |||
| WxBillAdvance wxBillRent = updateBillPay(dto); | |||
| EnumBillAction action = EnumBillAction.OFFLINE_PAY; | |||
| if (dto.isSetOff()) { | |||
| action = EnumBillAction.SETOFF; | |||
| } | |||
| this.addBillAction(action, dto.getBillTypeValue(),dto.getId(), | |||
| dto.getAddpay(), dto.getAddpay(),wxBillRent.getPayDate(),dto.getPayWayObject(),dto.getRemark(),null,null, user); | |||
| } | |||
| private WxBillAdvance updateBillPay(WxBillPayDTO dto) { | |||
| WxBillAdvance dbBill = wxBillAdvanceMapper.selectById(dto.getId(),dto.getTenantId()); | |||
| WxBillAdvance wxBillRent = new WxBillAdvance(); | |||
| wxBillRent.setId(dto.getId()); | |||
| wxBillRent.updateTenantInfo(dto); | |||
| wxBillRent.setUpdatetime(new Date()); | |||
| BigDecimal opay = new BigDecimal(0); | |||
| if (StringUtils.isNotBlank(dbBill.getPay())) { | |||
| opay = new BigDecimal(dbBill.getPay()); | |||
| } | |||
| opay = opay.add(new BigDecimal(dto.getAddpay())); | |||
| wxBillRent.setPay(opay.toPlainString()); | |||
| if (opay.compareTo(new BigDecimal(dbBill.getReceivePay())) >= 0 ) { | |||
| wxBillRent.setStatus(EnumBillStatus.PAID.getCode()); | |||
| dto.setRemark("【系统】账单冲抵金额已大于等于预收金额,自动归结为结清。"); | |||
| } | |||
| wxBillRent.setPayDate(new Date()); | |||
| wxBillRent.setPayWay(dto.getPayWayObject().getId()); | |||
| wxBillAdvanceMapper.updateById(wxBillRent); | |||
| return wxBillRent; | |||
| } | |||
| @Override | |||
| public void updatePayByMerchant(WxBillPayDTO dto, WxMerchantBUser user,boolean isOnline) { | |||
| WxBillAdvance wxBillRent = updateBillPay(dto); | |||
| EnumBillAction action = null; | |||
| if (isOnline) { | |||
| action = EnumBillAction.SELF_SERVICE_PAY; | |||
| }else { | |||
| action = EnumBillAction.OFFLINE_PAY; | |||
| } | |||
| this.addBillAction(action, dto.getBillTypeValue(),dto.getId(), | |||
| dto.getAddpay(), dto.getAddpay(),wxBillRent.getPayDate(),dto.getPayWayObject(),dto.getRemark(),null,null, user); | |||
| } | |||
| @Override | |||
| public void bad(WxBillPayDTO dto, MallUserInfo user) { | |||
| WxBillAdvance dbBill = wxBillAdvanceMapper.selectById(dto.getId(),dto.getTenantId()); | |||
| WxBillAdvance wxBillRent = new WxBillAdvance(); | |||
| wxBillRent.setId(dto.getId()); | |||
| wxBillRent.updateTenantInfo(dto); | |||
| wxBillRent.setUpdatetime(new Date()); | |||
| wxBillRent.setUpdateBy(user.getId()); | |||
| wxBillRent.setUpdateByName(user.getName()); | |||
| wxBillRent.setStatus(EnumBillStatus.BAD.getCode()); | |||
| wxBillAdvanceMapper.updateById(wxBillRent); | |||
| String badMoney = dbBill.getOwe(); | |||
| this.addBillAction(EnumBillAction.BAD, dto.getBillTypeValue(),dto.getId(), | |||
| badMoney, badMoney,null,null,dto.getRemark(),null,null, user); | |||
| } | |||
| // @Override | |||
| // public void rentContractStop(WxRentContract rentContract,MallUserInfo user) { | |||
| // //删除草稿状态的账单 | |||
| // WxBillRent brDel = new WxBillRent(); | |||
| // brDel.setRentContractId(rentContract.getId()); | |||
| // brDel.updateTenantInfo(rentContract); | |||
| // brDel.setIsPreview(EnumYesOrNo.YES.getCode()); | |||
| // wxBillRentMapper.deletePreviewBill(brDel); | |||
| // | |||
| // WxBillRent br = new WxBillRent(); | |||
| // br.setRentContractId(rentContract.getId()); | |||
| // br.updateTenantInfo(rentContract); | |||
| // br.setIsPreview(EnumYesOrNo.NO.getCode()); | |||
| // List<WxBillRent> brList = wxBillRentMapper.findList(br); | |||
| // List<WxBillRent> realRentList = new ArrayList<WxBillRent>(); | |||
| // List<WxBillAction> actionList = new ArrayList<WxBillAction>(); | |||
| // if (null != brList && brList.size() > 0 ) { | |||
| // for (int i = 0 ; i < brList.size() ; i ++ ) { | |||
| // WxBillRent brent = brList.get(i); | |||
| // WxBillAction action = new WxBillAction(); | |||
| // boolean isUpdate = wxBillAllHelper.billEndCalcute(rentContract.getDecimalSize(),rentContract.getEndContractTime(), brent, action, false); | |||
| // if (isUpdate) { | |||
| // realRentList.add(brent); | |||
| // actionList.add(action); | |||
| // } | |||
| // } | |||
| // } | |||
| // | |||
| // for (int i = 0 ; i < realRentList.size() ; i ++) { | |||
| // WxBillRent rbrent = realRentList.get(i); | |||
| // wxBillRentMapper.updateById(rbrent); | |||
| // } | |||
| // | |||
| // for (int i = 0 ; i < actionList.size() ; i ++) { | |||
| // WxBillAction ba = actionList.get(i); | |||
| // this.addBillAction(ba, user); | |||
| // } | |||
| // } | |||
| // | |||
| // @Override | |||
| // public void completeBill(EnumBillStatus status, WxMerchant wxMerchant, MallUserInfo user) { | |||
| // WxBillRent bill = new WxBillRent(); | |||
| // bill.updateTenantInfo(wxMerchant); | |||
| // bill.setFloorForRule(wxMerchant.getFloorForRule()); | |||
| // bill.setBusinessForRule(wxMerchant.getBusinessForRule()); | |||
| // bill.setBuilding(wxMerchant.getBuilding()); | |||
| // bill.setFloor(wxMerchant.getFloor()); | |||
| // bill.setMerchantId(wxMerchant.getId()); | |||
| // bill.setStatus(status.getCode()); | |||
| // updateQueryParam(bill); | |||
| // PageInfo<WxBillRent> bpage = this.listAsPage(bill, 1, 100); | |||
| // if (null != bpage && null != bpage.getList()) { | |||
| // for (int i = 0 ; i < bpage.getList().size() ; i++ ) { | |||
| // WxBillRent b = bpage.getList().get(i); | |||
| // | |||
| // WxBillRent bu = new WxBillRent(); | |||
| // bu.setId(b.getId()); | |||
| // bu.updateTenantInfo(b); | |||
| // bu.setStatus(EnumBillStatus.INVALID.getCode()); | |||
| // bu.setUpdatetime(new Date()); | |||
| // bu.setUpdateBy(user.getId()); | |||
| // bu.setUpdateByName(user.getName()); | |||
| // wxBillRentMapper.updateById(bu); | |||
| // | |||
| // WxBillAction wxBillAction = new WxBillAction(); | |||
| // wxBillAction.setBillId(b.getId()); | |||
| // wxBillAction.setBillType(b.getBillType()); | |||
| // wxBillAction.setAction(EnumBillAction.STATUS_CHANGE.getCode()); | |||
| // wxBillAction.setDetails(EnumBillAction.STATUS_CHANGE.getDescription(null, null,null,EnumBillStatus.getEnum(b.getStatus()),EnumBillStatus.INVALID)); | |||
| // wxBillAction.setRemark(wxMerchant.getBillCompleteRemark()); | |||
| // this.addBillAction(wxBillAction, user); | |||
| // } | |||
| // } | |||
| // | |||
| // } | |||
| } | |||
| @@ -8,7 +8,10 @@ import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.IdWorker; | |||
| import com.iformall.domain.dto.FinanceSetOffDTO; | |||
| import com.iformall.domain.dto.WxBillPayDTO; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.po.WxBillPayWay; | |||
| import com.iformall.domain.po.WxEnergyFees; | |||
| import com.iformall.domain.po.WxFinanceAdvanceType; | |||
| import com.iformall.domain.po.WxFinanceAdvanceTypeFees; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.po.base.WxBillBaseEntity; | |||
| import com.iformall.enums.EnumBillAllType; | |||
| @@ -16,12 +19,18 @@ import com.iformall.enums.EnumFinanceReceiveStatus; | |||
| import com.iformall.enums.EnumFinanceReceiveType; | |||
| import com.iformall.enums.EnumYesOrNo; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.mapper.*; | |||
| import com.iformall.service.*; | |||
| import com.iformall.mapper.WxBillPayWayMapper; | |||
| import com.iformall.mapper.WxFinanceAdvanceTypeFeesMapper; | |||
| import com.iformall.mapper.WxFinanceAdvanceTypeMapper; | |||
| import com.iformall.mapper.WxFinanceReceiveBillMapper; | |||
| import com.iformall.mapper.WxFinanceReceiveMapper; | |||
| import com.iformall.service.WxEnergyService; | |||
| import com.iformall.service.WxFinanceService; | |||
| import com.iformall.service.WxMerchantService; | |||
| import com.iformall.service.WxShopService; | |||
| import com.iformall.service.helper.WxBillAllHelper; | |||
| import com.iformall.utils.Constant; | |||
| import com.iformall.utils.DateUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| @@ -29,9 +38,11 @@ import org.springframework.context.annotation.Lazy; | |||
| import org.springframework.stereotype.Service; | |||
| import org.springframework.transaction.annotation.Propagation; | |||
| import org.springframework.transaction.annotation.Transactional; | |||
| import java.math.BigDecimal; | |||
| import java.util.*; | |||
| import java.util.Date; | |||
| import java.util.HashMap; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| /** | |||
| */ | |||
| @@ -44,8 +55,6 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||
| @Autowired | |||
| WxFinanceAdvanceTypeMapper wxFinanceAdvanceTypeMapper; | |||
| @Autowired | |||
| WxFinanceAdvanceMapper wxFinanceAdvanceMapper; | |||
| @Autowired | |||
| WxFinanceAdvanceTypeFeesMapper wxFinanceAdvanceTypeFeesMapper; | |||
| @Autowired | |||
| WxFinanceReceiveMapper wxFinanceReceiveMapper; | |||
| @@ -227,101 +236,6 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||
| return null; | |||
| } | |||
| @Override | |||
| public PageInfo<WxFinanceAdvance> advanceListAsPage(WxFinanceAdvance record, Integer pageIndex, Integer pageSize) { | |||
| PageInfo<WxFinanceAdvance> page = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxFinanceAdvanceMapper.findList(record)); | |||
| if (null != page && null != page.getList()) { | |||
| WxFinanceAdvanceType fat = new WxFinanceAdvanceType(); | |||
| fat.updateTenantInfo(record); | |||
| Map<Long, WxFinanceAdvanceType> advanceTypMap = this.getAdvanceTypeMap(fat); | |||
| List<Long> merchantIdList = new ArrayList<Long>(); | |||
| for (int i = 0 ; i < page.getList().size() ; i++) { | |||
| WxFinanceAdvance at = page.getList().get(i); | |||
| if (!merchantIdList.contains(at.getMerchantId())) { | |||
| merchantIdList.add(at.getMerchantId()); | |||
| } | |||
| } | |||
| WxMerchant mq = new WxMerchant(); | |||
| mq.updateTenantInfo(record); | |||
| mq.setIds(merchantIdList); | |||
| Map<Long, WxMerchant> merchantMap = wxMerchantService.findMerchantMap(mq); | |||
| Map<Long, String> shopNumberMap = wxShopService.getMerchantShopNumberMap(record, merchantIdList, null); | |||
| for (int i = 0 ; i < page.getList().size() ; i++) { | |||
| WxFinanceAdvance at = page.getList().get(i); | |||
| if (null != advanceTypMap) { | |||
| WxFinanceAdvanceType wfat = advanceTypMap.get(at.getAdvanceTypeId()); | |||
| if (null != wfat) { | |||
| at.setAdvanceTypeName(wfat.getName()); | |||
| } | |||
| } | |||
| if (null != merchantMap) { | |||
| WxMerchant m = merchantMap.get(at.getMerchantId()); | |||
| if (null != m) { | |||
| at.setMerchantName(m.getName()); | |||
| } | |||
| } | |||
| if (null != shopNumberMap) { | |||
| String sn = shopNumberMap.get(at.getMerchantId()); | |||
| at.setShopNumber(sn); | |||
| } | |||
| } | |||
| } | |||
| return page; | |||
| } | |||
| @Override | |||
| public WxFinanceAdvance getAdvanceById(TenantEntity tenantEntity, Long id) { | |||
| return wxFinanceAdvanceMapper.selectById(id, tenantEntity.getTenantId()); | |||
| } | |||
| @Override | |||
| public void saveOrUpdateAdvance(WxFinanceAdvance record,MallUserInfo user) { | |||
| Date date = new Date(); | |||
| if (null == record.getMerchantId()) { | |||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "请选择商户"); | |||
| } | |||
| if (null == record.getAdvanceTypeId()) { | |||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "请选择商户"); | |||
| } | |||
| if (record.getId() == null) { | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| record.setId(idWorker.nextId()); | |||
| record.setCreateTime(date); | |||
| record.setUpdateTime(date); | |||
| record.setCreateBy(user.getId()); | |||
| record.setCreateByName(user.getName()); | |||
| record.setUpdateBy(user.getId()); | |||
| record.setUpdateByName(user.getName()); | |||
| record.setRemainMoney(record.getMoney()); | |||
| try { | |||
| wxFinanceAdvanceMapper.insert(record); | |||
| } catch (Exception e) { | |||
| logger.error("保存失败,e:" + e.getMessage()); | |||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | |||
| } | |||
| } else { | |||
| record.setUpdateBy(user.getId()); | |||
| record.setUpdateByName(user.getName()); | |||
| record.setUpdateTime(date); | |||
| wxFinanceAdvanceMapper.updateById(record); | |||
| } | |||
| } | |||
| @Override | |||
| public void updateAdvanceIsDel(WxFinanceAdvance record) { | |||
| wxFinanceAdvanceMapper.setIsDel(record.getId(), record.getTenantId(), record.getIsDel()); | |||
| } | |||
| @Override | |||
| public List<WxFinanceAdvance> getMerchantAdvanceGroupSumList(WxFinanceAdvance record) { | |||
| return wxFinanceAdvanceMapper.getMerchantAdvanceGroupSumList(record); | |||
| } | |||
| private List<WxFinanceAdvance> getAdvanceListByFeesId(TenantEntity tenantEntity,Long feesId) { | |||
| WxFinanceAdvanceTypeFees tf = new WxFinanceAdvanceTypeFees(); | |||
| tf.updateTenantInfo(tenantEntity); | |||
| @@ -668,6 +582,16 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||
| return null; | |||
| } | |||
| @Override | |||
| public WxFinanceReceive getReceiveById(TenantEntity tenantEntity, Long id) { | |||
| return wxFinanceReceiveMapper.selectById(id, tenantEntity.getTenantId()); | |||
| } | |||
| @Override | |||
| public void invalidReceive(WxFinanceReceive record, MallUserInfo user) { | |||
| //收款作废,如果是预收款,冲抵的收款单如何处理 | |||
| } | |||
| @@ -0,0 +1,139 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
| <mapper namespace="com.iformall.mapper.WxBillAdvanceMapper"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxBillAdvance"> | |||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | |||
| <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" /> | |||
| <result column="merchant_id" jdbcType="BIGINT" property="merchantId"/> | |||
| <result column="rent_shop_type" jdbcType="INTEGER" property="rentShopType"/> | |||
| <result column="createtime" jdbcType="TIMESTAMP" property="createtime"/> | |||
| <result column="create_by" jdbcType="BIGINT" property="createBy"/> | |||
| <result column="create_by_name" jdbcType="VARCHAR" property="createByName"/> | |||
| <result column="updatetime" jdbcType="TIMESTAMP" property="updatetime"/> | |||
| <result column="update_by" jdbcType="BIGINT" property="updateBy"/> | |||
| <result column="update_by_name" jdbcType="VARCHAR" property="updateByName"/> | |||
| <result column="pay_way" jdbcType="BIGINT" property="payWay"/> | |||
| <result column="receive_pay" jdbcType="VARCHAR" property="receivePay"/> | |||
| <result column="pay" jdbcType="VARCHAR" property="pay"/> | |||
| <result column="pay_date" jdbcType="TIMESTAMP" property="payDate"/> | |||
| <result column="set_off" jdbcType="VARCHAR" property="setOff"/> | |||
| <result column="starttime" jdbcType="TIMESTAMP" property="starttime"/> | |||
| <result column="endtime" jdbcType="X" property="endtime"/> | |||
| <result column="energy_fees_id" jdbcType="BIGINT" property="energyFeesId"/> | |||
| <result column="remark" jdbcType="VARCHAR" property="remark"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`tenant_id`,`parent_tenant_id`,`merchant_id`,`rent_shop_type`,`createtime`,`create_by`,`create_by_name`,`updatetime`, | |||
| `update_by`,`update_by_name`,`pay_way`,`pay`,`receive_pay`,`pay_date`,`set_off`,`starttime`,`endtime`,`energy_fees_id`,`remark` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1=1 | |||
| <if test=" null != id ">and `id` = #{id}</if> | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| <if test=" null != energyFeesId ">and `energy_fees_id` = #{energyFeesId}</if> | |||
| <if test=" null != receivePay ">and `receive_pay` = #{receivePay}</if> | |||
| <if test=" null != pay ">and `pay` = #{pay}</if> | |||
| <if test=" null != payDate ">and `pay_date` = #{payDate}</if> | |||
| <if test=" null != createtime ">and `createtime` = #{createtime}</if> | |||
| <if test=" null != status ">and `status` = #{status}</if> | |||
| <if test=" null != merchantId ">and `merchant_id` = #{merchantId}</if> | |||
| <if test=" null != updatetime ">and `updatetime` = #{updatetime}</if> | |||
| <if test=" null != rentShopType ">and `rent_shop_type` = #{rentShopType}</if> | |||
| <if test=" null != payWay ">and `pay_way` = #{payWay}</if> | |||
| <if test=" null != starttime ">and `starttime` = #{starttime}</if> | |||
| <if test=" null != endtime ">and `endtime` = #{endtime}</if> | |||
| <if test=" null != endtimeBegin "> | |||
| and endtime >= #{endtimeBegin} | |||
| </if> | |||
| <if test=" null != endtimeEnd"> | |||
| and endtime < #{endtimeEnd} | |||
| </if> | |||
| <if test=" null != statusList "> | |||
| and status in | |||
| <foreach collection="statusList" index="index" item="stItem" open="(" separator="," close=")"> | |||
| #{stItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxBillAdvance" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allColumns"/> | |||
| from wx_bill_advance | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| <select id="selectById" parameterType="HashMap" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allColumns"/> | |||
| from wx_bill_advance where id = #{id} and `tenant_id` = #{tenantId} | |||
| </select> | |||
| <sql id="queryBillListCondition"> | |||
| <where> | |||
| 1 = 1 | |||
| <if test=" null != id ">and br.`id` = #{id}</if> | |||
| <if test=" null != tenantId and '' != tenantId"> and br.`tenant_id` = #{tenantId}</if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId">and br.`parent_tenant_id` = #{parentTenantId}</if> | |||
| <if test=" null != rentShopType ">and br.`rent_shop_type` = #{rentShopType}</if> | |||
| <if test=" null != status ">and br.`status` = #{status}</if> | |||
| <if test=" null != merchantId ">and br.`merchant_id` = #{merchantId}</if> | |||
| <if test=" null != energyFeesId ">and br.`energy_fees_id` = #{energyFeesId}</if> | |||
| <if test=" null != payWay ">and br.`pay_way` = #{payWay}</if> | |||
| <if test=" null != starttime">and br.`starttime` <= #{starttime}</if> | |||
| <if test=" null != endtime">and br.`endtime` >= #{endtime}</if> | |||
| <if test=" null != month and '' != month"> | |||
| and date_format(br.starttime,'%Y-%m') <= #{month} and date_format(br.endtime,'%Y-%m') >= #{month} | |||
| </if> | |||
| <if test=" null != merchantIdList "> | |||
| and br.`merchant_id` in | |||
| <foreach collection="merchantIdList" index="index" item="midItem" open="(" separator="," close=")"> | |||
| #{midItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != statusList "> | |||
| and br.`status` in | |||
| <foreach collection="statusList" index="index" item="stItem" open="(" separator="," close=")"> | |||
| #{stItem} | |||
| </foreach> | |||
| </if> | |||
| </where> | |||
| </sql> | |||
| <select id="queryBillRentList" parameterType="com.iformall.domain.po.WxBillAdvance" resultMap="BaseResultMap"> | |||
| br.`id`,br.`tenant_id`,br.`parent_tenant_id`,br.`merchant_id`,br.`rent_shop_type`,br.`createtime`,br.`create_by`,br.`create_by_name`,br.`updatetime`, | |||
| br.`update_by`,br.`update_by_name`,br.`pay_way`,br.`pay`,br.`receive_pay`,br.`pay_date`,br.`set_off`,br.`starttime`,br.`endtime`,br.`energy_fees_id`,br.`remark` | |||
| from wx_bill_advance br | |||
| <include refid="queryBillListCondition"/> | |||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||
| <if test="null != limitStart and null != limitEnd"> | |||
| limit #{limitStart},#{limitEnd} | |||
| </if> | |||
| </select> | |||
| <select id="getMerchantIdList" parameterType="com.iformall.domain.po.WxBillAdvance" resultType="Long"> | |||
| select distinct merchant_id from wx_bill_advance br | |||
| <include refid="queryBillListCondition"/> | |||
| </select> | |||
| <delete id = "deleteById" parameterType="HashMap"> | |||
| delete from wx_bill_advance where id = #{id} and tenant_id = #{tenantId} | |||
| </delete> | |||
| </mapper> | |||
| @@ -1,81 +0,0 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
| <mapper namespace="com.iformall.mapper.WxFinanceAdvanceMapper"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxFinanceAdvance"> | |||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | |||
| <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" /> | |||
| <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> | |||
| <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/> | |||
| <result column="is_del" jdbcType="INTEGER" property="isDel"/> | |||
| <result column="advance_type_id" jdbcType="BIGINT" property="advanceTypeId"/> | |||
| <result column="merchant_id" jdbcType="BIGINT" property="merchantId"/> | |||
| <result column="create_by" jdbcType="BIGINT" property="createBy"/> | |||
| <result column="create_by_name" jdbcType="VARCHAR" property="createByName"/> | |||
| <result column="update_by" jdbcType="BIGINT" property="updateBy"/> | |||
| <result column="update_by_name" jdbcType="VARCHAR" property="updateByName"/> | |||
| <result column="money" jdbcType="VARCHAR" property="money"/> | |||
| <result column="remain_money" jdbcType="VARCHAR" property="remainMoney"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`tenant_id`,`parent_tenant_id`,`create_time`,`update_time`,`is_del`,`advance_type_id`,`merchant_id`,`create_by`, | |||
| `create_by_name`,`update_by`,`update_by_name`,`money`,`remain_money` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1=1 | |||
| <if test=" null != id ">and `id` = #{id}</if> | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| <if test=" null != isDel ">and `is_del` = #{isDel}</if> | |||
| <if test=" null != advanceTypeId ">and `advance_type_id` = #{advanceTypeId}</if> | |||
| <if test=" null != merchantId ">and `merchant_id` = #{merchantId}</if> | |||
| <if test=" null != createByName and '' != createByName ">and create_by_name like concat('%', #{createByName},'%')</if> | |||
| <if test=" null != createBegin ">and `create_time` >= #{createBegin}</if> | |||
| <if test=" null != createEnd ">and `create_time` <= #{createEnd}</if> | |||
| <if test=" null != advanceTypeIdList "> | |||
| and advance_type_id in | |||
| <foreach collection="advanceTypeIdList" index="index" item="atidItem" open="(" separator="," close=")"> | |||
| #{atidItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxFinanceAdvance" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allColumns"/> | |||
| from wx_finance_advance | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| <select id="selectById" parameterType="HashMap" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allColumns"/> | |||
| from wx_finance_advance where id = #{id} and `tenant_id` = #{tenantId} | |||
| </select> | |||
| <update id = "setIsDel" parameterType="HashMap"> | |||
| update wx_finance_advance set is_del = #{isDel} where id = #{id} and `tenant_id` = #{tenantId} | |||
| </update> | |||
| <select id="getMerchantAdvanceGroupSumList" parameterType="com.iformall.domain.po.WxFinanceAdvance" resultMap="BaseResultMap"> | |||
| select advance_type_id,sum(CAST(money AS DECIMAL(20,4))) as money, sum(CAST(remain_money AS DECIMAL(20,4))) as remain_money | |||
| from wx_finance_advance | |||
| <include refid="dynamicWhereConditions"/> | |||
| group by advance_type_id | |||
| </select> | |||
| </mapper> | |||