Преглед изворни кода

Merge tag 'refs/tags/jenkins-back-end-2416' into release

develop
release_toaliyun_real
gongbiao пре 6 година
родитељ
комит
e93e56bb23
2 измењених фајлова са 20 додато и 13 уклоњено
  1. +10
    -8
      mallinkAdmin/src/main/java/com/iformall/controller/device/KwMeterController.java
  2. +10
    -5
      mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java

+ 10
- 8
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.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.poifs.filesystem.POIFSFileSystem; import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import org.apache.poi.ss.usermodel.Cell; 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.ss.usermodel.Row;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow; import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet; import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook;
@@ -202,22 +204,22 @@ public class KwMeterController extends BaseController {
continue; continue;
KwMeter kwMeter = new KwMeter(); KwMeter kwMeter = new KwMeter();
Cell c = row.getCell(0,Row.MissingCellPolicy.RETURN_BLANK_AS_NULL); 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()); kwMeter.setAddress(c.getStringCellValue());
} else { } else {
continue; continue;
} }
c = row.getCell(1,Row.MissingCellPolicy.RETURN_BLANK_AS_NULL); 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); 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); 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); 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); 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) { if (kwMeter.getProtocol() != null || kwMeter.getBandrate() != null) {
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
@@ -227,7 +229,7 @@ public class KwMeterController extends BaseController {
} }


c = row.getCell(6,Row.MissingCellPolicy.RETURN_BLANK_AS_NULL); c = row.getCell(6,Row.MissingCellPolicy.RETURN_BLANK_AS_NULL);
if (c != null) {
if (c != null && c.getCellType() == CellType.STRING ) {
String imei = c.getStringCellValue(); String imei = c.getStringCellValue();
KwBox kwBox = new KwBox(); KwBox kwBox = new KwBox();
kwBox.setImei(imei); kwBox.setImei(imei);
@@ -243,7 +245,7 @@ public class KwMeterController extends BaseController {
addOrUpdate(kwMeter); addOrUpdate(kwMeter);


c = row.getCell(7,Row.MissingCellPolicy.RETURN_BLANK_AS_NULL); c = row.getCell(7,Row.MissingCellPolicy.RETURN_BLANK_AS_NULL);
if (c != null) {
if (c != null && c.getCellType() == CellType.STRING ) {
String merchantName = c.getStringCellValue(); String merchantName = c.getStringCellValue();
Optional<WxMerchant> wxMerchant = wxMerchantService.findByName(merchantName); Optional<WxMerchant> wxMerchant = wxMerchantService.findByName(merchantName);
if (wxMerchant.isPresent()) { if (wxMerchant.isPresent()) {


+ 10
- 5
mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java Прегледај датотеку

@@ -1038,11 +1038,12 @@ public class WxBillAllServiceImpl implements WxBillAllService {
if (daily != null) { if (daily != null) {
if (!daily.getStatus().equals(EnumBillRentStatus.PAID.getCode())) { if (!daily.getStatus().equals(EnumBillRentStatus.PAID.getCode())) {
long allPay = new BigDecimal(daily.getPay()).add(new BigDecimal(pay)).longValueExact(); long allPay = new BigDecimal(daily.getPay()).add(new BigDecimal(pay)).longValueExact();
daily.setExpiredDay(0L);
if (allPay >= receivePay) { if (allPay >= receivePay) {
daily.setStatus(EnumBillRentStatus.PAID.getCode()); daily.setStatus(EnumBillRentStatus.PAID.getCode());
} else {
Date payDate = bill.getPayDate(); Date payDate = bill.getPayDate();
Date receiveDate = bill.getReceiveDate(); Date receiveDate = bill.getReceiveDate();
daily.setExpiredDay(0L);
if (payDate.after(receiveDate)) { if (payDate.after(receiveDate)) {
int expiredDay = DateUtils.daysBetween(receiveDate, payDate); int expiredDay = DateUtils.daysBetween(receiveDate, payDate);
daily.setExpiredDay((long) expiredDay); daily.setExpiredDay((long) expiredDay);
@@ -1115,11 +1116,12 @@ public class WxBillAllServiceImpl implements WxBillAllService {
if (other != null) { if (other != null) {
if (!other.getStatus().equals(EnumBillRentStatus.PAID.getCode())) { if (!other.getStatus().equals(EnumBillRentStatus.PAID.getCode())) {
long allPay = new BigDecimal(other.getPay()).add(new BigDecimal(pay)).longValueExact(); long allPay = new BigDecimal(other.getPay()).add(new BigDecimal(pay)).longValueExact();
other.setExpiredDay(0L);
if (allPay >= receivePay) { if (allPay >= receivePay) {
other.setStatus(EnumBillRentStatus.PAID.getCode()); other.setStatus(EnumBillRentStatus.PAID.getCode());
} else {
Date payDate = bill.getPayDate(); Date payDate = bill.getPayDate();
Date receiveDate = bill.getReceiveDate(); Date receiveDate = bill.getReceiveDate();
other.setExpiredDay(0L);
if (payDate.after(receiveDate)) { if (payDate.after(receiveDate)) {
int expiredDay = DateUtils.daysBetween(receiveDate, payDate); int expiredDay = DateUtils.daysBetween(receiveDate, payDate);
other.setExpiredDay((long) expiredDay); other.setExpiredDay((long) expiredDay);
@@ -1195,11 +1197,12 @@ public class WxBillAllServiceImpl implements WxBillAllService {
if (otherDeposit != null) { if (otherDeposit != null) {
if (!otherDeposit.getStatus().equals(EnumBillRentStatus.PAID.getCode()) && !otherDeposit.getStatus().equals(EnumBillRentStatus.RETURN.getCode())) { if (!otherDeposit.getStatus().equals(EnumBillRentStatus.PAID.getCode()) && !otherDeposit.getStatus().equals(EnumBillRentStatus.RETURN.getCode())) {
long allPay = new BigDecimal(otherDeposit.getPay()).add(new BigDecimal(pay)).longValueExact(); long allPay = new BigDecimal(otherDeposit.getPay()).add(new BigDecimal(pay)).longValueExact();
otherDeposit.setExpiredDay(0L);
if (allPay >= receivePay) { if (allPay >= receivePay) {
otherDeposit.setStatus(EnumBillRentStatus.PAID.getCode()); otherDeposit.setStatus(EnumBillRentStatus.PAID.getCode());
} else {
Date payDate = bill.getPayDate(); Date payDate = bill.getPayDate();
Date receiveDate = bill.getReceiveDate(); Date receiveDate = bill.getReceiveDate();
otherDeposit.setExpiredDay(0L);
if (payDate.after(receiveDate)) { if (payDate.after(receiveDate)) {
int expiredDay = DateUtils.daysBetween(receiveDate, payDate); int expiredDay = DateUtils.daysBetween(receiveDate, payDate);
otherDeposit.setExpiredDay((long) expiredDay); otherDeposit.setExpiredDay((long) expiredDay);
@@ -1288,11 +1291,12 @@ public class WxBillAllServiceImpl implements WxBillAllService {
WxBillRent rent = wxBillRentMapper.selectBillOne(rentQuery); WxBillRent rent = wxBillRentMapper.selectBillOne(rentQuery);
if (rent != null && !rent.getStatus().equals(EnumBillRentStatus.PAID.getCode())) { if (rent != null && !rent.getStatus().equals(EnumBillRentStatus.PAID.getCode())) {
long pay = new BigDecimal(bill.getPayStr()).multiply(new BigDecimal(100)).longValueExact(); long pay = new BigDecimal(bill.getPayStr()).multiply(new BigDecimal(100)).longValueExact();
rent.setExpiredDay(0L);
if (rent.getOwe() <= pay) { if (rent.getOwe() <= pay) {
rent.setStatus(EnumBillRentStatus.PAID.getCode()); rent.setStatus(EnumBillRentStatus.PAID.getCode());
} else {
Date payDate = bill.getPayDate(); Date payDate = bill.getPayDate();
Date receiveDate = bill.getReceiveDate(); Date receiveDate = bill.getReceiveDate();
rent.setExpiredDay(0L);
if (payDate.after(receiveDate)) { if (payDate.after(receiveDate)) {
int expiredDay = DateUtils.daysBetween(receiveDate, payDate); int expiredDay = DateUtils.daysBetween(receiveDate, payDate);
rent.setExpiredDay((long) expiredDay); rent.setExpiredDay((long) expiredDay);
@@ -1320,11 +1324,12 @@ public class WxBillAllServiceImpl implements WxBillAllService {
WxBillProperty property = wxBillPropertyMapper.selectBillOne(propertyQuery); WxBillProperty property = wxBillPropertyMapper.selectBillOne(propertyQuery);
if (property != null && !property.getStatus().equals(EnumBillRentStatus.PAID.getCode())) { if (property != null && !property.getStatus().equals(EnumBillRentStatus.PAID.getCode())) {
long pay = new BigDecimal(bill.getPayStr()).multiply(new BigDecimal(100)).longValueExact(); long pay = new BigDecimal(bill.getPayStr()).multiply(new BigDecimal(100)).longValueExact();
property.setExpiredDay(0L);
if (property.getOwe() <= pay) { if (property.getOwe() <= pay) {
property.setStatus(EnumBillRentStatus.PAID.getCode()); property.setStatus(EnumBillRentStatus.PAID.getCode());
} else {
Date payDate = bill.getPayDate(); Date payDate = bill.getPayDate();
Date receiveDate = bill.getReceiveDate(); Date receiveDate = bill.getReceiveDate();
property.setExpiredDay(0L);
if (payDate.after(receiveDate)) { if (payDate.after(receiveDate)) {
int expiredDay = DateUtils.daysBetween(receiveDate, payDate); int expiredDay = DateUtils.daysBetween(receiveDate, payDate);
property.setExpiredDay((long) expiredDay); property.setExpiredDay((long) expiredDay);


Loading…
Откажи
Сачувај