fix(local-material): 修改地材上传
This commit is contained in:
@@ -27,7 +27,7 @@ public class MaterialTaskType {
|
||||
public static final Integer FUJIAN_DEPARTMENT = 701;
|
||||
// 发改委
|
||||
public static final Integer OIL = 801; // 汽柴油
|
||||
// 地材
|
||||
// 地材(废弃)
|
||||
public static final Integer LOCAL_MEDIUM_COARSE_SAND = 901; // 中粗砂
|
||||
public static final Integer LOCAL_MECHANISM_SAND = 902; // 机制砂
|
||||
public static final Integer LOCAL_GRAVEL = 903; // 碎石
|
||||
@@ -38,6 +38,16 @@ public class MaterialTaskType {
|
||||
// 辅材
|
||||
public static final Integer ASPHALT_MODIFIER = 1001; // 改性剂
|
||||
|
||||
// 新地材
|
||||
public static final Integer LOCAL_FUZHOU = 1101; // 福州
|
||||
public static final Integer LOCAL_LONGYAN = 1102; // 龙岩
|
||||
public static final Integer LOCAL_NANPING = 1103; // 南平
|
||||
public static final Integer LOCAL_NINGDE = 1104; // 宁德
|
||||
public static final Integer LOCAL_PUTIAN = 1105; // 莆田
|
||||
public static final Integer LOCAL_QUANZHOU = 1106; // 泉州
|
||||
public static final Integer LOCAL_SANMING = 1107; // 三明
|
||||
public static final Integer LOCAL_ZHANGZHOU = 1108; // 漳州
|
||||
|
||||
public static final List<Integer> list = List.of(
|
||||
MY_STEEL_REBAR,
|
||||
MY_STEEL_SECTION,
|
||||
@@ -55,13 +65,15 @@ public class MaterialTaskType {
|
||||
OTHER_YUNNAN,
|
||||
FUJIAN_DEPARTMENT,
|
||||
OIL,
|
||||
LOCAL_MEDIUM_COARSE_SAND,
|
||||
LOCAL_MECHANISM_SAND,
|
||||
LOCAL_GRAVEL,
|
||||
LOCAL_MAOTIAO_STONE,
|
||||
LOCAL_FINE_AGGREGATE,
|
||||
LOCAL_COARSE_AGGREGATE,
|
||||
LOCAL_CLAY
|
||||
|
||||
LOCAL_FUZHOU,
|
||||
LOCAL_LONGYAN,
|
||||
LOCAL_NANPING,
|
||||
LOCAL_NINGDE,
|
||||
LOCAL_PUTIAN,
|
||||
LOCAL_QUANZHOU,
|
||||
LOCAL_SANMING,
|
||||
LOCAL_ZHANGZHOU
|
||||
);
|
||||
|
||||
public static boolean isFromSpider(Integer type) {
|
||||
@@ -77,13 +89,14 @@ public class MaterialTaskType {
|
||||
|
||||
public static boolean isLocalMaterial(Integer type) {
|
||||
var dataFromSpiderTypes = List.of(
|
||||
LOCAL_MEDIUM_COARSE_SAND,
|
||||
LOCAL_MECHANISM_SAND,
|
||||
LOCAL_GRAVEL,
|
||||
LOCAL_MAOTIAO_STONE,
|
||||
LOCAL_FINE_AGGREGATE,
|
||||
LOCAL_COARSE_AGGREGATE,
|
||||
LOCAL_CLAY
|
||||
LOCAL_FUZHOU,
|
||||
LOCAL_LONGYAN,
|
||||
LOCAL_NANPING,
|
||||
LOCAL_NINGDE,
|
||||
LOCAL_PUTIAN,
|
||||
LOCAL_QUANZHOU,
|
||||
LOCAL_SANMING,
|
||||
LOCAL_ZHANGZHOU
|
||||
);
|
||||
return dataFromSpiderTypes.contains(type);
|
||||
}
|
||||
|
@@ -1,5 +1,6 @@
|
||||
package mjkf.xinke.main.model.db;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
@@ -68,6 +69,14 @@ public class LocalMaterial extends Model<LocalMaterial> {
|
||||
@TableField("`DATE`")
|
||||
private LocalDate date;
|
||||
|
||||
@ApiModelProperty("位置")
|
||||
@TableField("`POSITION`")
|
||||
private String position;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
@TableField("`REMARK`")
|
||||
private String remark;
|
||||
|
||||
@Override
|
||||
public Serializable pkVal() {
|
||||
return this.id;
|
||||
@@ -76,13 +85,23 @@ public class LocalMaterial extends Model<LocalMaterial> {
|
||||
public LocalMaterial() {}
|
||||
|
||||
public LocalMaterial (Row row) {
|
||||
this.setName(row.getCell(0).getStringCellValue());
|
||||
this.setCity(row.getCell(1).getStringCellValue());
|
||||
this.setCounty(row.getCell(2).getStringCellValue());
|
||||
this.setPrice(BigDecimal.valueOf(row.getCell(3).getNumericCellValue()));
|
||||
this.setDate(row.getCell(4).getLocalDateTimeCellValue().toLocalDate());
|
||||
this.setSpec(row.getCell(5).getStringCellValue());
|
||||
this.setUnit(row.getCell(6).getStringCellValue());
|
||||
var policy = Row.MissingCellPolicy.CREATE_NULL_AS_BLANK;
|
||||
this.setDate(row.getCell(0, policy).getLocalDateTimeCellValue().toLocalDate());
|
||||
this.setCity(row.getCell(1, policy).getStringCellValue());
|
||||
this.setCounty(row.getCell(2, policy).getStringCellValue());
|
||||
this.setName(row.getCell(3, policy).getStringCellValue());
|
||||
this.setSpec(row.getCell(4, policy).getStringCellValue());
|
||||
this.setUnit(row.getCell(5, policy).getStringCellValue());
|
||||
this.setPrice(BigDecimal.valueOf(row.getCell(6, policy).getNumericCellValue()));
|
||||
this.setPosition(row.getCell(8, policy).getStringCellValue());
|
||||
this.setRemark(row.getCell(9, policy).getStringCellValue());
|
||||
|
||||
if (ObjectUtil.isNotEmpty(this.name)) {
|
||||
this.name = this.name.replace(" ", "");
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(this.spec)) {
|
||||
this.spec = this.spec.replace(" ", "");
|
||||
}
|
||||
}
|
||||
|
||||
public LocalMaterial update(LocalMaterial item) {
|
||||
@@ -93,6 +112,8 @@ public class LocalMaterial extends Model<LocalMaterial> {
|
||||
this.setDate(item.getDate());
|
||||
this.setSpec(item.getSpec());
|
||||
this.setUnit(item.getUnit());
|
||||
this.setPosition(item.getPosition());
|
||||
this.setRemark(item.getRemark());
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
@@ -158,19 +158,7 @@ public class MaterialResultService {
|
||||
// service = fujianDepartmentService;
|
||||
} else if (type.equals(MaterialTaskType.OIL)) {
|
||||
service = oilService;
|
||||
} else if (type.equals(MaterialTaskType.LOCAL_MEDIUM_COARSE_SAND)) {
|
||||
service = localMaterialService;
|
||||
} else if (type.equals(MaterialTaskType.LOCAL_MECHANISM_SAND)) {
|
||||
service = localMaterialService;
|
||||
} else if (type.equals(MaterialTaskType.LOCAL_GRAVEL)) {
|
||||
service = localMaterialService;
|
||||
} else if (type.equals(MaterialTaskType.LOCAL_MAOTIAO_STONE)) {
|
||||
service = localMaterialService;
|
||||
} else if (type.equals(MaterialTaskType.LOCAL_FINE_AGGREGATE)) {
|
||||
service = localMaterialService;
|
||||
} else if (type.equals(MaterialTaskType.LOCAL_COARSE_AGGREGATE)) {
|
||||
service = localMaterialService;
|
||||
} else if (type.equals(MaterialTaskType.LOCAL_CLAY)) {
|
||||
} else if (MaterialTaskType.isLocalMaterial(type)) {
|
||||
service = localMaterialService;
|
||||
} else {
|
||||
|
||||
|
Reference in New Issue
Block a user