From 1a78dc8e15ef8ac3a9541bca99822aed158c8471 Mon Sep 17 00:00:00 2001 From: hupeng Date: Tue, 6 Aug 2019 19:03:16 +0800 Subject: [PATCH 1/2] =?UTF-8?q?[=E7=94=B5=E8=A1=A8][=E4=BF=AE=E5=A4=8D]:?= =?UTF-8?q?=E7=94=B5=E8=A1=A8=E5=AF=BC=E5=85=A5=E6=95=B0=E5=AD=97=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E6=97=B6=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/device/KwMeterController.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/device/KwMeterController.java b/mallinkAdmin/src/main/java/com/iformall/controller/device/KwMeterController.java index 2ac972da8..2f6b3d745 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/device/KwMeterController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/device/KwMeterController.java @@ -24,7 +24,9 @@ import org.apache.poi.hssf.usermodel.HSSFSheet; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.poifs.filesystem.POIFSFileSystem; import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.CellType; import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.xssf.usermodel.XSSFCell; import org.apache.poi.xssf.usermodel.XSSFRow; import org.apache.poi.xssf.usermodel.XSSFSheet; import org.apache.poi.xssf.usermodel.XSSFWorkbook; @@ -202,22 +204,22 @@ public class KwMeterController extends BaseController { continue; KwMeter kwMeter = new KwMeter(); Cell c = row.getCell(0,Row.MissingCellPolicy.RETURN_BLANK_AS_NULL); - if (c != null) { + if (c != null && c.getCellType() == CellType.STRING ) { kwMeter.setAddress(c.getStringCellValue()); } else { continue; } c = row.getCell(1,Row.MissingCellPolicy.RETURN_BLANK_AS_NULL); - if (c != null) {kwMeter.setPlace(c.getStringCellValue());} + if (c != null && c.getCellType() == CellType.STRING ) {kwMeter.setPlace(c.getStringCellValue());} c = row.getCell(2,Row.MissingCellPolicy.RETURN_BLANK_AS_NULL); - if (c != null) {kwMeter.setBrand(c.getStringCellValue());} + if (c != null && c.getCellType() == CellType.STRING ) {kwMeter.setBrand(c.getStringCellValue());} c = row.getCell(3,Row.MissingCellPolicy.RETURN_BLANK_AS_NULL); - if (c != null) {kwMeter.setModel(c.getStringCellValue());} + if (c != null && c.getCellType() == CellType.STRING ) {kwMeter.setModel(c.getStringCellValue());} c = row.getCell(4,Row.MissingCellPolicy.RETURN_BLANK_AS_NULL); - if (c != null) {kwMeter.setProtocol(Integer.parseInt(c.getStringCellValue()));} + if (c != null && c.getCellType() == CellType.STRING ) {kwMeter.setProtocol(Integer.parseInt(c.getStringCellValue()));} c = row.getCell(5,Row.MissingCellPolicy.RETURN_BLANK_AS_NULL); - if (c != null) {kwMeter.setBandrate(Integer.parseInt(c.getStringCellValue()));} + if (c != null && c.getCellType() == CellType.STRING ) {kwMeter.setBandrate(Integer.parseInt(c.getStringCellValue()));} if (kwMeter.getProtocol() != null || kwMeter.getBandrate() != null) { JSONObject jsonObject = new JSONObject(); @@ -227,7 +229,7 @@ public class KwMeterController extends BaseController { } c = row.getCell(6,Row.MissingCellPolicy.RETURN_BLANK_AS_NULL); - if (c != null) { + if (c != null && c.getCellType() == CellType.STRING ) { String imei = c.getStringCellValue(); KwBox kwBox = new KwBox(); kwBox.setImei(imei); @@ -243,7 +245,7 @@ public class KwMeterController extends BaseController { addOrUpdate(kwMeter); c = row.getCell(7,Row.MissingCellPolicy.RETURN_BLANK_AS_NULL); - if (c != null) { + if (c != null && c.getCellType() == CellType.STRING ) { String merchantName = c.getStringCellValue(); Optional wxMerchant = wxMerchantService.findByName(merchantName); if (wxMerchant.isPresent()) { From d0ad1b31767e0567a60302117a582826d8995eb7 Mon Sep 17 00:00:00 2001 From: gongbiao Date: Wed, 7 Aug 2019 15:21:52 +0800 Subject: [PATCH 2/2] =?UTF-8?q?[=E8=B4=A6=E5=8D=95][=E4=BF=AE=E6=94=B9][?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E6=97=B6=E9=80=BE=E6=9C=9F=E5=A4=A9=E6=95=B0?= =?UTF-8?q?=E9=97=AE=E9=A2=98]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/WxBillAllServiceImpl.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 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 b025dd310..a90b3b4e1 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java @@ -1038,11 +1038,12 @@ public class WxBillAllServiceImpl implements WxBillAllService { if (daily != null) { if (!daily.getStatus().equals(EnumBillRentStatus.PAID.getCode())) { long allPay = new BigDecimal(daily.getPay()).add(new BigDecimal(pay)).longValueExact(); + daily.setExpiredDay(0L); if (allPay >= receivePay) { daily.setStatus(EnumBillRentStatus.PAID.getCode()); + } else { Date payDate = bill.getPayDate(); Date receiveDate = bill.getReceiveDate(); - daily.setExpiredDay(0L); if (payDate.after(receiveDate)) { int expiredDay = DateUtils.daysBetween(receiveDate, payDate); daily.setExpiredDay((long) expiredDay); @@ -1115,11 +1116,12 @@ public class WxBillAllServiceImpl implements WxBillAllService { if (other != null) { if (!other.getStatus().equals(EnumBillRentStatus.PAID.getCode())) { long allPay = new BigDecimal(other.getPay()).add(new BigDecimal(pay)).longValueExact(); + other.setExpiredDay(0L); if (allPay >= receivePay) { other.setStatus(EnumBillRentStatus.PAID.getCode()); + } else { Date payDate = bill.getPayDate(); Date receiveDate = bill.getReceiveDate(); - other.setExpiredDay(0L); if (payDate.after(receiveDate)) { int expiredDay = DateUtils.daysBetween(receiveDate, payDate); other.setExpiredDay((long) expiredDay); @@ -1195,11 +1197,12 @@ public class WxBillAllServiceImpl implements WxBillAllService { if (otherDeposit != null) { if (!otherDeposit.getStatus().equals(EnumBillRentStatus.PAID.getCode()) && !otherDeposit.getStatus().equals(EnumBillRentStatus.RETURN.getCode())) { long allPay = new BigDecimal(otherDeposit.getPay()).add(new BigDecimal(pay)).longValueExact(); + otherDeposit.setExpiredDay(0L); if (allPay >= receivePay) { otherDeposit.setStatus(EnumBillRentStatus.PAID.getCode()); + } else { Date payDate = bill.getPayDate(); Date receiveDate = bill.getReceiveDate(); - otherDeposit.setExpiredDay(0L); if (payDate.after(receiveDate)) { int expiredDay = DateUtils.daysBetween(receiveDate, payDate); otherDeposit.setExpiredDay((long) expiredDay); @@ -1288,11 +1291,12 @@ public class WxBillAllServiceImpl implements WxBillAllService { WxBillRent rent = wxBillRentMapper.selectBillOne(rentQuery); if (rent != null && !rent.getStatus().equals(EnumBillRentStatus.PAID.getCode())) { long pay = new BigDecimal(bill.getPayStr()).multiply(new BigDecimal(100)).longValueExact(); + rent.setExpiredDay(0L); if (rent.getOwe() <= pay) { rent.setStatus(EnumBillRentStatus.PAID.getCode()); + } else { Date payDate = bill.getPayDate(); Date receiveDate = bill.getReceiveDate(); - rent.setExpiredDay(0L); if (payDate.after(receiveDate)) { int expiredDay = DateUtils.daysBetween(receiveDate, payDate); rent.setExpiredDay((long) expiredDay); @@ -1320,11 +1324,12 @@ public class WxBillAllServiceImpl implements WxBillAllService { WxBillProperty property = wxBillPropertyMapper.selectBillOne(propertyQuery); if (property != null && !property.getStatus().equals(EnumBillRentStatus.PAID.getCode())) { long pay = new BigDecimal(bill.getPayStr()).multiply(new BigDecimal(100)).longValueExact(); + property.setExpiredDay(0L); if (property.getOwe() <= pay) { property.setStatus(EnumBillRentStatus.PAID.getCode()); + } else { Date payDate = bill.getPayDate(); Date receiveDate = bill.getReceiveDate(); - property.setExpiredDay(0L); if (payDate.after(receiveDate)) { int expiredDay = DateUtils.daysBetween(receiveDate, payDate); property.setExpiredDay((long) expiredDay);