| @@ -177,6 +177,17 @@ public class KwMeterController extends BaseController { | |||||
| kwMerchantMeterService.saveOrUpdate(kwMerchantMeter); | 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<KwMeter> kwMeters = kwMeterService.findList(record); | |||||
| if (kwMeters.size() > 0) | |||||
| kwMeter.setId(kwMeters.get(0).getId()); | |||||
| kwMeterService.saveOrUpdate(kwMeter); | |||||
| } | |||||
| @ApiOperation("导入设备") | @ApiOperation("导入设备") | ||||
| @PostMapping(value = "import", consumes = "multipart/*") | @PostMapping(value = "import", consumes = "multipart/*") | ||||
| @SystemControllerLog(description = "电表管理-导入数据") | @SystemControllerLog(description = "电表管理-导入数据") | ||||
| @@ -190,6 +201,8 @@ public class KwMeterController extends BaseController { | |||||
| XSSFSheet sheet = workbook.getSheetAt(0); | XSSFSheet sheet = workbook.getSheetAt(0); | ||||
| for (int i = 1; i < sheet.getPhysicalNumberOfRows(); i++) { | for (int i = 1; i < sheet.getPhysicalNumberOfRows(); i++) { | ||||
| XSSFRow row = sheet.getRow(i); | XSSFRow row = sheet.getRow(i); | ||||
| if (row == null) | |||||
| 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) { | ||||
| @@ -226,7 +239,7 @@ public class KwMeterController extends BaseController { | |||||
| kwMeter.setBoxId(kwBox.getId()); | kwMeter.setBoxId(kwBox.getId()); | ||||
| } | } | ||||
| add(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) { | ||||
| @@ -74,5 +74,8 @@ public class WxRentPropertyContractVo extends BaseEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value = "物业费单价单位", name = "propertyPriceUnit") | @io.swagger.annotations.ApiModelProperty(value = "物业费单价单位", name = "propertyPriceUnit") | ||||
| private Integer propertyPriceUnit; | private Integer propertyPriceUnit; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "审批流类型", name = "businessType") | |||||
| private Integer businessType; | |||||
| } | } | ||||
| @@ -18,7 +18,6 @@ import com.iformall.mapper.*; | |||||
| import com.iformall.mq.MqBaseProducer; | import com.iformall.mq.MqBaseProducer; | ||||
| import com.iformall.service.*; | import com.iformall.service.*; | ||||
| import com.iformall.utils.Constant; | import com.iformall.utils.Constant; | ||||
| import com.iformall.utils.DateUtils; | |||||
| import com.iformall.utils.JsonUtil; | import com.iformall.utils.JsonUtil; | ||||
| import org.apache.commons.collections.CollectionUtils; | import org.apache.commons.collections.CollectionUtils; | ||||
| import org.apache.commons.collections.map.HashedMap; | 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.stereotype.Service; | ||||
| import org.springframework.transaction.annotation.Propagation; | import org.springframework.transaction.annotation.Propagation; | ||||
| import org.springframework.transaction.annotation.Transactional; | import org.springframework.transaction.annotation.Transactional; | ||||
| import java.lang.reflect.Field; | import java.lang.reflect.Field; | ||||
| import java.text.SimpleDateFormat; | import java.text.SimpleDateFormat; | ||||
| import java.util.*; | import java.util.*; | ||||
| @@ -167,7 +165,11 @@ public class WxFlowServiceImpl implements WxFlowService { | |||||
| || EnumFlowKey.NEW_RENT_END.getCode().equals(flowType) | || EnumFlowKey.NEW_RENT_END.getCode().equals(flowType) | ||||
| || EnumFlowKey.NEW_RENT_POINT_CONTRACT_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(); | WxRentContract rent = new WxRentContract(); | ||||
| rent.setId(businessId); | rent.setId(businessId); | ||||
| rent.setApplyStatus(applyStatus); | rent.setApplyStatus(applyStatus); | ||||
| @@ -1139,7 +1139,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| SimpleDateFormat sdMR = new SimpleDateFormat("MM-dd"); | SimpleDateFormat sdMR = new SimpleDateFormat("MM-dd"); | ||||
| SimpleDateFormat sdM = new SimpleDateFormat("yyyy-MM"); | SimpleDateFormat sdM = new SimpleDateFormat("yyyy-MM"); | ||||
| if(i == billTimeVoListSize - 1){//最后 | 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"); | int months = getMonths(sdM.format(startDate)+"-01",sdM.format(endDate)+"-01"); | ||||
| months++; | months++; | ||||
| needpay = new Double(months * priceD).longValue(); | needpay = new Double(months * priceD).longValue(); | ||||
| @@ -326,7 +326,8 @@ | |||||
| select rc.id,rc.merchant_name,rc.rental_start_date,rc.rental_end_date,rc.`status`, | 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.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.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 | 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 | left join wx_shop s on rc.shop_id=s.id | ||||
| <where> | <where> | ||||