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 899364496..f89da10f7 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/device/KwMeterController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/device/KwMeterController.java @@ -177,6 +177,17 @@ public class KwMeterController extends BaseController { kwMerchantMeterService.saveOrUpdate(kwMerchantMeter); } + private void addOrUpdate(KwMeter kwMeter) { + KwMeter record = new KwMeter(); + record.setTenantId(getTenantId()); + record.setAddress(kwMeter.getAddress()); + record.setStatus(EnumMeterStatus.VALID.getCode()); + List kwMeters = kwMeterService.findList(record); + if (kwMeters.size() > 0) + kwMeter.setId(kwMeters.get(0).getId()); + kwMeterService.saveOrUpdate(kwMeter); + } + @ApiOperation("导入设备") @PostMapping(value = "import", consumes = "multipart/*") @SystemControllerLog(description = "电表管理-导入数据") @@ -190,6 +201,8 @@ public class KwMeterController extends BaseController { XSSFSheet sheet = workbook.getSheetAt(0); for (int i = 1; i < sheet.getPhysicalNumberOfRows(); i++) { XSSFRow row = sheet.getRow(i); + if (row == null) + continue; KwMeter kwMeter = new KwMeter(); Cell c = row.getCell(0,Row.MissingCellPolicy.RETURN_BLANK_AS_NULL); if (c != null) { @@ -226,7 +239,7 @@ public class KwMeterController extends BaseController { kwMeter.setBoxId(kwBox.getId()); } - add(kwMeter); + addOrUpdate(kwMeter); c = row.getCell(7,Row.MissingCellPolicy.RETURN_BLANK_AS_NULL); if (c != null) { diff --git a/mallinkService/src/main/java/com/iformall/domain/vo/WxRentPropertyContractVo.java b/mallinkService/src/main/java/com/iformall/domain/vo/WxRentPropertyContractVo.java index ef336e23e..dc414116a 100644 --- a/mallinkService/src/main/java/com/iformall/domain/vo/WxRentPropertyContractVo.java +++ b/mallinkService/src/main/java/com/iformall/domain/vo/WxRentPropertyContractVo.java @@ -74,5 +74,8 @@ public class WxRentPropertyContractVo extends BaseEntity { @io.swagger.annotations.ApiModelProperty(value = "物业费单价单位", name = "propertyPriceUnit") private Integer propertyPriceUnit; + + @io.swagger.annotations.ApiModelProperty(value = "审批流类型", name = "businessType") + private Integer businessType; } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java index e68252599..cb8929eeb 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java @@ -18,7 +18,6 @@ import com.iformall.mapper.*; import com.iformall.mq.MqBaseProducer; import com.iformall.service.*; import com.iformall.utils.Constant; -import com.iformall.utils.DateUtils; import com.iformall.utils.JsonUtil; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.map.HashedMap; @@ -42,7 +41,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; - import java.lang.reflect.Field; import java.text.SimpleDateFormat; import java.util.*; @@ -167,7 +165,11 @@ public class WxFlowServiceImpl implements WxFlowService { || EnumFlowKey.NEW_RENT_END.getCode().equals(flowType) || EnumFlowKey.NEW_RENT_POINT_CONTRACT_END.getCode().equals(flowType) ){ - if(EnumFlowContractType.RENT.getCode().equals(contractType) || EnumFlowContractType.RENT_POINT.getCode().equals(contractType) ){ + if(EnumFlowContractType.RENT.getCode().equals(contractType) || + EnumFlowContractType.RENT_POINT.getCode().equals(contractType) || + EnumFlowContractType.RENT_POINT.getCode().equals(contractType) || + EnumFlowContractType.WHOLE_SHOP.getCode().equals(contractType) || + EnumFlowContractType.WHOLE_POINT.getCode().equals(contractType)){ WxRentContract rent = new WxRentContract(); rent.setId(businessId); rent.setApplyStatus(applyStatus); 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 a6928d573..d23313a3c 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java @@ -1139,7 +1139,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { SimpleDateFormat sdMR = new SimpleDateFormat("MM-dd"); SimpleDateFormat sdM = new SimpleDateFormat("yyyy-MM"); if(i == billTimeVoListSize - 1){//最后 - if(sdMR.format(startDate).equals(sdMR.format(wxRentContract.getStartDate())) && sdMR.format(endDate).equals(sdMR.format(wxRentContract.getEndDate())) ){ + if(sdMR.format(startDate).equals(sdMR.format(wxRentContract.getRentalStartDate())) && sdMR.format(endDate).equals(sdMR.format(wxRentContract.getRentalEndDate())) ){ int months = getMonths(sdM.format(startDate)+"-01",sdM.format(endDate)+"-01"); months++; needpay = new Double(months * priceD).longValue(); diff --git a/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml b/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml index 04e17a1ed..cbd90698f 100644 --- a/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml @@ -326,7 +326,8 @@ select rc.id,rc.merchant_name,rc.rental_start_date,rc.rental_end_date,rc.`status`, rc.price as rent_price,rc.contract_number,s.shop_number,rc.type,rc.apply_status, rc.rent_shop_type,rc.rent_info,pc.price as property_price,rc.merchant_id,pc.`status` as property_status, - rc.price_unit as rent_price_unit,pc.price_unit as property_price_unit + rc.price_unit as rent_price_unit,pc.price_unit as property_price_unit, + rc.business_type businessType from wx_rent_contract rc left join wx_property_contract pc on rc.id=pc.rent_contract_id left join wx_shop s on rc.shop_id=s.id