From eafd2ce1e287cb2d74f917002feba224d92b3e15 Mon Sep 17 00:00:00 2001 From: Burce Date: Fri, 25 Oct 2019 18:34:54 +0800 Subject: [PATCH 1/5] =?UTF-8?q?[=E6=8B=9B=E5=95=86][=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E6=8F=90=E9=86=92]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/iformall/schedule/InvestSchedule.java | 4 +- .../service/invest/InvestBaseService.java | 2 +- .../invest/impl/InvestBaseServiceImpl.java | 4 +- .../invest/impl/InvestBizServiceImpl.java | 44 ++++++++++--------- .../invest/impl/InvestTaskServiceImpl.java | 4 +- .../resources/mapper/InvestCustomerMapper.xml | 4 +- 6 files changed, 32 insertions(+), 30 deletions(-) diff --git a/mallinkSchedule/src/main/java/com/iformall/schedule/InvestSchedule.java b/mallinkSchedule/src/main/java/com/iformall/schedule/InvestSchedule.java index 2659dca0d..e43508093 100644 --- a/mallinkSchedule/src/main/java/com/iformall/schedule/InvestSchedule.java +++ b/mallinkSchedule/src/main/java/com/iformall/schedule/InvestSchedule.java @@ -99,7 +99,7 @@ public class InvestSchedule { private void addTaskMessage(InvestTaskEntity task, List ownerArray) { String message = String.format(EnumInvestMessageType.TASK_REMIND.getInfo(), task.getId(), DateUtils.format(task.getLastTime())); - messageService.saveBatchMessage(ownerArray, message, EnumInvestMessageTag.TASK_MONTH, EnumFollowType.TASK, task.getId()); + messageService.saveBatchMessage(ownerArray, message, EnumInvestMessageTag.TASK_MONTH, EnumFollowType.TASK, task.getId(),task.getTenantId()); log.info("{}:taskID:{} 为用户{}创建消息提醒", PREFIX, task.getId(), task.getOwner()); } @@ -155,7 +155,7 @@ public class InvestSchedule { private void addCustomerMessage(InvestCustomerVo customerVo, Long owner) { String message = String.format(EnumInvestMessageType.COSTOMER_REMIND.getInfo(), customerVo.getId()); - messageService.saveBatchMessage(Arrays.asList(owner), message, EnumInvestMessageTag.CUSTOMER_WEEK, EnumFollowType.DEMAND, customerVo.getId()); + messageService.saveBatchMessage(Arrays.asList(owner), message, EnumInvestMessageTag.CUSTOMER_WEEK, EnumFollowType.DEMAND, customerVo.getId(),customerVo.getTenantId()); log.info("{}:customerID:{} 为用户{}创建消息提醒", PREFIX, customerVo.getId(), customerVo.getDemandOwner()); } } \ No newline at end of file diff --git a/mallinkService/src/main/java/com/iformall/service/invest/InvestBaseService.java b/mallinkService/src/main/java/com/iformall/service/invest/InvestBaseService.java index 98b5544f0..1ad68489d 100755 --- a/mallinkService/src/main/java/com/iformall/service/invest/InvestBaseService.java +++ b/mallinkService/src/main/java/com/iformall/service/invest/InvestBaseService.java @@ -33,7 +33,7 @@ public interface InvestBaseService { * @param tid * @return */ - default boolean saveBatchMessage(List ownerArray, String message, EnumInvestMessageTag tag, EnumFollowType type, Long tid) { + default boolean saveBatchMessage(List ownerArray, String message, EnumInvestMessageTag tag, EnumFollowType type, Long tid,String tenantId) { return false; } } diff --git a/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBaseServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBaseServiceImpl.java index fbecc043f..9d4f7f736 100644 --- a/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBaseServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBaseServiceImpl.java @@ -104,7 +104,7 @@ public class InvestBaseServiceImpl, T> extends ServiceIm } @Override - public boolean saveBatchMessage(List ownerArray, String message, EnumInvestMessageTag tag, EnumFollowType type, Long tid) { + public boolean saveBatchMessage(List ownerArray, String message, EnumInvestMessageTag tag, EnumFollowType type, Long tid,String tenantId) { if (CollectionUtils.isEmpty(ownerArray)) { return false; } @@ -124,7 +124,7 @@ public class InvestBaseServiceImpl, T> extends ServiceIm messageEntity.setOwner(aLong); messageEntity.setTid(tid); messageEntity.setType(type); - messageEntity.setTenantId(InvestUserContext.getUser().getTenantId()); + messageEntity.setTenantId(tenantId); messageEntity.setMessage(message); messageEntity.setTag(tag); messageEntityList.add(messageEntity); diff --git a/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java index 2063e943a..97bd1eb37 100644 --- a/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java @@ -758,7 +758,8 @@ public class InvestBizServiceImpl implements InvestBizService { Long owner = demandEntity.getOwner(); if (Objects.nonNull(owner) && !Objects.equals(owner, 0L)) { List ownerArray = Collections.singletonList(owner); - demandService.saveBatchMessage(ownerArray, EnumInvestMessageType.CUSTOMER_CREATE.getInfo(), EnumInvestMessageTag.CUSTOMER_CREATE, EnumFollowType.DEMAND, customerEntity.getId()); + demandService.saveBatchMessage(ownerArray, EnumInvestMessageType.CUSTOMER_CREATE.getInfo(), + EnumInvestMessageTag.CUSTOMER_CREATE, EnumFollowType.DEMAND, customerEntity.getId(),customerEntity.getTenantId()); } } @@ -948,28 +949,29 @@ public class InvestBizServiceImpl implements InvestBizService { } private void syncTargetStatus(InvestTaskEntity investTaskEntity) { - if (!Objects.equals(investTaskEntity.getTargetType(), EnumInvestType.RENT)) { - return; - } - WxShop shop = shopService.getById(investTaskEntity.getTargetId()); - Map shopContractMap = getWxRentContractMap(shop); - WxRentContract contract = shopContractMap.get(shop.getId()); - if (Objects.nonNull(contract)) { - InvestHelper.addContractId(investTaskEntity.getContent(), contract.getId(), null); - } else { - WxRentContract contractQuery = new WxRentContract(); - contractQuery.setTenantId(InvestUserContext.getUser().getTenantId()); - contractQuery.setShopId(investTaskEntity.getTargetId()); - contractQuery.setStatus(EnumRentContractStatus.INTENTION.getCode()); - //获取意向合同 - int count = rentContractService.selectContractCountByShopId(contractQuery); - if (count > 0) { - investTaskEntity.setStatus(EnumTaskStatus.INTENTION); - } - } + //if (!Objects.equals(investTaskEntity.getTargetType(), EnumInvestType.RENT)) { + // return; + //} - if (StringUtils.isNotBlank(investTaskEntity.getOwner()) && Objects.equals(EnumTaskStatus.CREATED, investTaskEntity.getStatus())) { + if (StringUtils.isNotBlank(investTaskEntity.getOwner())) { investTaskEntity.setStatus(EnumTaskStatus.NEGOTIATING); + } else { + WxShop shop = shopService.getById(investTaskEntity.getTargetId()); + Map shopContractMap = getWxRentContractMap(shop); + WxRentContract contract = shopContractMap.get(shop.getId()); + if (Objects.nonNull(contract)) { + InvestHelper.addContractId(investTaskEntity.getContent(), contract.getId(), null); + } else { + WxRentContract contractQuery = new WxRentContract(); + contractQuery.setTenantId(InvestUserContext.getUser().getTenantId()); + contractQuery.setShopId(investTaskEntity.getTargetId()); + contractQuery.setStatus(EnumRentContractStatus.INTENTION.getCode()); + //获取意向合同 + int count = rentContractService.selectContractCountByShopId(contractQuery); + if (count > 0) { + investTaskEntity.setStatus(EnumTaskStatus.INTENTION); + } + } } } diff --git a/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestTaskServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestTaskServiceImpl.java index 385187ae6..9bef2e11b 100755 --- a/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestTaskServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestTaskServiceImpl.java @@ -3,7 +3,6 @@ package com.iformall.service.invest.impl; import com.alibaba.fastjson.JSONArray; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.iformall.common.TableLog; import com.iformall.domain.po.invest.InvestTaskEntity; import com.iformall.enums.EnumFollowType; import com.iformall.enums.EnumInvestMessageTag; @@ -56,7 +55,8 @@ public class InvestTaskServiceImpl extends InvestBaseServiceImpl ownerArray = JSONArray.parseArray(owner, Long.class); - this.saveBatchMessage(ownerArray, EnumInvestMessageType.TASK_CREATE.getInfo(), EnumInvestMessageTag.TASK_CREATE, EnumFollowType.TASK, entity.getId()); + this.saveBatchMessage(ownerArray, EnumInvestMessageType.TASK_CREATE.getInfo(), + EnumInvestMessageTag.TASK_CREATE, EnumFollowType.TASK, entity.getId(),entity.getTenantId()); } } diff --git a/mallinkService/src/main/resources/mapper/InvestCustomerMapper.xml b/mallinkService/src/main/resources/mapper/InvestCustomerMapper.xml index 53ea1daba..e968a5624 100644 --- a/mallinkService/src/main/resources/mapper/InvestCustomerMapper.xml +++ b/mallinkService/src/main/resources/mapper/InvestCustomerMapper.xml @@ -25,13 +25,13 @@ LEFT JOIN `invest_demand` d ON d.id = f.`follow_id` LEFT JOIN invest_customer c ON d.`customer_id` = c.id where 1=1 - + AND c.type in #{idItem} - + AND d.id in #{idItem} From c43744ca234cb33688bd21b9874261df61686104 Mon Sep 17 00:00:00 2001 From: gongbiao Date: Fri, 25 Oct 2019 19:02:30 +0800 Subject: [PATCH 2/5] =?UTF-8?q?[=E7=A9=BA=E8=B0=83=E8=B4=B9][=E4=BF=AE?= =?UTF-8?q?=E6=94=B9][=E6=98=8E=E7=BB=86]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/WxBillAllServiceImpl.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java index 8ef7995cb..9fb0a4286 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java @@ -1552,6 +1552,21 @@ public class WxBillAllServiceImpl implements WxBillAllService { wxBillDaily.setId(businessId); wxBillDaily.setReceivePay(newPrice); wxBillDaily.setOwe(newPrice + dbBill.getServiceChargePay() - dbBill.getPay()); + + JSONArray priceDetals = new JSONArray(); + JSONObject priceDetal = new JSONObject(); + priceDetal.put("key", "price"); + priceDetal.put("value", 0); + priceDetals.add(priceDetal); + priceDetal = new JSONObject(); + priceDetal.put("key", "way"); + priceDetal.put("value", 0); + priceDetals.add(priceDetal); + priceDetal = new JSONObject(); + priceDetal.put("key", "unit"); + priceDetal.put("value", 0); + priceDetals.add(priceDetal); + wxBillDaily.setPriceDetail(JSONArray.toJSONString(priceDetals)); if (newPrice.equals(dbBill.getPay())) { wxBillDaily.setStatus(EnumBillRentStatus.PAID.getCode()); } From 8f8607fba2d5796e61251ae5d3dbc7af125f0046 Mon Sep 17 00:00:00 2001 From: Burce Date: Fri, 25 Oct 2019 19:09:14 +0800 Subject: [PATCH 3/5] =?UTF-8?q?[=E6=8B=9B=E5=95=86]=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E5=95=86=E9=93=BA=E5=8F=AF=E5=87=BA=E7=A7=9F=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/invest/InvestController.java | 12 ++++++++++++ .../iformall/service/invest/InvestBizService.java | 3 +++ .../service/invest/impl/InvestBizServiceImpl.java | 14 ++++++++++++++ 3 files changed, 29 insertions(+) diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestController.java b/mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestController.java index ccb80fe9c..8e7032336 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestController.java @@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.Collection; +import java.util.Map; @Slf4j @@ -35,4 +36,15 @@ public class InvestController extends InvestBaseController { return execute(null, p -> bizService.queryUserList()); } + + /** + * 查询商铺可出租时间 + */ + @ApiOperation("查询商铺可出租时间") + @SystemControllerLog(description = "查询商铺可出租时间") + @GetMapping("/shopRentInfo") + public InvestResultData shopRentInfo(Long shopId) { + return execute(shopId, p -> bizService.shopRentInfo(p)); + } + } diff --git a/mallinkService/src/main/java/com/iformall/service/invest/InvestBizService.java b/mallinkService/src/main/java/com/iformall/service/invest/InvestBizService.java index 7961b5fe2..ef15c5708 100644 --- a/mallinkService/src/main/java/com/iformall/service/invest/InvestBizService.java +++ b/mallinkService/src/main/java/com/iformall/service/invest/InvestBizService.java @@ -11,6 +11,7 @@ import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; import java.util.Collection; import java.util.List; +import java.util.Map; public interface InvestBizService { @@ -38,6 +39,8 @@ public interface InvestBizService { */ Collection queryUserList() ; + Map shopRentInfo(Long shopId) ; + boolean saveCustomerAndDemand(InvestDemandDto customerDemandDto) ; boolean updateCustomerAndDemand(InvestDemandDto customerDto) ; diff --git a/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java index 97bd1eb37..6a2cfc027 100644 --- a/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java @@ -705,6 +705,20 @@ public class InvestBizServiceImpl implements InvestBizService { return queryUserList(EnumInvestUserType.ALL); } + @Override + public Map shopRentInfo(Long shopId) { + WxShop shop = shopService.getById(shopId); + InvestHelper.notNull(shop, "shop 不存在"); + //3、商品合同信息 + Map shopContractMap = rentContractService.selectRentContractByShopIds(Arrays.asList(shop.getId()), StringUtils.join(shop.getId()), InvestUserContext.getUser().getTenantId()); + WxRentContract contract = shopContractMap.get(shop.getId()); + InvestHelper.notNull(contract,"合同信息不存在"); + Map map = new HashMap<>(); + map.put("startdate", contract.getRentalStartDate()); + map.put("enddate", contract.getRentalEndDate()); + return map; + } + public List queryUserList(EnumInvestUserType userType) { LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.eq(MallUserInfo::getStatus, 1); From 1d6cc84e046ff065f0b23699d34a8f65721e4fa3 Mon Sep 17 00:00:00 2001 From: gongbiao Date: Mon, 28 Oct 2019 10:21:18 +0800 Subject: [PATCH 4/5] =?UTF-8?q?[=E7=A9=BA=E8=B0=83=E8=B4=B9][=E4=BF=AE?= =?UTF-8?q?=E6=94=B9][=E6=98=8E=E7=BB=86]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/WxBillAllServiceImpl.java | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java index 9fb0a4286..ed19532d9 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java @@ -1289,6 +1289,20 @@ public class WxBillAllServiceImpl implements WxBillAllService { daily.setExpiredDay(expiredDayAndStatus.getExpiredDay()); daily.setStatus(expiredDayAndStatus.getStatus()); daily.setBuildWay(EnumBillDailyBuildWay.IMPORT.getCode()); + JSONArray priceDetals = new JSONArray(); + JSONObject priceDetal = new JSONObject(); + priceDetal.put("key", "price"); + priceDetal.put("value", 0); + priceDetals.add(priceDetal); + priceDetal = new JSONObject(); + priceDetal.put("key", "way"); + priceDetal.put("value", 0); + priceDetals.add(priceDetal); + priceDetal = new JSONObject(); + priceDetal.put("key", "unit"); + priceDetal.put("value", 0); + priceDetals.add(priceDetal); + daily.setPriceDetail(JSONArray.toJSONString(priceDetals)); wxBillDailyMapper.insert(daily); if (pay > 0) { addActionImport(daily.getId(), bill.getPayWay(), bill.getPayDate(), user, bill.getPayStr()); @@ -1552,21 +1566,6 @@ public class WxBillAllServiceImpl implements WxBillAllService { wxBillDaily.setId(businessId); wxBillDaily.setReceivePay(newPrice); wxBillDaily.setOwe(newPrice + dbBill.getServiceChargePay() - dbBill.getPay()); - - JSONArray priceDetals = new JSONArray(); - JSONObject priceDetal = new JSONObject(); - priceDetal.put("key", "price"); - priceDetal.put("value", 0); - priceDetals.add(priceDetal); - priceDetal = new JSONObject(); - priceDetal.put("key", "way"); - priceDetal.put("value", 0); - priceDetals.add(priceDetal); - priceDetal = new JSONObject(); - priceDetal.put("key", "unit"); - priceDetal.put("value", 0); - priceDetals.add(priceDetal); - wxBillDaily.setPriceDetail(JSONArray.toJSONString(priceDetals)); if (newPrice.equals(dbBill.getPay())) { wxBillDaily.setStatus(EnumBillRentStatus.PAID.getCode()); } From 051b7c1e242fa6eb40fecf729734b9fe5a6aabc4 Mon Sep 17 00:00:00 2001 From: gongbiao Date: Mon, 28 Oct 2019 10:59:41 +0800 Subject: [PATCH 5/5] =?UTF-8?q?[=E5=90=88=E5=90=8C=E8=B4=A6=E6=88=B7][?= =?UTF-8?q?=E4=BF=AE=E6=94=B9][=E5=AE=9E=E4=BD=93=E4=BF=AE=E6=94=B9]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iformall/controller/contract/WxRentContractController.java | 2 +- .../src/main/java/com/iformall/domain/po/WxPayAccountBill.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentContractController.java b/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentContractController.java index 65320c031..6ec7ecae1 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentContractController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentContractController.java @@ -342,7 +342,7 @@ public class WxRentContractController extends BaseController { @PostMapping("savePayAccountInfo") @SystemControllerLog(description = "租赁合同-保存甲方账户") public ResultData savePayAccountInfo(@RequestBody WxPayAccountBill payAccountBill) { - logger.debug("[" + getIpAddr() + "] WxRentContractController::updateRentContractStatus"); + logger.debug("[" + getIpAddr() + "] WxRentContractController::savePayAccountInfo"); if(StringUtils.isBlank(payAccountBill.getBankAccountName())) { return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL, "甲方银行账户名未填写"); } diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxPayAccountBill.java b/mallinkService/src/main/java/com/iformall/domain/po/WxPayAccountBill.java index fec05974d..101274cfa 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxPayAccountBill.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxPayAccountBill.java @@ -32,7 +32,7 @@ public class WxPayAccountBill extends BaseEntity { @io.swagger.annotations.ApiModelProperty(value="商户模式-0:普通商户模式1:服务商模式",name="type") private Integer type; @io.swagger.annotations.ApiModelProperty(value="是否开启分账(0:未开启分账1:开启分账)",name="type") - private boolean share; + private Boolean share; @io.swagger.annotations.ApiModelProperty(value="手续费(万分之几,默认60)",name="rate") private Integer rate; @io.swagger.annotations.ApiModelProperty(value="实际手续费(万分之几,默认60)",name="realRate")