feat(material-task): 确认福建调查表上传
This commit is contained in:
@@ -2,23 +2,17 @@ package mjkf.xinke.main.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.jgy.xxs.core.http.exp.NcHttpException;
|
||||
import com.jgy.xxs.core.http.resp.HttpResponse;
|
||||
import com.jgy.xxs.core.http.resp.NcHttpResponse;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import mjkf.xinke.auth.core.util.StpLoginUserUtil;
|
||||
import mjkf.xinke.main.common.http.FuHttpResponse;
|
||||
import mjkf.xinke.main.constant.HttpErrorResponseEnum;
|
||||
import mjkf.xinke.main.model.db.MaterialTask;
|
||||
import mjkf.xinke.main.model.vo.MaterialTaskCreateRequest;
|
||||
import mjkf.xinke.main.service.DataToolService;
|
||||
import mjkf.xinke.main.service.MaterialTaskService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
|
@@ -12,6 +12,7 @@ import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.apache.poi.ss.usermodel.CellType;
|
||||
import org.apache.poi.ss.usermodel.Row;
|
||||
|
||||
/**
|
||||
@@ -49,6 +50,22 @@ public class FujianSurvey extends Model<FujianSurvey> {
|
||||
@TableField("`DATE`")
|
||||
private LocalDate date;
|
||||
|
||||
@ApiModelProperty("材料id")
|
||||
@TableField("`MATERIAL_ID`")
|
||||
private String materialId;
|
||||
|
||||
@ApiModelProperty("单位")
|
||||
@TableField("`UNIT`")
|
||||
private String unit;
|
||||
|
||||
@ApiModelProperty("品牌")
|
||||
@TableField("`BRAND`")
|
||||
private String brand;
|
||||
|
||||
@ApiModelProperty("税率")
|
||||
@TableField("`TAX`")
|
||||
private Integer tax;
|
||||
|
||||
@Override
|
||||
public Serializable pkVal() {
|
||||
return this.id;
|
||||
@@ -57,16 +74,25 @@ public class FujianSurvey extends Model<FujianSurvey> {
|
||||
public FujianSurvey () {}
|
||||
|
||||
public FujianSurvey (Row row) {
|
||||
this.setName(row.getCell(0).getStringCellValue());
|
||||
this.setSpec(row.getCell(1).getStringCellValue());
|
||||
this.setPrice(BigDecimal.valueOf(row.getCell(2).getNumericCellValue()));
|
||||
this.setDate(row.getCell(3).getLocalDateTimeCellValue().toLocalDate());
|
||||
var policy = Row.MissingCellPolicy.CREATE_NULL_AS_BLANK;
|
||||
row.getCell(0).setCellType(CellType.STRING);
|
||||
this.setMaterialId(row.getCell(0, policy).getStringCellValue());
|
||||
this.setName(row.getCell(1, policy).getStringCellValue());
|
||||
this.setSpec(row.getCell(2, policy).getStringCellValue());
|
||||
this.setUnit(row.getCell(3, policy).getStringCellValue());
|
||||
this.setBrand(row.getCell(4, policy).getStringCellValue());
|
||||
this.setPrice(BigDecimal.valueOf(row.getCell(5, policy).getNumericCellValue()));
|
||||
this.setTax(((Double) row.getCell(6, policy).getNumericCellValue()).intValue());
|
||||
this.setDate(row.getCell(7, policy).getLocalDateTimeCellValue().toLocalDate());
|
||||
}
|
||||
|
||||
public FujianSurvey update(FujianSurvey item) {
|
||||
this.setName(item.getName());
|
||||
this.setSpec(item.getSpec());
|
||||
this.setPrice(item.getPrice());
|
||||
this.setUnit(item.getUnit());
|
||||
this.setBrand(item.getBrand());
|
||||
this.setTax(item.getTax());
|
||||
this.setDate(item.getDate());
|
||||
return this;
|
||||
}
|
||||
|
51
src/main/java/mjkf/xinke/main/model/db/Oil.java
Normal file
51
src/main/java/mjkf/xinke/main/model/db/Oil.java
Normal file
@@ -0,0 +1,51 @@
|
||||
package mjkf.xinke.main.model.db;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 成品油
|
||||
* </p>
|
||||
*
|
||||
* @author han0
|
||||
* @since 2023-11-07
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("OIL")
|
||||
@ApiModel(value = "Oil对象", description = "成品油")
|
||||
public class Oil extends Model<Oil> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "ID", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty("名称")
|
||||
@TableField("`NAME`")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("价格")
|
||||
@TableField("PRICE")
|
||||
private BigDecimal price;
|
||||
|
||||
@ApiModelProperty("日期")
|
||||
@TableField("`DATE`")
|
||||
private LocalDate date;
|
||||
|
||||
@Override
|
||||
public Serializable pkVal() {
|
||||
return this.id;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user