From 1a075f589cc9f42618e80f158a967ccdd7e6766c Mon Sep 17 00:00:00 2001 From: winter <664946893@qq.com> Date: Sun, 10 Nov 2024 18:38:41 +0800 Subject: [PATCH] fix --- .../controller/basic/WxShopController.java | 31 +++---- .../controller/rent/WxAllBillController.java | 12 +-- .../db/migration/V202411000000001.sql | 4 + .../iformall/controller/WxBillController.java | 4 +- .../com/iformall/domain/po/WxShopUsers.java | 63 ++++++-------- .../iformall/domain/po/WxShopUsersInfo.java | 86 +++++++++++++++++++ .../iformall/domain/po/WxShopUsersShop.java | 62 ------------- .../mapper/WxShopUsersInfoMapper.java | 12 +++ .../iformall/mapper/WxShopUsersMapper.java | 2 + .../mapper/WxShopUsersShopMapper.java | 14 --- .../impl/PrintFinanceReceiveDataHandler.java | 4 +- .../impl/PrintMerchantSettleDataHandler.java | 4 +- .../com/iformall/service/WxShopService.java | 17 ++-- .../service/helper/WxBillAllHelper.java | 10 +-- .../service/impl/WxAllBillServiceImpl.java | 14 +-- .../impl/WxFinancePrintServiceImpl.java | 8 +- .../service/impl/WxFinanceServiceImpl.java | 6 +- .../service/impl/WxMerchantServiceImpl.java | 6 +- .../service/impl/WxShopServiceImpl.java | 56 +++++++----- ...opMapper.xml => WxShopUsersInfoMapper.xml} | 50 +++++------ .../resources/mapper/WxShopUsersMapper.xml | 48 ++++++----- 21 files changed, 275 insertions(+), 238 deletions(-) create mode 100644 mallinkService/src/main/java/com/iformall/domain/po/WxShopUsersInfo.java delete mode 100644 mallinkService/src/main/java/com/iformall/domain/po/WxShopUsersShop.java create mode 100644 mallinkService/src/main/java/com/iformall/mapper/WxShopUsersInfoMapper.java delete mode 100644 mallinkService/src/main/java/com/iformall/mapper/WxShopUsersShopMapper.java rename mallinkService/src/main/resources/mapper/{WxShopUsersShopMapper.xml => WxShopUsersInfoMapper.xml} (53%) diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxShopController.java b/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxShopController.java index 3b4fa8c08..1bf993dcb 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxShopController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxShopController.java @@ -9,8 +9,9 @@ import com.iformall.common.Result; import com.iformall.common.ResultData; import com.iformall.controller.base.BaseController; import com.iformall.domain.po.WxShop; -import com.iformall.domain.po.WxShopUsers; +import com.iformall.domain.po.WxShopUsersInfo; import com.iformall.domain.po.WxShopUsersPerson; +import com.iformall.domain.po.WxShopUsers; import com.iformall.domain.po.WxUserDataRule; import com.iformall.domain.po.base.BaseEntity; import com.iformall.enums.EnumBillAllType; @@ -365,24 +366,24 @@ public class WxShopController extends BaseController { @ApiOperation("查询店铺当前的用户信息") @GetMapping("currentShopUsers") - public ResultData currentShopUsers(@ModelAttribute WxShopUsers wxShopUsers) { - if (null == wxShopUsers){ - wxShopUsers = new WxShopUsers(); + public ResultData currentShopUsers(@ModelAttribute WxShopUsers wxShopUsersShop) { + if (null == wxShopUsersShop){ + wxShopUsersShop = new WxShopUsers(); } - if (null == wxShopUsers.getShopId()) { + if (null == wxShopUsersShop.getShopId()) { return new ResultData(Result.ERROR,"shopId参数不能为空"); } - if (null == wxShopUsers.getType()) { + if (null == wxShopUsersShop.getType()) { return new ResultData(Result.ERROR,"type参数不能为空"); } - wxShopUsers.updateTenantInfo(getTenantInfo()); - wxShopUsers.setStatus(EnumShopUsersStatus.LIVE.getCode()); - return new ResultData(wxShopService.getOneShopUsers(wxShopUsers)); + wxShopUsersShop.updateTenantInfo(getTenantInfo()); + wxShopUsersShop.setStatus(EnumShopUsersStatus.LIVE.getCode()); + return new ResultData(wxShopService.getOneShopUsers(wxShopUsersShop)); } @ApiOperation("更新店铺用户") @PostMapping("saveShopUsers") - public ResultData saveShopUsers(@RequestBody WxShopUsers wxShopUsers) { + public ResultData saveShopUsers(@RequestBody WxShopUsersInfo wxShopUsers) { wxShopUsers.updateTenantInfo(getTenantInfo()); wxShopService.saveOrUpdateShopUsers(wxShopUsers); return new ResultData(); @@ -390,7 +391,7 @@ public class WxShopController extends BaseController { @ApiOperation("更新店铺用户") @PostMapping("changeShopUsers") - public ResultData changeShopUsers(@RequestBody WxShopUsers wxShopUsers) { + public ResultData changeShopUsers(@RequestBody WxShopUsersInfo wxShopUsers) { wxShopUsers.updateTenantInfo(getTenantInfo()); wxShopUsers.setStatus(EnumShopUsersStatus.OLD.getCode()); wxShopService.saveOrUpdateShopUsers(wxShopUsers); @@ -399,7 +400,7 @@ public class WxShopController extends BaseController { @ApiOperation("删除店铺用户") @PostMapping("deleteShopUsers") - public ResultData deleteShopUsers(@RequestBody WxShopUsers wxShopUsers) { + public ResultData deleteShopUsers(@RequestBody WxShopUsersInfo wxShopUsers) { wxShopUsers.updateTenantInfo(getTenantInfo()); wxShopUsers.setStatus(EnumShopUsersStatus.OLD.getCode()); wxShopService.saveOrUpdateShopUsers(wxShopUsers); @@ -411,13 +412,13 @@ public class WxShopController extends BaseController { @ApiImplicitParams({ @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) - public ResultData shopUsersList(@ModelAttribute WxShopUsers wxShopUsers, Integer pageNum, Integer pageSize) { + public ResultData shopUsersList(@ModelAttribute WxShopUsersInfo wxShopUsers, Integer pageNum, Integer pageSize) { if (null == wxShopUsers){ - wxShopUsers = new WxShopUsers(); + wxShopUsers = new WxShopUsersInfo(); } wxShopUsers.updateTenantInfo(getTenantInfo()); wxShopUsers.setSortColumns(BaseEntity.SortField.CreateDate_DESC); - final PageInfo page = wxShopService.shopUsersListAsPage(wxShopUsers, pageNum, pageSize); + final PageInfo page = wxShopService.shopUsersListAsPage(wxShopUsers, pageNum, pageSize); return new ResultData(page); } diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/rent/WxAllBillController.java b/mallinkAdmin/src/main/java/com/iformall/controller/rent/WxAllBillController.java index 1d9363e1a..aa0b44d08 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/rent/WxAllBillController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/rent/WxAllBillController.java @@ -20,7 +20,7 @@ import com.iformall.domain.po.WxEnergyFees; import com.iformall.domain.po.WxMerchant; import com.iformall.domain.po.WxPayAccountBill; import com.iformall.domain.po.WxShop; -import com.iformall.domain.po.WxShopUsers; +import com.iformall.domain.po.WxShopUsersInfo; import com.iformall.domain.po.WxUserDataRule; import com.iformall.domain.po.base.BaseEntity; import com.iformall.domain.vo.WxBillBad; @@ -160,10 +160,10 @@ public class WxAllBillController extends BillBaseController { if (null != shopPage && null != shopPage.getList() && shopPage.getList().size() > 0 ) { Map floorMap = wxMallFloorService.getFloorMap(wxShop); Map buildingMap = wxMallBuildingService.getBuildingMap(wxShop); - WxShopUsers suq = new WxShopUsers(); + WxShopUsersInfo suq = new WxShopUsersInfo(); suq.updateTenantInfo(wxShop); suq.setStatus(EnumShopUsersStatus.LIVE.getCode()); - Map suMap = wxShopSerivce.getShopUserMap(suq); + Map suMap = wxShopSerivce.getShopUserMap(suq); List retList = new ArrayList(); for (int i = 0 ; i < shopPage.getList().size(); i ++) { WxShopBillVo vo = new WxShopBillVo(); @@ -183,7 +183,7 @@ public class WxAllBillController extends BillBaseController { vo.setShopNumber(s.getShopNumber()); if (null != suMap) { - WxShopUsers su = suMap.get(s.getId()); + WxShopUsersInfo su = suMap.get(s.getId()); if (null != su ) { vo.setCusName(su.getName()); vo.setCusPerson(su.getLinkPerson()); @@ -696,7 +696,7 @@ public class WxAllBillController extends BillBaseController { wxShop.setNeedPayNoDays(EnumYesOrNo.YES.getCode()); WxShop shop = wxShopSerivce.getById(wxShop.getId()); - WxShopUsers shopUser = wxShopSerivce.getCurrentShopUser(shop, shop.getId()); + WxShopUsersInfo shopUser = wxShopSerivce.getCurrentShopUser(shop, shop.getId()); List list = billAllHelper.getMerchantBillList(wxShop); if (null != list && list.size() > 0 ) { @@ -746,7 +746,7 @@ public class WxAllBillController extends BillBaseController { } List list = billAllHelper.getMerchantBillList(wxShop); WxShop shop = wxShopSerivce.getById(wxShop.getId()); - WxShopUsers shopUser = wxShopSerivce.getCurrentShopUser(shop, shop.getId()); + WxShopUsersInfo shopUser = wxShopSerivce.getCurrentShopUser(shop, shop.getId()); if (null != list && list.size() > 0 ) { WxEnergyFees fq = new WxEnergyFees(); fq.updateTenantInfo(shop); diff --git a/mallinkAdmin/src/main/resources/db/migration/V202411000000001.sql b/mallinkAdmin/src/main/resources/db/migration/V202411000000001.sql index 912659ed9..0b29528b3 100644 --- a/mallinkAdmin/src/main/resources/db/migration/V202411000000001.sql +++ b/mallinkAdmin/src/main/resources/db/migration/V202411000000001.sql @@ -51,6 +51,9 @@ alter table wx_shop_users change shop_id create_shop_id bigint(20) not null; alter table wx_shop_users drop column status; alter table wx_shop_users drop column begin_date; alter table wx_shop_users drop column end_date; +alter table wx_shop_users drop column type; + +alter table wx_shop_users rename wx_shop_users_info; CREATE TABLE `wx_shop_users_shop` ( `id` bigint(20) NOT NULL COMMENT '主键ID', @@ -63,6 +66,7 @@ CREATE TABLE `wx_shop_users_shop` ( `update_date` datetime NOT NULL COMMENT '更新时间', `status` int(1) NOT NULL DEFAULT '0' COMMENT '状态', `shop_user_id` bigint(20) NOT NULL, + `type` int(1) NOT NULL DEFAULT '2' COMMENT '类型', PRIMARY KEY (`id`), UNIQUE KEY `id_UNIQUE` (`id`), UNIQUE KEY `UNIQUE_S_U` (`tenant_id`,`shop_id`,`shop_user_id`) diff --git a/mallinkBApi/src/main/java/com/iformall/controller/WxBillController.java b/mallinkBApi/src/main/java/com/iformall/controller/WxBillController.java index 3d361e1d5..fcfc1fe43 100644 --- a/mallinkBApi/src/main/java/com/iformall/controller/WxBillController.java +++ b/mallinkBApi/src/main/java/com/iformall/controller/WxBillController.java @@ -16,7 +16,7 @@ import com.iformall.domain.po.WxMerchant; import com.iformall.domain.po.WxMerchantBUser; import com.iformall.domain.po.WxPayAccountBill; import com.iformall.domain.po.WxShop; -import com.iformall.domain.po.WxShopUsers; +import com.iformall.domain.po.WxShopUsersInfo; import com.iformall.domain.po.WxUserDataRule; import com.iformall.domain.po.base.TenantEntity; import com.iformall.domain.vo.WxBillHotNotify; @@ -115,7 +115,7 @@ public class WxBillController extends BaseController { private WxShop getCurrentShopList() { WxRentLoginUserDTO user = this.getRentLoginUser(); - WxShopUsers su = new WxShopUsers(); + WxShopUsersInfo su = new WxShopUsersInfo(); su.updateTenantInfo(user); su.setPhone(user.getPhone()); su.setStatus(EnumShopUsersStatus.LIVE.getCode()); diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxShopUsers.java b/mallinkService/src/main/java/com/iformall/domain/po/WxShopUsers.java index ff03670c7..d6f455983 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxShopUsers.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxShopUsers.java @@ -27,8 +27,11 @@ public class WxShopUsers extends TenantEntity { private Long id; - @io.swagger.annotations.ApiModelProperty(value = "创建的店铺编号", name = "createShopId") - private Long createShopId; + @io.swagger.annotations.ApiModelProperty(value = "店铺编号", name = "shopId") + private Long shopId; + + @io.swagger.annotations.ApiModelProperty(value = "人员编号", name = "shopUserId") + private Long shopUserId; @io.swagger.annotations.ApiModelProperty(value = "类型EnumShopUsersType", name = "type") private Integer type; @@ -41,46 +44,30 @@ public class WxShopUsers extends TenantEntity { return null; } - @io.swagger.annotations.ApiModelProperty(value = "主体类型EnumShopUsersPrincipalType", name = "type") - private Integer principalType; - @TableField(exist = false) - private String principalTypeName; - public String getPrincipalTypeName() { - if (null != principalType) { - return EnumShopUsersPrincipalType.getEnum(principalType).getMessage(); - } - return null; - } - - @io.swagger.annotations.ApiModelProperty(value="名称",name="name") - private String name; - - @io.swagger.annotations.ApiModelProperty(value="手机号",name="phone") - private String phone; - - @io.swagger.annotations.ApiModelProperty(value="法人",name="legalPerson") - private String legalPerson; - - @io.swagger.annotations.ApiModelProperty(value="身份证号码",name="idNumber") - private String idNumber; - - @io.swagger.annotations.ApiModelProperty(value="性别EnumCUserBaseInfoSex",name="sex") - private Integer sex; - @TableField(exist = false) - private String sexName; - public String getSexName() { - if (null != sex) { - return EnumCUserBaseInfoSex.getEnum(sex).getMessage(); - } - return null; - } - - @io.swagger.annotations.ApiModelProperty(value="联系人",name="linkPerson") - private String linkPerson; + @io.swagger.annotations.ApiModelProperty(value="入住日期",name="beginDate") + private Date beginDate; + + @io.swagger.annotations.ApiModelProperty(value="离开日期",name="endDate") + private Date endDate; @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") private Date createDate; @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") private Date updateDate; + + @Excel(name="状态",width = 20,orderNum = "7",replace = {"当前_0","往任_1"}) + @io.swagger.annotations.ApiModelProperty(value="状态(0:当前, 1:往任)EnumShopUsersStatus",name="status") + private Integer status; + @TableField(exist = false) + private String statusName; + public String getStatusName() { + if (null != status) { + return EnumShopUsersStatus.getEnum(status).getMessage(); + } + return null; + } + + @TableField(exist = false) + private List shopIds; } diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxShopUsersInfo.java b/mallinkService/src/main/java/com/iformall/domain/po/WxShopUsersInfo.java new file mode 100644 index 000000000..638344844 --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxShopUsersInfo.java @@ -0,0 +1,86 @@ +package com.iformall.domain.po; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.iformall.common.SortColumn; +import com.iformall.domain.po.base.TenantEntity; +import com.iformall.enums.EnumCUserBaseInfoSex; +import com.iformall.enums.EnumRentShopType; +import com.iformall.enums.EnumShopUsersPrincipalType; +import com.iformall.enums.EnumShopUsersStatus; +import com.iformall.enums.EnumShopUsersType; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +@TableName(value = "wx_shop_users_info") +@Data +@ToString(callSuper = true) +@EqualsAndHashCode(callSuper = true) +public class WxShopUsersInfo extends TenantEntity { + + private Long id; + + @io.swagger.annotations.ApiModelProperty(value = "创建的店铺编号", name = "createShopId") + private Long createShopId; + + @io.swagger.annotations.ApiModelProperty(value = "主体类型EnumShopUsersPrincipalType", name = "type") + private Integer principalType; + @TableField(exist = false) + private String principalTypeName; + public String getPrincipalTypeName() { + if (null != principalType) { + return EnumShopUsersPrincipalType.getEnum(principalType).getMessage(); + } + return null; + } + + @io.swagger.annotations.ApiModelProperty(value="名称",name="name") + private String name; + + @io.swagger.annotations.ApiModelProperty(value="手机号",name="phone") + private String phone; + + @io.swagger.annotations.ApiModelProperty(value="法人",name="legalPerson") + private String legalPerson; + + @io.swagger.annotations.ApiModelProperty(value="身份证号码",name="idNumber") + private String idNumber; + + @io.swagger.annotations.ApiModelProperty(value="性别EnumCUserBaseInfoSex",name="sex") + private Integer sex; + @TableField(exist = false) + private String sexName; + public String getSexName() { + if (null != sex) { + return EnumCUserBaseInfoSex.getEnum(sex).getMessage(); + } + return null; + } + + @io.swagger.annotations.ApiModelProperty(value="联系人",name="linkPerson") + private String linkPerson; + + @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") + private Date createDate; + + @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") + private Date updateDate; + + @TableField(exist = false) + private Date beginDate; + @TableField(exist = false) + private Date endDate; + @TableField(exist = false) + private Integer status; + @TableField(exist = false) + private String statusName; + @TableField(exist = false) + private Long shopUserShopId; +} diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxShopUsersShop.java b/mallinkService/src/main/java/com/iformall/domain/po/WxShopUsersShop.java deleted file mode 100644 index 5fda4f870..000000000 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxShopUsersShop.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.iformall.domain.po; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableName; -import com.iformall.common.SortColumn; -import com.iformall.domain.po.base.TenantEntity; -import com.iformall.enums.EnumCUserBaseInfoSex; -import com.iformall.enums.EnumRentShopType; -import com.iformall.enums.EnumShopUsersPrincipalType; -import com.iformall.enums.EnumShopUsersStatus; -import com.iformall.enums.EnumShopUsersType; - -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.ToString; - -import java.math.BigDecimal; -import java.util.Date; -import java.util.List; - -@TableName(value = "wx_shop_users") -@Data -@ToString(callSuper = true) -@EqualsAndHashCode(callSuper = true) -public class WxShopUsersShop extends TenantEntity { - - private Long id; - - @io.swagger.annotations.ApiModelProperty(value = "店铺编号", name = "shopId") - private Long shopId; - - @io.swagger.annotations.ApiModelProperty(value = "人员编号", name = "shopUserId") - private Long shopUserId; - - @io.swagger.annotations.ApiModelProperty(value="入住日期",name="beginDate") - private Date beginDate; - - @io.swagger.annotations.ApiModelProperty(value="离开日期",name="endDate") - private Date endDate; - - @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") - private Date createDate; - - @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") - private Date updateDate; - - @Excel(name="状态",width = 20,orderNum = "7",replace = {"当前_0","往任_1"}) - @io.swagger.annotations.ApiModelProperty(value="状态(0:当前, 1:往任)EnumShopUsersStatus",name="status") - private Integer status; - @TableField(exist = false) - private String statusName; - public String getStatusName() { - if (null != status) { - return EnumShopUsersStatus.getEnum(status).getMessage(); - } - return null; - } - - @TableField(exist = false) - private List shopIds; -} diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxShopUsersInfoMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxShopUsersInfoMapper.java new file mode 100644 index 000000000..ffb857589 --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/mapper/WxShopUsersInfoMapper.java @@ -0,0 +1,12 @@ +package com.iformall.mapper; + +import com.iformall.common.CommonMapper; +import com.iformall.domain.po.WxShopUsersInfo; +import java.util.List; + +/** + */ +public interface WxShopUsersInfoMapper extends CommonMapper { + + List findList(WxShopUsersInfo wxShop); +} diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxShopUsersMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxShopUsersMapper.java index b6f466b1b..a8901ed92 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxShopUsersMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxShopUsersMapper.java @@ -2,6 +2,7 @@ package com.iformall.mapper; import com.iformall.common.CommonMapper; import com.iformall.domain.po.WxShopUsers; + import java.util.List; /** @@ -9,4 +10,5 @@ import java.util.List; public interface WxShopUsersMapper extends CommonMapper { List findList(WxShopUsers wxShop); + List findShopIdList(WxShopUsers wxShop); } diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxShopUsersShopMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxShopUsersShopMapper.java deleted file mode 100644 index f40905fd7..000000000 --- a/mallinkService/src/main/java/com/iformall/mapper/WxShopUsersShopMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.iformall.mapper; - -import com.iformall.common.CommonMapper; -import com.iformall.domain.po.WxShopUsersShop; - -import java.util.List; - -/** - */ -public interface WxShopUsersShopMapper extends CommonMapper { - - List findList(WxShopUsersShop wxShop); - List findShopIdList(WxShopUsersShop wxShop); -} diff --git a/mallinkService/src/main/java/com/iformall/print/data/impl/PrintFinanceReceiveDataHandler.java b/mallinkService/src/main/java/com/iformall/print/data/impl/PrintFinanceReceiveDataHandler.java index 8203e22fc..2405d65b6 100644 --- a/mallinkService/src/main/java/com/iformall/print/data/impl/PrintFinanceReceiveDataHandler.java +++ b/mallinkService/src/main/java/com/iformall/print/data/impl/PrintFinanceReceiveDataHandler.java @@ -14,7 +14,7 @@ import com.iformall.domain.po.WxEnergyFees; import com.iformall.domain.po.WxFinanceReceive; import com.iformall.domain.po.WxMerchant; import com.iformall.domain.po.WxShop; -import com.iformall.domain.po.WxShopUsers; +import com.iformall.domain.po.WxShopUsersInfo; import com.iformall.enums.EnumYesOrNo; import com.iformall.print.data.PrintDataParser; import com.iformall.utils.DateUtils; @@ -34,7 +34,7 @@ public class PrintFinanceReceiveDataHandler implements PrintDataParser{ public Object getObjectValue(String name, Object o, Object... params) { Map shopMap = (Map) params[0]; Map feesMap = (Map) params[1]; - Map shopUserMap = (Map) params[2]; + Map shopUserMap = (Map) params[2]; WxFinanceReceive receive = (WxFinanceReceive) o; if (name.equals("id")) { return receive.getId(); diff --git a/mallinkService/src/main/java/com/iformall/print/data/impl/PrintMerchantSettleDataHandler.java b/mallinkService/src/main/java/com/iformall/print/data/impl/PrintMerchantSettleDataHandler.java index 159fc8303..f07661b59 100644 --- a/mallinkService/src/main/java/com/iformall/print/data/impl/PrintMerchantSettleDataHandler.java +++ b/mallinkService/src/main/java/com/iformall/print/data/impl/PrintMerchantSettleDataHandler.java @@ -10,7 +10,7 @@ import com.iformall.domain.po.WxEnergyFees; import com.iformall.domain.po.WxFinanceReceive; import com.iformall.domain.po.WxMerchant; import com.iformall.domain.po.WxShop; -import com.iformall.domain.po.WxShopUsers; +import com.iformall.domain.po.WxShopUsersInfo; import com.iformall.domain.vo.WxShopBillVo; import com.iformall.print.data.PrintDataParser; import com.iformall.utils.DateUtils; @@ -22,7 +22,7 @@ public class PrintMerchantSettleDataHandler implements PrintDataParser{ public Object getObjectValue(String name, Object o,Object... params) { Map shopMap = (Map) params[0]; Map feesMap = (Map) params[1]; - Map shopUserMap = (Map) params[2]; + Map shopUserMap = (Map) params[2]; WxShopBillVo receive = (WxShopBillVo) o; //根据科目来查询对应的信息 if (name.equals("maxDate")) { diff --git a/mallinkService/src/main/java/com/iformall/service/WxShopService.java b/mallinkService/src/main/java/com/iformall/service/WxShopService.java index 99c72d9ae..a811be30f 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxShopService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxShopService.java @@ -5,8 +5,9 @@ import com.github.pagehelper.PageInfo; import com.iformall.common.ResultData; import com.iformall.domain.po.WxMerchant; import com.iformall.domain.po.WxShop; -import com.iformall.domain.po.WxShopUsers; +import com.iformall.domain.po.WxShopUsersInfo; import com.iformall.domain.po.WxShopUsersPerson; +import com.iformall.domain.po.WxShopUsers; import com.iformall.domain.po.base.TenantEntity; import com.iformall.domain.vo.WxShopVo; @@ -126,13 +127,13 @@ public interface WxShopService { List getShopNumberList(WxShop wxShop); - WxShopUsers getOneShopUsers(WxShopUsers wxShopUsers); + WxShopUsersInfo getOneShopUsers(WxShopUsers wxShopUsersShop); - void saveOrUpdateShopUsers(WxShopUsers wxShopUsers); + void saveOrUpdateShopUsers(WxShopUsersInfo wxShopUsers); - void deleteShopUsers(WxShopUsers wxShopUsers); + void deleteShopUsers(WxShopUsersInfo wxShopUsers); - PageInfo shopUsersListAsPage(WxShopUsers record,Integer pageIndex,Integer pageSize); + PageInfo shopUsersListAsPage(WxShopUsersInfo record,Integer pageIndex,Integer pageSize); PageInfo shopUsersPersonListAsPage(WxShopUsersPerson record,Integer pageIndex,Integer pageSize); @@ -140,10 +141,10 @@ public interface WxShopService { void deleteShopUsersPerson(WxShopUsersPerson wxShopUsers); - List getUserShopIds(WxShopUsers wxShopUsers); - Map getShopUserMap(WxShopUsers wxShopUsers); + List getUserShopIds(WxShopUsersInfo wxShopUsers); + Map getShopUserMap(WxShopUsersInfo wxShopUsers); - WxShopUsers getCurrentShopUser(TenantEntity tenantEntity,Long shopId); + WxShopUsersInfo getCurrentShopUser(TenantEntity tenantEntity,Long shopId); List getFloorBuildShopIds(TenantEntity tenantEntity,String floorRule,Long building,Long floor,Integer shopDel ,String shopNumber) ; diff --git a/mallinkService/src/main/java/com/iformall/service/helper/WxBillAllHelper.java b/mallinkService/src/main/java/com/iformall/service/helper/WxBillAllHelper.java index bc139baed..6a7a169e8 100644 --- a/mallinkService/src/main/java/com/iformall/service/helper/WxBillAllHelper.java +++ b/mallinkService/src/main/java/com/iformall/service/helper/WxBillAllHelper.java @@ -31,7 +31,7 @@ import com.iformall.domain.po.WxMerchantBUser; import com.iformall.domain.po.WxPropertyContract; import com.iformall.domain.po.WxRentContract; import com.iformall.domain.po.WxShop; -import com.iformall.domain.po.WxShopUsers; +import com.iformall.domain.po.WxShopUsersInfo; import com.iformall.domain.po.base.TenantEntity; import com.iformall.domain.vo.WxBillHotNotify; import com.iformall.domain.vo.WxBillNotify; @@ -246,16 +246,16 @@ public class WxBillAllHelper { } if (shopIdList.size() > 0) { - WxShopUsers suq = new WxShopUsers(); + WxShopUsersInfo suq = new WxShopUsersInfo(); suq.updateTenantInfo(wxShop); suq.setStatus(EnumShopUsersStatus.LIVE.getCode()); suq.setShopIds(shopIdList); - Map shopUserMap = wxShopService.getShopUserMap(suq); + Map shopUserMap = wxShopService.getShopUserMap(suq); if (null != shopUserMap) { for (int i = 0 ; i < retList.size() ; i++) { WxBillNotify bn = retList.get(i); if (null != bn.getShopId()) { - WxShopUsers s = shopUserMap.get(bn.getShopId()); + WxShopUsersInfo s = shopUserMap.get(bn.getShopId()); if (null != s) { bn.setShopUserName(s.getName()); bn.setShopUserPerson(s.getLinkPerson()); @@ -286,7 +286,7 @@ public class WxBillAllHelper { if (null != shop) { result.put("shopNumber", shop.getShopNumber()); } - WxShopUsers su = wxShopService.getCurrentShopUser(bill, bill.getShopId()); + WxShopUsersInfo su = wxShopService.getCurrentShopUser(bill, bill.getShopId()); if (null != su) { result.put("merchantName", su.getName()); result.put("linkPerson", su.getLinkPerson()); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxAllBillServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxAllBillServiceImpl.java index 8a28eecdb..8cb5eff86 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxAllBillServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxAllBillServiceImpl.java @@ -19,7 +19,7 @@ import com.iformall.domain.po.WxMerchantBUser; import com.iformall.domain.po.WxPropertyContract; import com.iformall.domain.po.WxRentContract; import com.iformall.domain.po.WxShop; -import com.iformall.domain.po.WxShopUsers; +import com.iformall.domain.po.WxShopUsersInfo; import com.iformall.domain.po.base.TenantEntity; import com.iformall.domain.vo.RatioVo; import com.iformall.domain.vo.WxBillHotNotify; @@ -130,7 +130,7 @@ public class WxAllBillServiceImpl extends WxBillBaseService implements WxAllBill } //List _sids = (List) CollectionUtils.intersection(shopIds, wxBillRent.getShopIdList()); if (StringUtils.isNotBlank(wxBillRent.getCusName())) { - WxShopUsers suq = new WxShopUsers(); + WxShopUsersInfo suq = new WxShopUsersInfo(); suq.updateTenantInfo(wxBillRent); suq.setName(wxBillRent.getCusName()); List shopIds = wxShopService.getUserShopIds(suq); @@ -172,14 +172,14 @@ public class WxAllBillServiceImpl extends WxBillBaseService implements WxAllBill } Map shopMap = null; - Map shopUserMap = null; + Map shopUserMap = null; if (shopIds.size() > 0 ) { WxShop sq = new WxShop(); sq.updateTenantInfo(record); sq.setIds(shopIds); shopMap = wxShopService.findShopMap(sq); - WxShopUsers suq = new WxShopUsers(); + WxShopUsersInfo suq = new WxShopUsersInfo(); suq.updateTenantInfo(record); suq.setShopIds(shopIds); suq.setStatus(EnumShopUsersStatus.LIVE.getCode()); @@ -200,7 +200,7 @@ public class WxAllBillServiceImpl extends WxBillBaseService implements WxAllBill } if (null != shopUserMap) { - WxShopUsers wsu = shopUserMap.get(e.getShopId()); + WxShopUsersInfo wsu = shopUserMap.get(e.getShopId()); if (null != wsu) { if (StringUtils.isBlank(e.getCusName())) { e.setCusName(wsu.getName()); @@ -238,11 +238,11 @@ public class WxAllBillServiceImpl extends WxBillBaseService implements WxAllBill WxAllBill bill = wxAllBillMapper.selectById(id, tenantEntity.getTenantId()); if (null != bill && null != bill.getShopId()) { WxShop shop = wxShopService.getById(bill.getShopId()); - WxShopUsers suq = new WxShopUsers(); + WxShopUsersInfo suq = new WxShopUsersInfo(); suq.updateTenantInfo(tenantEntity); suq.setShopId(bill.getShopId()); suq.setStatus(EnumShopUsersStatus.LIVE.getCode()); - WxShopUsers su = wxShopService.getOneShopUsers(suq); + WxShopUsersInfo su = wxShopService.getOneShopUsers(suq); if (null != shop) { bill.setShopNumber(shop.getShopNumber()); } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxFinancePrintServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxFinancePrintServiceImpl.java index 8cc6fc2d1..59a403b71 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxFinancePrintServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxFinancePrintServiceImpl.java @@ -20,7 +20,7 @@ import com.iformall.domain.po.WxFinanceReceive; import com.iformall.domain.po.WxFinanceReceiveBill; import com.iformall.domain.po.WxMerchant; import com.iformall.domain.po.WxShop; -import com.iformall.domain.po.WxShopUsers; +import com.iformall.domain.po.WxShopUsersInfo; import com.iformall.domain.po.base.BaseEntity; import com.iformall.domain.vo.PrintVo; import com.iformall.domain.vo.WxBillSum; @@ -260,10 +260,10 @@ public class WxFinancePrintServiceImpl implements WxFinancePrintService { shopq.setTenantId(tenantId); shopq.setIsDel(EnumYesOrNo.NO.getCode()); Map shopMap = wxShopService.findShopMap(shopq); - WxShopUsers suq = new WxShopUsers(); + WxShopUsersInfo suq = new WxShopUsersInfo(); suq.setTenantId(tenantId); suq.setStatus(EnumShopUsersStatus.LIVE.getCode()); - Map shopUserMap = wxShopService.getShopUserMap(suq); + Map shopUserMap = wxShopService.getShopUserMap(suq); WxEnergyFees feq = new WxEnergyFees(); feq.setTenantId(tenantId); Map feesMap = wxEnergyService.getFeesMap(feq); @@ -339,7 +339,7 @@ public class WxFinancePrintServiceImpl implements WxFinancePrintService { bq.setOwe(oweTotal.toPlainString()); bq.setCurrentTime(new Date()); if (null != shopUserMap && null != bq.getShopId()) { - WxShopUsers su = shopUserMap.get(bq.getShopId()); + WxShopUsersInfo su = shopUserMap.get(bq.getShopId()); if (null != su) { bq.setCusName(su.getName()); bq.setCusPhone(su.getPhone()); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxFinanceServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxFinanceServiceImpl.java index ee76094ac..7a453f833 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxFinanceServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxFinanceServiceImpl.java @@ -30,7 +30,7 @@ import com.iformall.domain.po.WxFinanceReceiveSetoff; import com.iformall.domain.po.WxMallFloor; import com.iformall.domain.po.WxMerchant; import com.iformall.domain.po.WxShop; -import com.iformall.domain.po.WxShopUsers; +import com.iformall.domain.po.WxShopUsersInfo; import com.iformall.domain.po.base.BaseEntity.SortField; import com.iformall.domain.po.base.TenantEntity; import com.iformall.domain.vo.FinanceAdvanceBillVo; @@ -1253,11 +1253,11 @@ public class WxFinanceServiceImpl implements WxFinanceService { advanceBill.updateTenantInfo(record); advanceBill.setShopId(wxShop.getId()); if (StringUtils.isBlank(record.getCusName())) { - WxShopUsers su = new WxShopUsers(); + WxShopUsersInfo su = new WxShopUsersInfo(); su.updateTenantInfo(record); su.setShopId(wxShop.getId()); su.setStatus(EnumShopUsersStatus.LIVE.getCode()); - WxShopUsers wsu = wxShopService.getOneShopUsers(su); + WxShopUsersInfo wsu = wxShopService.getOneShopUsers(su); if (null != wsu) { advanceBill.setCusName(wsu.getName()); } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java index 967760a13..8e0989ffe 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java @@ -61,7 +61,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { WxShopMapper wxShopMapper; @Autowired - WxShopUsersMapper wxShopUsersMapper; + WxShopUsersInfoMapper wxShopUsersMapper; @Autowired WxMerchantShopMapper wxMerchantShopMapper; @@ -2353,12 +2353,12 @@ public class WxMerchantServiceImpl implements WxMerchantService { return null; } WxMerchantShop ms = merchantShopList.get(0); - WxShopUsers suq = new WxShopUsers(); + WxShopUsersInfo suq = new WxShopUsersInfo(); suq.updateTenantInfo(m); suq.setShopId(ms.getShopId()); suq.setStatus(EnumShopUsersStatus.LIVE.getCode()); suq.setSortColumn(" type desc"); - List userList = wxShopUsersMapper.findList(suq); + List userList = wxShopUsersMapper.findList(suq); if (null == userList || userList.size() <= 0 ){ return null; } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java index fc97f0b3f..de7d7a7a5 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java @@ -22,8 +22,9 @@ import com.iformall.mapper.WxMerchantShopMapper; import com.iformall.mapper.WxPropertyContractMapper; import com.iformall.mapper.WxRentContractMapper; import com.iformall.mapper.WxShopMapper; -import com.iformall.mapper.WxShopUsersMapper; +import com.iformall.mapper.WxShopUsersInfoMapper; import com.iformall.mapper.WxShopUsersPersonMapper; +import com.iformall.mapper.WxShopUsersMapper; import com.iformall.service.*; import cn.afterturn.easypoi.excel.ExcelImportUtil; @@ -69,7 +70,10 @@ public class WxShopServiceImpl implements WxShopService { WxMerchantShopMapper wxMerchantShopMapper; @Autowired - WxShopUsersMapper wxShopUsersMapper; + WxShopUsersInfoMapper wxShopUsersMapper; + + @Autowired + WxShopUsersMapper wxShopUsersShopMapper; @Autowired WxShopUsersPersonMapper wxShopUsersPersonMapper; @@ -329,12 +333,12 @@ public class WxShopServiceImpl implements WxShopService { } if (!isSetRentName) { //查询租户和业主 - WxShopUsers suq = new WxShopUsers(); + WxShopUsersInfo suq = new WxShopUsersInfo(); suq.updateTenantInfo(record); suq.setShopId(shopId); suq.setStatus(EnumShopUsersStatus.LIVE.getCode()); suq.setSortColumns("type desc"); - WxShopUsers wsu = this.getOneShopUsers(suq); + WxShopUsersInfo wsu = this.getOneShopUsers(suq); if (null != wsu) { shop.put("rentName",wsu.getName()); shop.put("rentType", wsu.getType()); @@ -1025,17 +1029,29 @@ public class WxShopServiceImpl implements WxShopService { } @Override - public WxShopUsers getOneShopUsers(WxShopUsers wxShopUsers) { - wxShopUsers.setSortColumn(" status asc, type desc"); - List list = wxShopUsersMapper.findList(wxShopUsers); - if (null != list && list.size() > 0) { - return list.get(0); + public WxShopUsersInfo getOneShopUsers(WxShopUsers wxShopUsersShop) { + wxShopUsersShop.setSortColumn(" status asc, type desc"); + List shopUserList = wxShopUsersShopMapper.findList(wxShopUsersShop); + if (null != shopUserList && shopUserList.size() > 0) { + WxShopUsers sus = shopUserList.get(0); + WxShopUsersInfo su = wxShopUsersMapper.selectById(sus.getShopUserId()); + if (null != su) { + su.setBeginDate(sus.getBeginDate()); + su.setEndDate(sus.getEndDate()); + su.setStatus(sus.getStatus()); + su.setStatusName(sus.getStatusName()); + } + return su; } return null; } @Override - public void saveOrUpdateShopUsers(WxShopUsers record) { + public void saveOrUpdateShopUsers(WxShopUsersInfo record) { + + + + if (record.getId() == null) { final IdWorker idWorker = IdWorker.get(); record.setId(idWorker.nextId()); @@ -1051,12 +1067,12 @@ public class WxShopServiceImpl implements WxShopService { } @Override - public void deleteShopUsers(WxShopUsers wxShopUsers) { + public void deleteShopUsers(WxShopUsersInfo wxShopUsers) { wxShopUsersMapper.deleteById(wxShopUsers.getId()); } @Override - public PageInfo shopUsersListAsPage(WxShopUsers record, Integer pageIndex, Integer pageSize) { + public PageInfo shopUsersListAsPage(WxShopUsersInfo record, Integer pageIndex, Integer pageSize) { return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxShopUsersMapper.findList(record)); } @@ -1090,20 +1106,20 @@ public class WxShopServiceImpl implements WxShopService { } @Override - public List getUserShopIds(WxShopUsers wxShopUsers) { + public List getUserShopIds(WxShopUsersInfo wxShopUsers) { return wxShopUsersMapper.findShopIdList(wxShopUsers); } @Override - public Map getShopUserMap(WxShopUsers wxShopUsers) { + public Map getShopUserMap(WxShopUsersInfo wxShopUsers) { wxShopUsers.setSortColumn(" status asc, type desc"); - List list = wxShopUsersMapper.findList(wxShopUsers); + List list = wxShopUsersMapper.findList(wxShopUsers); if (null == list || list.size() <= 0 ) { return null; } - Map retMap = new HashMap(); + Map retMap = new HashMap(); for (int i = 0 ; i < list.size(); i++) { - WxShopUsers su = list.get(i); + WxShopUsersInfo su = list.get(i); if (null != su.getShopId()) { if (!retMap.containsKey(su.getShopId())) { retMap.put(su.getShopId(), su); @@ -1114,13 +1130,13 @@ public class WxShopServiceImpl implements WxShopService { } @Override - public WxShopUsers getCurrentShopUser(TenantEntity tenantEntity, Long shopId) { - WxShopUsers suq = new WxShopUsers(); + public WxShopUsersInfo getCurrentShopUser(TenantEntity tenantEntity, Long shopId) { + WxShopUsersInfo suq = new WxShopUsersInfo(); suq.updateTenantInfo(tenantEntity); suq.setShopId(shopId); suq.setStatus(EnumShopUsersStatus.LIVE.getCode()); suq.setSortColumn("type desc"); - List list = wxShopUsersMapper.findList(suq); + List list = wxShopUsersMapper.findList(suq); if (null == list || list.size() <= 0 ) { return null; }; diff --git a/mallinkService/src/main/resources/mapper/WxShopUsersShopMapper.xml b/mallinkService/src/main/resources/mapper/WxShopUsersInfoMapper.xml similarity index 53% rename from mallinkService/src/main/resources/mapper/WxShopUsersShopMapper.xml rename to mallinkService/src/main/resources/mapper/WxShopUsersInfoMapper.xml index 20914082c..78826f513 100644 --- a/mallinkService/src/main/resources/mapper/WxShopUsersShopMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxShopUsersInfoMapper.xml @@ -1,21 +1,25 @@ - - + + - - - - + + + + + + + + - - `id`,`tenant_id`,`parent_tenant_id`,`shop_id`,`shop_user_id`,`begin_date`,`end_date`,`create_date`,`update_date`,`status` + `id`,`tenant_id`,`parent_tenant_id`,`create_shop_id`,`principal_type`,`name`,`phone`,`legal_person`,`id_number`,`sex`, + `link_person`,`create_date`,`update_date` @@ -32,21 +36,22 @@ and `parent_tenant_id` = #{parentTenantId} - - and `shop_id` = #{shopId} + + and `create_shop_id` = #{createShopId} - - and `status` = #{status} + + and `principal_type` = #{principalType} - - and shop_id in - - #{idItem} - + + and `name` like concat('%', #{name},'%') - + + + and `phone` like concat('%', #{phone},'%') + + and id in @@ -56,15 +61,10 @@ order by ${sortColumns} - select - from wx_shop_users_shop + from wx_shop_users_info - diff --git a/mallinkService/src/main/resources/mapper/WxShopUsersMapper.xml b/mallinkService/src/main/resources/mapper/WxShopUsersMapper.xml index ef512d288..b9c579814 100644 --- a/mallinkService/src/main/resources/mapper/WxShopUsersMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxShopUsersMapper.xml @@ -5,22 +5,18 @@ - + + - - - - - - - + + + - `id`,`tenant_id`,`parent_tenant_id`,`create_shop_id`,`type`,`principal_type`,`name`,`phone`,`legal_person`,`id_number`,`sex`, - `link_person`,`create_date`,`update_date` + `id`,`tenant_id`,`parent_tenant_id`,`shop_id`,`shop_user_id`,`type`,`begin_date`,`end_date`,`create_date`,`update_date`,`status` @@ -37,26 +33,29 @@ and `parent_tenant_id` = #{parentTenantId} - - and `create_shop_id` = #{createShopId} + + and `shop_user_id` = #{shopUserId} - + and `type` = #{type} - - - and `principal_type` = #{principalType} + + + and `shop_id` = #{shopId} - - and `name` like concat('%', #{name},'%') + + and `status` = #{status} - - and `phone` like concat('%', #{phone},'%') + + and shop_id in + + #{idItem} + - + and id in @@ -69,7 +68,12 @@ +