Browse Source

1.0.0 修改地块id的生成策略

feature/v1.0.0
peihao 4 years ago
parent
commit
cad79d40a5
  1. 2
      air/src/main/java/com/air/land/controller/LandListedController.java
  2. 2
      air/src/main/java/com/air/land/controller/LandToListController.java
  3. 13
      air/src/main/java/com/air/land/mapper/LandListedMapper.java
  4. 12
      air/src/main/java/com/air/land/mapper/LandToListMapper.java
  5. 9
      air/src/main/java/com/air/land/service/LandListedService.java
  6. 8
      air/src/main/java/com/air/land/service/LandToListService.java
  7. 7
      air/src/main/java/com/air/land/service/impl/LandListedServiceImpl.java
  8. 2
      air/src/main/java/com/air/land/service/impl/LandToListSendServiceImpl.java
  9. 141
      air/src/main/java/com/air/land/service/impl/LandToListServiceImpl.java
  10. 11
      air/src/main/java/com/air/utils/DateUtil.java

2
air/src/main/java/com/air/land/controller/LandListedController.java

@ -136,7 +136,7 @@ public class LandListedController {
public R<String> saveLandListed(@RequestBody LandListedVo landListedVo) {
LandListed landListed = new LandListed();
BeanUtil.copyProperties(landListedVo, landListed);
landListed.setLandListedId(DateUtil.landListedIdfromDate(LocalDateTime.now(),"yyyyMMddHHmmssSSS"));
landListed.setLandListedId(DateUtil.landListedIdfromDate(LocalDateTime.now(),"yyyyMMdd",landListedService.selectId()));
if (landListed.getDeal() == null){
landListed.setDeal(0);
}

2
air/src/main/java/com/air/land/controller/LandToListController.java

@ -125,7 +125,7 @@ public class LandToListController {
public R addlandToList(@RequestBody LandToListVo landToListVo) {
LandToList landToList = new LandToList();
BeanUtil.copyProperties(landToListVo, landToList);
landToList.setProposedseriaId(DateUtil.landListedIdfromDate(LocalDateTime.now(),"yyyyMMddHHmmssSSS"));
landToList.setProposedseriaId(DateUtil.landToListIdfromDate(LocalDateTime.now(),"yyyyMMdd",landToListService.selectId()));
landToList.setStatusCd(Constant.LAND_TO_STATUS_1000);
landToListService.save(landToList);
return R.ok(landToList.getProposedseriaId());

13
air/src/main/java/com/air/land/mapper/LandListedMapper.java

@ -6,9 +6,11 @@ import com.air.land.dto.LandListedDto;
import com.air.land.dto.LandListedStatisticsDto;
import com.air.land.entity.LandListed;
import com.air.land.vo.LandListedAppletsVo;
import com.baomidou.mybatisplus.annotation.SqlParser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
@ -63,4 +65,15 @@ public interface LandListedMapper extends BaseMapper<LandListed> {
* @return
**/
List<LandListedStatisticsDto> appletsCalendarToAuctionDate(@Param("auctionDate") String auctionDate , @Param("city") String city,@Param("canton") String canton);
/**
* 获取序列
* @author peihao
* @date 2021/8/16
* @return
**/
@SqlParser(filter = true)
@Select("select nextval('land_list_id')")
Integer selectId();
}

12
air/src/main/java/com/air/land/mapper/LandToListMapper.java

@ -4,9 +4,11 @@ import com.air.applets.dto.LandDto;
import com.air.applets.dto.MeasureTrendDto;
import com.air.applets.vo.LandVo;
import com.air.land.entity.LandToList;
import com.baomidou.mybatisplus.annotation.SqlParser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
@ -29,4 +31,14 @@ public interface LandToListMapper extends BaseMapper<LandToList> {
**/
List<LandDto> appletsLandToList(Page page , @Param("landVo") LandVo landVo);
/**
* 获取序列
* @author peihao
* @date 2021/8/16
* @return
**/
@SqlParser(filter = true)
@Select("select nextval('land_to_list_id')")
Integer selectId();
}

9
air/src/main/java/com/air/land/service/LandListedService.java

@ -71,4 +71,13 @@ public interface LandListedService extends IService<LandListed> {
* @return
**/
List<LandDto> appletsLandListed(Page page , LandVo landVo);
/**
* 获取序列
* @author peihao
* @date 2021/8/16
* @return
**/
Integer selectId();
}

8
air/src/main/java/com/air/land/service/LandToListService.java

@ -27,4 +27,12 @@ public interface LandToListService extends IService<LandToList> {
List<LandDto> appletsLandToList(Page page ,LandVo landVo);
/**
* 获取序列
* @author peihao
* @date 2021/8/16
* @return
**/
Integer selectId();
}

7
air/src/main/java/com/air/land/service/impl/LandListedServiceImpl.java

@ -127,6 +127,11 @@ public class LandListedServiceImpl extends ServiceImpl<LandListedMapper, LandLis
return landDtos;
}
@Override
public Integer selectId() {
return baseMapper.selectId();
}
/**
* 导入地块数据
*
@ -146,7 +151,7 @@ public class LandListedServiceImpl extends ServiceImpl<LandListedMapper, LandLis
XSSFRow sheetRow = sheet.getRow(i);
LandListed landListed = new LandListed();
landListed.setDeal(0);
landListed.setLandListedId(DateUtil.landListedIdfromDate(LocalDateTime.now(), "yyyyMMddHHmmssSSS"));
landListed.setLandListedId(DateUtil.landListedIdfromDate(LocalDateTime.now(), "yyyyMMdd",this.selectId()));
landListed.setAnnoId(getCellValue(sheetRow.getCell(0)));
landListed.setLandCode(getCellStrValue(sheetRow.getCell(1)));
landListed.setLandPosition(getCellStrValue(sheetRow.getCell(2)));

2
air/src/main/java/com/air/land/service/impl/LandToListSendServiceImpl.java

@ -62,7 +62,7 @@ public class LandToListSendServiceImpl implements LandToListSendService {
landListed.setStatusCd(Constant.LAND_STATUS_1000);
if (land == null) {
//不存在 直接copy主表及从表数据
landListed.setLandListedId(DateUtil.landListedIdfromDate(LocalDateTime.now(), "yyyyMMddHHmmssSSS"));
landListed.setLandListedId(DateUtil.landListedIdfromDate(LocalDateTime.now(), "yyyyMMdd",landListedService.selectId()));
landListedService.save(landListed);
//copy经纬度
saveLandListedLonLat(proposedseriaId, landListed.getLandListedId());

141
air/src/main/java/com/air/land/service/impl/LandToListServiceImpl.java

@ -24,6 +24,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
@ -99,6 +100,11 @@ public class LandToListServiceImpl extends ServiceImpl<LandToListMapper, LandToL
return landDtos;
}
@Override
public Integer selectId() {
return baseMapper.selectId();
}
private List<String> entityToList(LandToList data) {
List<String> list = new ArrayList<>();
list.add(data.getProposedseriaId());
@ -179,72 +185,73 @@ public class LandToListServiceImpl extends ServiceImpl<LandToListMapper, LandToL
}
private LandToList listToEntity(List<String> data) {
LandToList landListed = new LandToList();
landListed.setAnnoId(data.get(0));
landListed.setLandCode(data.get(1));
landListed.setLandPosition(data.get(2));
landListed.setLandUsage(data.get(3));
landListed.setLandTransferSquare(data.get(4));
landListed.setLandTransferMu(data.get(5));
landListed.setTotalConsArea(data.get(6));
landListed.setPlotRatio(data.get(7));
landListed.setBuildingDensity(data.get(8));
landListed.setGreenSpaceRatio(data.get(9));
landListed.setHeighPermitted(data.get(10));
landListed.setRemiseYears(data.get(11));
landListed.setTransferPrice(data.get(12));
landListed.setStartingFloorPrice(data.get(13));
landListed.setBidMargin(data.get(14));
landListed.setBizRemark(data.get(15));
landListed.setAnnoDate(DateUtil.fromLocalDate(data.get(16),"yyyy-MM-dd"));
landListed.setAuctionDate(DateUtil.fromLocalDate(data.get(17),"yyyy-MM-dd"));
landListed.setLicensedArea(data.get(18));
landListed.setBizSpace(data.get(19));
landListed.setCommerceSpace(data.get(20));
landListed.setRemark(data.get(21));
landListed.setAllocationCapacity(data.get(22));
landListed.setAllocationNotCapacity(data.get(23));
landListed.setGeologicHazard(data.get(24));
landListed.setCivilAirDefence(data.get(25));
landListed.setSpecialPlan(data.get(26));
landListed.setAssemblyBuilding(data.get(27));
landListed.setGreenBuilding(data.get(28));
landListed.setOtherConditions(data.get(29));
landListed.setPercentFinishedHousing(data.get(30));
landListed.setBiddingConditions(data.get(31));
landListed.setHookForm(data.get(32));
landListed.setFirstGovernance(data.get(33));
landListed.setLandEnterprises(data.get(33));
landListed.setPaymentRhythm(data.get(34));
landListed.setBargainor(data.get(35));
landListed.setCity(data.get(36));
landListed.setCanton(data.get(37));
landListed.setSpecialZone(data.get(38));
landListed.setLoopWire(data.get(39));
landListed.setBigGroup(data.get(40));
landListed.setSmallGroup(data.get(41));
landListed.setOvePosition(data.get(42));
landListed.setLonLatBd(data.get(43));
landListed.setAnnoId(data.get(44));
landListed.setLandPosition(data.get(45));
landListed.setTransferMode(data.get(46));
landListed.setAssignee(data.get(47));
landListed.setLandEnterpriseShort(data.get(48));
landListed.setDealPrice(data.get(49));
landListed.setPremiumRate(data.get(50));
landListed.setCommercialSelfRatio(data.get(51));
landListed.setHomeSelfRatio(data.get(52));
landListed.setPercentUnpaid(data.get(53));
landListed.setTalenApartmentArea(data.get(54));
landListed.setParticipatingEnterprises(data.get(55));
landListed.setProjectStatus(data.get(56));
landListed.setBuildingName(data.get(57));
landListed.setProjectCompany(data.get(58));
landListed.setConfirmationTime(DateUtil.fromLocalDate(data.get(59),"yyyy-MM-dd"));
landListed.setTradingEnterprises(data.get(60));
landListed.setPartner(data.get(61));
landListed.setConductEnterprise(data.get(62));
landListed.setFirstOpenTime(DateUtil.fromLocalDate(data.get(63),"yyyy-MM-dd"));
return landListed;
LandToList landToList = new LandToList();
landToList.setAnnoId(data.get(0));
landToList.setLandCode(data.get(1));
landToList.setLandPosition(data.get(2));
landToList.setLandUsage(data.get(3));
landToList.setLandTransferSquare(data.get(4));
landToList.setLandTransferMu(data.get(5));
landToList.setTotalConsArea(data.get(6));
landToList.setPlotRatio(data.get(7));
landToList.setBuildingDensity(data.get(8));
landToList.setGreenSpaceRatio(data.get(9));
landToList.setHeighPermitted(data.get(10));
landToList.setRemiseYears(data.get(11));
landToList.setTransferPrice(data.get(12));
landToList.setStartingFloorPrice(data.get(13));
landToList.setBidMargin(data.get(14));
landToList.setBizRemark(data.get(15));
landToList.setAnnoDate(DateUtil.fromLocalDate(data.get(16),"yyyy-MM-dd"));
landToList.setAuctionDate(DateUtil.fromLocalDate(data.get(17),"yyyy-MM-dd"));
landToList.setLicensedArea(data.get(18));
landToList.setBizSpace(data.get(19));
landToList.setCommerceSpace(data.get(20));
landToList.setRemark(data.get(21));
landToList.setAllocationCapacity(data.get(22));
landToList.setAllocationNotCapacity(data.get(23));
landToList.setGeologicHazard(data.get(24));
landToList.setCivilAirDefence(data.get(25));
landToList.setSpecialPlan(data.get(26));
landToList.setAssemblyBuilding(data.get(27));
landToList.setGreenBuilding(data.get(28));
landToList.setOtherConditions(data.get(29));
landToList.setPercentFinishedHousing(data.get(30));
landToList.setBiddingConditions(data.get(31));
landToList.setHookForm(data.get(32));
landToList.setFirstGovernance(data.get(33));
landToList.setLandEnterprises(data.get(33));
landToList.setPaymentRhythm(data.get(34));
landToList.setBargainor(data.get(35));
landToList.setCity(data.get(36));
landToList.setCanton(data.get(37));
landToList.setSpecialZone(data.get(38));
landToList.setLoopWire(data.get(39));
landToList.setBigGroup(data.get(40));
landToList.setSmallGroup(data.get(41));
landToList.setOvePosition(data.get(42));
landToList.setLonLatBd(data.get(43));
landToList.setAnnoId(data.get(44));
landToList.setLandPosition(data.get(45));
landToList.setTransferMode(data.get(46));
landToList.setAssignee(data.get(47));
landToList.setLandEnterpriseShort(data.get(48));
landToList.setDealPrice(data.get(49));
landToList.setPremiumRate(data.get(50));
landToList.setCommercialSelfRatio(data.get(51));
landToList.setHomeSelfRatio(data.get(52));
landToList.setPercentUnpaid(data.get(53));
landToList.setTalenApartmentArea(data.get(54));
landToList.setParticipatingEnterprises(data.get(55));
landToList.setProjectStatus(data.get(56));
landToList.setBuildingName(data.get(57));
landToList.setProjectCompany(data.get(58));
landToList.setConfirmationTime(DateUtil.fromLocalDate(data.get(59),"yyyy-MM-dd"));
landToList.setTradingEnterprises(data.get(60));
landToList.setPartner(data.get(61));
landToList.setConductEnterprise(data.get(62));
landToList.setFirstOpenTime(DateUtil.fromLocalDate(data.get(63),"yyyy-MM-dd"));
landToList.setProposedseriaId(DateUtil.landToListIdfromDate(LocalDateTime.now(), "yyyyMMdd",this.selectId()));
return landToList;
}
}

11
air/src/main/java/com/air/utils/DateUtil.java

@ -108,9 +108,16 @@ public class DateUtil {
return fmt.format(dateString);
}
public static String landListedIdfromDate(LocalDateTime dateString,String pattern){
public static String landListedIdfromDate(LocalDateTime dateString,String pattern,Integer sequence){
DateTimeFormatter fmt = DateTimeFormatter.ofPattern(pattern);
return "CQ"+fmt.format(dateString)+"0";
String seq = String.format("%04d", Integer.parseInt("0000") + sequence);
return "CQ"+fmt.format(dateString)+seq;
}
public static String landToListIdfromDate(LocalDateTime dateString,String pattern,Integer sequence){
DateTimeFormatter fmt = DateTimeFormatter.ofPattern(pattern);
String seq = String.format("%04d", Integer.parseInt("0000") + sequence);
return "NICQ"+fmt.format(dateString)+seq;
}
}

Loading…
Cancel
Save