From 26454a750d8a5379f0fb6ac3a9b848c5a0e71dc2 Mon Sep 17 00:00:00 2001 From: gongbiao Date: Thu, 20 Jun 2019 21:03:23 +0800 Subject: [PATCH 1/5] =?UTF-8?q?[BUG][=E4=BF=AE=E6=94=B9][=E5=95=86?= =?UTF-8?q?=E9=93=BA=E7=A7=9F=E8=B5=81=E5=90=88=E5=90=8C=20--=20=20?= =?UTF-8?q?=E8=B4=A6=E5=8D=95=E9=87=91=E9=A2=9D=E5=9C=A8=E6=8C=89=E5=9B=BA?= =?UTF-8?q?=E5=AE=9A=E9=87=91=E9=A2=9D=E9=80=92=E5=A2=9E=E5=90=8E=E3=80=82?= =?UTF-8?q?=20=E6=B2=A1=E6=9C=89=E5=8F=98=E5=8C=96]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/iformall/service/impl/WxRentContractServiceImpl.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java index 24f68b239..aa271c731 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java @@ -877,8 +877,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { } } else { for (int i = 1; i < size; i++) { - BigDecimal divide = priceD.add(new BigDecimal(integers.get(i))); - priceD = priceD.add(divide); + priceD = priceD.add(new BigDecimal(integers.get(i))); priceArrs[i] = priceD.setScale(0, RoundingMode.HALF_EVEN).longValue(); } } From 886fd5619cb63f2eb415741f6be0d50bc282e3c9 Mon Sep 17 00:00:00 2001 From: hupeng Date: Thu, 20 Jun 2019 21:24:32 +0800 Subject: [PATCH 2/5] =?UTF-8?q?[=E7=94=B5=E8=A1=A8][=E4=BF=AE=E5=A4=8D]:?= =?UTF-8?q?=E7=9B=92=E5=AD=90=E6=97=B6=E9=97=B4=E6=9C=AA=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E6=97=B6=E7=BA=A0=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iformall/controller/device/KwBoxV1Controller.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mallinkCallback/src/main/java/com/iformall/controller/device/KwBoxV1Controller.java b/mallinkCallback/src/main/java/com/iformall/controller/device/KwBoxV1Controller.java index 19b13d8bb..ded5c34db 100644 --- a/mallinkCallback/src/main/java/com/iformall/controller/device/KwBoxV1Controller.java +++ b/mallinkCallback/src/main/java/com/iformall/controller/device/KwBoxV1Controller.java @@ -10,6 +10,7 @@ import com.iformall.domain.po.KwBoxCmdHistory; import com.iformall.enums.EnumBoxRegisterStatus; import com.iformall.service.kw.KwBoxCmdHistoryService; import com.iformall.service.kw.KwBoxService; + import io.netty.util.internal.StringUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -19,6 +20,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.text.SimpleDateFormat; +import java.time.Instant; +import java.time.LocalDateTime; +import java.time.ZoneId; import java.util.*; import java.util.stream.Collectors; @@ -135,6 +139,12 @@ public class KwBoxV1Controller extends BaseController { record.setId(kwBox.getId()); record.setLastOnlineTime(new Date()); kwBoxService.saveOrUpdate(record); + + Instant instant = deviceTime.toInstant(); + ZoneId zone = ZoneId.systemDefault(); + LocalDateTime localDateTime = LocalDateTime.ofInstant(instant, zone); + if (localDateTime.getYear() == 1980) + deviceTime = new Date(); List> metersData = (List>)paramMap.get("meters"); kwBoxService.saveMeterData(kwBox, metersData, deviceTime); From 5bddcd59fc88a1ae449456b72e18312e9ff780f0 Mon Sep 17 00:00:00 2001 From: hupeng Date: Thu, 20 Jun 2019 21:25:56 +0800 Subject: [PATCH 3/5] =?UTF-8?q?[=E7=94=B5=E8=A1=A8][=E4=BF=AE=E5=A4=8D]:?= =?UTF-8?q?=E5=91=BD=E4=BB=A4=E7=BB=9F=E4=B8=80=E4=BD=BF=E7=94=A8=E5=AE=9A?= =?UTF-8?q?=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/iformall/controller/device/KwBoxV1Controller.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mallinkCallback/src/main/java/com/iformall/controller/device/KwBoxV1Controller.java b/mallinkCallback/src/main/java/com/iformall/controller/device/KwBoxV1Controller.java index ded5c34db..e5282829b 100644 --- a/mallinkCallback/src/main/java/com/iformall/controller/device/KwBoxV1Controller.java +++ b/mallinkCallback/src/main/java/com/iformall/controller/device/KwBoxV1Controller.java @@ -157,7 +157,7 @@ public class KwBoxV1Controller extends BaseController { { updateMeters = true; } else { - if (!meters.containsAll(metersData.stream().map(m->m.get("addr")).collect(Collectors.toList()))) + if (!meters.containsAll(metersData.stream().map(m->m.get(KwBoxService.METER_ADDRESS)).collect(Collectors.toList()))) updateMeters = true; } From f4bf1cd3b6575e8badb86e1c656c5149c53e1cab Mon Sep 17 00:00:00 2001 From: gongbiao Date: Thu, 20 Jun 2019 22:11:01 +0800 Subject: [PATCH 4/5] =?UTF-8?q?[BUG][=E4=BF=AE=E6=94=B9][=E4=BA=91?= =?UTF-8?q?=E7=AB=AF=E6=B5=8B=E8=AF=95=EF=BC=9Aversion:.1528.1959=EF=BC=9A?= =?UTF-8?q?=E8=B4=A6=E5=8D=95=E7=AE=A1=E7=90=86=E4=B8=8B=E5=95=86=E9=93=BA?= =?UTF-8?q?=E5=8F=B7=E4=B8=8D=E6=98=BE=E7=A4=BA]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/WxRentContractServiceImpl.java | 44 ++++++++----------- 1 file changed, 18 insertions(+), 26 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java index aa271c731..31d3b98ba 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java @@ -769,7 +769,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { //按月计租 // if (wxRentContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_MONTH.getCode()) // ||wxRentContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_NAR_MONTH.getCode())) { - rentList = buildRentMonth(wxMerchant, userId, wxRentContract, receivePeriod, lease, rentalStartDate, price,isPreview); + rentList = buildRentMonth(userId, wxRentContract, receivePeriod, lease, rentalStartDate, price, isPreview); // } else { // //如果按日 // List yearList = new ArrayList<>(); @@ -830,7 +830,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { return priceList; } - public List buildRentMonth(WxMerchant wxMerchant, Long userId, WxRentContract wxRentContract, int receivePeriod, Integer lease, Date rentalStartDate, Long price, Integer isPreview) { + public List buildRentMonth(Long userId, WxRentContract wxRentContract, int receivePeriod, Integer lease, Date rentalStartDate, Long price, Integer isPreview) { int size = 0; long[] priceArrs = null; List> shopInfos = new ArrayList<>(); @@ -918,13 +918,27 @@ public class WxRentContractServiceImpl implements WxRentContractService { yearList.add(startDate); } - Map resultMap = buildRent(receivePeriod, priceArrs, yearList, Calendar.MONTH, wxRentContract, userId, wxMerchant, billcount, isPreview, shopInfos); + + String shopInfoStr = null; + if (wxRentContract.getRentShopType().equals(EnumRentShopType.SHOP.getCode())) { + String rentInfo = wxRentContract.getRentInfo(); + JSONArray rentInfoArray = JSONArray.parseArray(rentInfo); + int rentSize = rentInfoArray.size(); + Map shopInfoMap = new HashMap<>(rentSize); + for (int j = 0; j < rentSize; j++) { + JSONObject rentInfoObject = rentInfoArray.getJSONObject(j); + shopInfoMap.put(rentInfoObject.getString("shopNumber"), rentInfoObject.getString("buildArea")); + } + shopInfoStr = JSONObject.toJSONString(shopInfoMap); + } + + Map resultMap = buildRent(receivePeriod, priceArrs, yearList, Calendar.MONTH, wxRentContract, userId, billcount, isPreview, shopInfoStr); List billRentList = (List)resultMap.get("billList"); resultList.addAll(billRentList); return resultList; } - public Map buildRent(int receivePeriod,long[] priceArrs, List yearList,int dayType, WxRentContract wxRentContract, Long userId, WxMerchant wxMerchant, int billcount, Integer isPreview,List> shopInfoList) { + public Map buildRent(int receivePeriod, long[] priceArrs, List yearList, int dayType, WxRentContract wxRentContract, Long userId, int billcount, Integer isPreview, String shopInfoStr) { SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd"); Map resultMap = new HashedMap(); List resultList = new ArrayList<>(); @@ -957,28 +971,6 @@ public class WxRentContractServiceImpl implements WxRentContractService { //获取price 、shopInfo long price = priceArrs[index]; - Map shopInfo = null; - if(!CollectionUtils.isEmpty(shopInfoList)){ - shopInfo = shopInfoList.get(index); - } - - String shopInfoStr = null; - if (shopInfo != null) { - shopInfoStr = JSONObject.toJSONString(shopInfo); - } else { - if (wxRentContract.getRentShopType().equals(EnumRentShopType.SHOP.getCode()) && - wxRentContract.getType().equals(EnumRentContractType.RENT_BY_JOINT.getCode())) { - String rentInfo = wxRentContract.getRentInfo(); - JSONArray rentInfoArray = JSONArray.parseArray(rentInfo); - int rentSize = rentInfoArray.size(); - Map shopInfoMap = new HashMap<>(); - for (int j = 0; j < rentSize; j++) { - JSONObject rentInfoObject = rentInfoArray.getJSONObject(j); - shopInfoMap.put(rentInfoObject.getString("shopNumber"), 0); - } - shopInfoStr = JSONObject.toJSONString(shopInfoMap); - } - } WxBillRent wxBillRent = new WxBillRent(); wxBillRent.setIsPreview(isPreview); From 086ca2cc802acb8a4228bd664c86a6bb0c623d95 Mon Sep 17 00:00:00 2001 From: gongbiao Date: Fri, 21 Jun 2019 11:20:33 +0800 Subject: [PATCH 5/5] =?UTF-8?q?[BUG][=E4=BF=AE=E6=94=B9][=E4=BA=91?= =?UTF-8?q?=E7=AB=AF=E6=B5=8B=E8=AF=95=EF=BC=9Aversion:.1528.1959=EF=BC=9A?= =?UTF-8?q?=E5=AE=A1=E6=89=B9=E6=B5=81=E9=97=AE=E9=A2=98-=E8=80=81?= =?UTF-8?q?=E5=AE=A1=E6=89=B9=E6=95=B0=E6=8D=AE=E8=BF=9B=E8=A1=8C=E9=A9=B3?= =?UTF-8?q?=E5=9B=9E=EF=BC=8C=E5=9C=A8=E8=BF=9B=E8=A1=8C=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E6=AD=A4=E6=97=B6=E5=AE=A1=E6=89=B9=E6=B5=81=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E6=A8=A1=E7=89=88=E5=BA=94=E8=AF=A5=E7=9B=B4=E6=8E=A5=E5=AE=A1?= =?UTF-8?q?=E6=89=B9=E8=BF=87]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/WxPropertyContractServiceImpl.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java index 8188c4997..b33d919ff 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java @@ -268,7 +268,9 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService } //保存物业合同信息 String message; + boolean hasFlow = true; if (record.getId() == null) { + hasFlow = false; final IdWorker idWorker = IdWorker.get(); record.setId(idWorker.nextId()); record.setRentalStartDate(wxRentContract.getRentalStartDate()); @@ -330,6 +332,10 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService record.setPrice(record.getPrice() != null ? record.getPrice() : 0); record.setDeposit(record.getDeposit() != null ? record.getDeposit() : 0); record.setUpdatetime(new Date()); + if (CollectionUtils.isEmpty(record.getFlowParams())) { + hasFlow = false; + record.setApplyStatus(EnumRentContractAppStatus.DEFAULT.getCode()); + } try { wxPropertyContractMapper.updateByPrimaryKeySelective(record); } catch (Exception e) { @@ -340,8 +346,8 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService message = "更新物业合同信息成功"; } - if (record.getOperationType().equals(EnumContractOperationType.PART.getCode())) { - if (!CollectionUtils.isEmpty(record.getFlowParams())) { + if (hasFlow) { + if (record.getOperationType().equals(EnumContractOperationType.PART.getCode())) { if (wxFlowService.getModelByType((Integer) record.getFlowParams().get("businessType"), record.getTenantId()) == null) { updatePropertyContractStatus(record.getId()); } else { @@ -355,10 +361,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService wxPropertyContractMapper.updateStatus(updateRentContract); logger.info("id:{},启动审批流成功", record.getId().toString()); } - } - } else { - //有模板,启动审批流,没有,直接生产账单 - if (!CollectionUtils.isEmpty(record.getFlowParams())) { + } else { if (wxFlowService.getModelByType((Integer) record.getFlowParams().get("businessType"), record.getTenantId()) == null && record.getMerchantId() != null) { wxRentContractService.updateRentContractStatus(record.getId());