fix: 修复三明钢铁数据无法正常上传的问题

This commit is contained in:
han0
2025-02-13 09:47:47 +08:00
parent ea6a973b09
commit 0c870c22e4
4 changed files with 11 additions and 5 deletions

View File

@@ -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;
@@ -70,13 +71,17 @@ public class SanmingSteel extends Model<SanmingSteel> {
row.getCell(0).setCellType(CellType.STRING);
row.getCell(1).setCellType(CellType.STRING);
row.getCell(2).setCellType(CellType.STRING);
row.getCell(3).setCellType(CellType.NUMERIC);
this.setName(row.getCell(1, policy).getStringCellValue());
this.setSpec(row.getCell(2, policy).getStringCellValue());
this.setMaterial(row.getCell(0, policy).getStringCellValue());
this.setPrice(BigDecimal.valueOf(row.getCell(3, policy).getNumericCellValue()));
this.setFluctuating(BigDecimal.valueOf(row.getCell(4, policy).getNumericCellValue()));
//this.setFluctuating(BigDecimal.valueOf(row.getCell(4, policy).getNumericCellValue()));
// this.setDate(row.getCell(5, policy).getLocalDateTimeCellValue().toLocalDate());
this.setDate(LocalDate.of(task.getYear(), task.getMonth(), 1)); // 从任务获取日期
if (ObjectUtil.isEmpty(this.getMaterial())) {
throw new IllegalArgumentException("材料编码为空");
}
}
public SanmingSteel update(SanmingSteel item) {

View File

@@ -12,8 +12,6 @@ import java.util.Map;
public class SanmingSteelService extends DataService<BaseMapper<SanmingSteel>, SanmingSteel> {
public LambdaQueryWrapper<SanmingSteel> indexQuery(SanmingSteel data) {
LambdaQueryWrapper<SanmingSteel> query = new LambdaQueryWrapper<>();
query.eq(SanmingSteel::getName, data.getName());
query.eq(SanmingSteel::getSpec, data.getSpec());
query.eq(SanmingSteel::getMaterial, data.getMaterial());
query.eq(SanmingSteel::getDate, data.getDate());
return query;

View File

@@ -1,2 +1,4 @@
ALTER TABLE PRICE_RESULT ADD DISPLAY_DIGIT int default 1 comment '显示小数位数';
ALTER TABLE PRICE_PUBLISH ADD DISPLAY_DIGIT int default 1 comment '显示小数位数';
DROP INDEX Idx_key ON sanming_steel;