Merge branch 'wq' of kn-cost/cost-backend into dev
This commit was merged in pull request #8.
This commit is contained in:
+4
@@ -41,4 +41,8 @@ public interface Constants {
|
|||||||
"期间费用",
|
"期间费用",
|
||||||
"期间费用率",
|
"期间费用率",
|
||||||
"净利率");
|
"净利率");
|
||||||
|
/**
|
||||||
|
* 下划线
|
||||||
|
*/
|
||||||
|
String UNDER_LINE = "_";
|
||||||
}
|
}
|
||||||
|
|||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
package com.zzsmart.qomo.kn.cost.manage.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 物料bom 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author
|
||||||
|
* @since 2024-06-19
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/cost-material-bom")
|
||||||
|
public class CostMaterialBomController {
|
||||||
|
|
||||||
|
}
|
||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
package com.zzsmart.qomo.kn.cost.manage.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 物料工时工序表 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author
|
||||||
|
* @since 2024-06-19
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/cost-material-process-hours")
|
||||||
|
public class CostMaterialProcessHoursController {
|
||||||
|
|
||||||
|
}
|
||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
package com.zzsmart.qomo.kn.cost.manage.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 物料采购单价 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author
|
||||||
|
* @since 2024-06-19
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/cost-purchase-price")
|
||||||
|
public class CostPurchasePriceController {
|
||||||
|
|
||||||
|
}
|
||||||
+56
-1
@@ -1,5 +1,8 @@
|
|||||||
package com.zzsmart.qomo.kn.cost.manage.controller;
|
package com.zzsmart.qomo.kn.cost.manage.controller;
|
||||||
|
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.net.URL;
|
||||||
|
import java.net.URLEncoder;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -13,6 +16,9 @@ import javax.servlet.http.HttpServletResponse;
|
|||||||
import com.zzsmart.qomo.kn.cost.manage.entity.CostStandard;
|
import com.zzsmart.qomo.kn.cost.manage.entity.CostStandard;
|
||||||
import com.zzsmart.qomo.kn.cost.manage.service.ICostStandardService;
|
import com.zzsmart.qomo.kn.cost.manage.service.ICostStandardService;
|
||||||
import com.zzsmart.qomo.kn.cost.manage.vo.CostStandardVO;
|
import com.zzsmart.qomo.kn.cost.manage.vo.CostStandardVO;
|
||||||
|
import org.apache.poi.ss.usermodel.*;
|
||||||
|
import org.apache.poi.ss.util.CellRangeAddressList;
|
||||||
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||||
import org.jeecg.common.api.vo.Result;
|
import org.jeecg.common.api.vo.Result;
|
||||||
import org.jeecg.common.system.query.QueryGenerator;
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
import org.jeecg.common.util.oConvertUtils;
|
import org.jeecg.common.util.oConvertUtils;
|
||||||
@@ -23,6 +29,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import org.jeecg.modules.system.entity.SysUser;
|
||||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||||
@@ -167,7 +174,7 @@ public class CostStandardController extends JeecgController<CostStandard, ICostS
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过excel导入数据
|
* 通过excel导入数据并进行批量计算
|
||||||
*
|
*
|
||||||
* @param request
|
* @param request
|
||||||
* @param response
|
* @param response
|
||||||
@@ -179,4 +186,52 @@ public class CostStandardController extends JeecgController<CostStandard, ICostS
|
|||||||
return super.importExcel(request, response, CostStandard.class);
|
return super.importExcel(request, response, CostStandard.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/download/excel-template")
|
||||||
|
public void downloadExcel(HttpServletResponse response) throws IOException {
|
||||||
|
// 创建工作簿
|
||||||
|
Workbook workbook = new XSSFWorkbook();
|
||||||
|
Sheet sheet = workbook.createSheet("生变成版本号导入模板");
|
||||||
|
|
||||||
|
// 创建表头行
|
||||||
|
Row headerRow = sheet.createRow(0);
|
||||||
|
// 设置字体
|
||||||
|
Font headerFont = workbook.createFont();
|
||||||
|
headerFont.setBold(true); // 设置字体为加粗
|
||||||
|
// headerFont.setFontHeightInPoints((short) 14); // 设置字体大小
|
||||||
|
|
||||||
|
CellStyle headerCellStyle = workbook.createCellStyle();
|
||||||
|
headerCellStyle.setFont(headerFont);
|
||||||
|
Cell firstCell = headerRow.createCell(0);
|
||||||
|
firstCell.setCellStyle(headerCellStyle);
|
||||||
|
firstCell.setCellValue("物料号");
|
||||||
|
Cell secondCell = headerRow.createCell(1);
|
||||||
|
secondCell.setCellStyle(headerCellStyle);
|
||||||
|
secondCell.setCellValue("图号");
|
||||||
|
Cell thirdCell = headerRow.createCell(2);
|
||||||
|
thirdCell.setCellStyle(headerCellStyle);
|
||||||
|
thirdCell.setCellValue("项目阶段");
|
||||||
|
|
||||||
|
// 设置下拉列表数据
|
||||||
|
DataValidationHelper validationHelper = sheet.getDataValidationHelper();
|
||||||
|
DataValidationConstraint constraint = validationHelper.createExplicitListConstraint(
|
||||||
|
new String[]{"初始","首批","量产"}); // 下拉列表的选项
|
||||||
|
|
||||||
|
// 应用下拉列表到第三列(索引为2)
|
||||||
|
CellRangeAddressList addressList = new CellRangeAddressList(1, 65535, 2, 2); // 从第二行开始到第101行,第三列
|
||||||
|
DataValidation validation = validationHelper.createValidation(constraint, addressList);
|
||||||
|
sheet.addValidationData(validation);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 设置响应头
|
||||||
|
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||||
|
response.setHeader("Content-Disposition", "attachment; filename=example-template.xlsx");
|
||||||
|
|
||||||
|
// 将工作簿写入输出流
|
||||||
|
workbook.write(response.getOutputStream());
|
||||||
|
workbook.close();
|
||||||
|
|
||||||
|
response.flushBuffer();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
package com.zzsmart.qomo.kn.cost.manage.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 标准成本明细表 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cost_purchase_price
|
||||||
|
* @since 2024-06-19
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/cost-standard-detail")
|
||||||
|
public class CostStandardDetailController {
|
||||||
|
|
||||||
|
}
|
||||||
+6
-2
@@ -87,8 +87,12 @@ public class CostStandardVersionController extends JeecgController<CostStandardV
|
|||||||
// @RequiresPermissions(":cost_standard_version:add")
|
// @RequiresPermissions(":cost_standard_version:add")
|
||||||
@PostMapping(value = "/add")
|
@PostMapping(value = "/add")
|
||||||
public Result<String> add(@RequestBody CostStandardVersion costStandardVersion) {
|
public Result<String> add(@RequestBody CostStandardVersion costStandardVersion) {
|
||||||
costStandardVersionService.save(costStandardVersion);
|
boolean save = costStandardVersionService.save(costStandardVersion);
|
||||||
|
if(save){
|
||||||
return Result.OK("添加成功!");
|
return Result.OK("添加成功!");
|
||||||
|
}else {
|
||||||
|
return Result.OK("添加失败!");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -175,7 +179,7 @@ public class CostStandardVersionController extends JeecgController<CostStandardV
|
|||||||
// @RequiresPermissions(":cost_standard_version:importExcel")
|
// @RequiresPermissions(":cost_standard_version:importExcel")
|
||||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
return super.importExcel(request, response, CostStandardVersion.class);
|
return this.costStandardVersionService.importExcel(request, response, CostStandardVersion.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+377
@@ -0,0 +1,377 @@
|
|||||||
|
package com.zzsmart.qomo.kn.cost.manage.entity;
|
||||||
|
|
||||||
|
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 java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 物料bom
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author
|
||||||
|
* @since 2024-06-19
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@TableName("cost_material_bom")
|
||||||
|
@ApiModel(value = "cost_material_bom对象", description = "cost_material_bom")
|
||||||
|
public class CostMaterialBom implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "id")
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料编码
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "物料编码")
|
||||||
|
@TableField("material_code")
|
||||||
|
private String materialCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "物料名称")
|
||||||
|
@TableField("material_name")
|
||||||
|
private String materialName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 父级物料编码
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "父级物料编码")
|
||||||
|
@TableField("parent_material_code")
|
||||||
|
private String parentMaterialCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 级别
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "级别")
|
||||||
|
@TableField("level")
|
||||||
|
private String level;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "排序")
|
||||||
|
@TableField("sort")
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计量单位
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "计量单位")
|
||||||
|
@TableField("unit")
|
||||||
|
private String unit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数量
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "id")
|
||||||
|
@TableField("数量")
|
||||||
|
private Integer number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人工工时(分钟)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "人工工时(分钟)")
|
||||||
|
@TableField("labor_hours")
|
||||||
|
private BigDecimal laborHours;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备工时
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "设备工时")
|
||||||
|
@TableField("device_hours")
|
||||||
|
private BigDecimal deviceHours;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 借用物料编码
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "借用物料编码")
|
||||||
|
@TableField("borrow_material_code")
|
||||||
|
private String borrowMaterialCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参考物料编码
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "参考物料编码")
|
||||||
|
@TableField("refer_material_code")
|
||||||
|
private String referMaterialCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 采购类型
|
||||||
|
*/
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "采购类型")
|
||||||
|
@TableField("purchase_type")
|
||||||
|
private String purchaseType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 特殊采购类型
|
||||||
|
*/
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "特殊采购类型")
|
||||||
|
@TableField("special_purchase_type")
|
||||||
|
private String specialPurchaseType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 说明
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "说明")
|
||||||
|
@TableField("explanation")
|
||||||
|
private String explanation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单位数量
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "单位数量")
|
||||||
|
@TableField("quantity")
|
||||||
|
private BigDecimal quantity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重量(g)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "重量(g)")
|
||||||
|
@TableField("weight")
|
||||||
|
private String weight;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 材料/牌号
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "材料/牌号")
|
||||||
|
@TableField("material_and_brand")
|
||||||
|
private String materialAndBrand;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表面处理,材料
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "表面处理,材料")
|
||||||
|
@TableField("surface_material")
|
||||||
|
private String surfaceMaterial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 厚度(mm)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "厚度(mm)")
|
||||||
|
@TableField("surface_thickness")
|
||||||
|
private String surfaceThickness;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表面积(mm²)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "表面积(mm²)")
|
||||||
|
@TableField("surface_area")
|
||||||
|
private String surfaceArea;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 长(mm)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "长(mm)")
|
||||||
|
@TableField("length")
|
||||||
|
private String length;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 宽(mm)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "宽(mm)")
|
||||||
|
@TableField("width")
|
||||||
|
private String width;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 高(mm)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "高(mm)")
|
||||||
|
@TableField("height")
|
||||||
|
private String height;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 图示/图档/文档 文件ID
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "图示/图档/文档 文件ID")
|
||||||
|
@TableField("figure_file_id")
|
||||||
|
private Long figureFileId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否新模具(0否 1是)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "是否新模具(0否 1是)")
|
||||||
|
@TableField("new_tooling")
|
||||||
|
private Boolean newTooling;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 成型方式(枚举)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "成型方式(枚举)")
|
||||||
|
@TableField("shaping_method")
|
||||||
|
private String shapingMethod;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 作业内容
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "作业内容")
|
||||||
|
@TableField("work_content")
|
||||||
|
private String workContent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加工地点
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "加工地点")
|
||||||
|
@TableField("process_location")
|
||||||
|
private String processLocation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 成本中心
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "成本中心")
|
||||||
|
@TableField("cost_center")
|
||||||
|
private String costCenter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单价(未税)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "单价(未税)")
|
||||||
|
@TableField("unit_price")
|
||||||
|
private BigDecimal unitPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 总价(未税)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "总价(未税)")
|
||||||
|
@TableField("total_price")
|
||||||
|
private BigDecimal totalPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模具费(未税)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "模具费(未税)")
|
||||||
|
@TableField("mould_price")
|
||||||
|
private BigDecimal mouldPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人
|
||||||
|
*/
|
||||||
|
@TableField("create_by")
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@TableField("create_time")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改人
|
||||||
|
*/
|
||||||
|
@TableField("update_by")
|
||||||
|
private String updateBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改时间
|
||||||
|
*/
|
||||||
|
@TableField("update_time")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注(特殊技术信息)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "备注(特殊技术信息)")
|
||||||
|
@TableField("remark")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
public static final String ID = "id";
|
||||||
|
|
||||||
|
public static final String MATERIAL_CODE = "material_code";
|
||||||
|
|
||||||
|
public static final String MATERIAL_NAME = "material_name";
|
||||||
|
|
||||||
|
public static final String PARENT_MATERIAL_CODE = "parent_material_code";
|
||||||
|
|
||||||
|
public static final String LEVEL = "level";
|
||||||
|
|
||||||
|
public static final String SORT = "sort";
|
||||||
|
|
||||||
|
public static final String UNIT = "unit";
|
||||||
|
|
||||||
|
public static final String NUMBER = "number";
|
||||||
|
|
||||||
|
public static final String LABOR_HOURS = "labor_hours";
|
||||||
|
|
||||||
|
public static final String DEVICE_HOURS = "device_hours";
|
||||||
|
|
||||||
|
public static final String BORROW_MATERIAL_CODE = "borrow_material_code";
|
||||||
|
|
||||||
|
public static final String REFER_MATERIAL_CODE = "refer_material_code";
|
||||||
|
|
||||||
|
public static final String PURCHASE_TYPE = "purchase_type";
|
||||||
|
|
||||||
|
public static final String SPECIAL_PURCHASE_TYPE = "special_purchase_type";
|
||||||
|
|
||||||
|
public static final String EXPLANATION = "explanation";
|
||||||
|
|
||||||
|
public static final String QUANTITY = "quantity";
|
||||||
|
|
||||||
|
public static final String WEIGHT = "weight";
|
||||||
|
|
||||||
|
public static final String MATERIAL_AND_BRAND = "material_and_brand";
|
||||||
|
|
||||||
|
public static final String SURFACE_MATERIAL = "surface_material";
|
||||||
|
|
||||||
|
public static final String SURFACE_THICKNESS = "surface_thickness";
|
||||||
|
|
||||||
|
public static final String SURFACE_AREA = "surface_area";
|
||||||
|
|
||||||
|
public static final String LENGTH = "length";
|
||||||
|
|
||||||
|
public static final String WIDTH = "width";
|
||||||
|
|
||||||
|
public static final String HEIGHT = "height";
|
||||||
|
|
||||||
|
public static final String FIGURE_FILE_ID = "figure_file_id";
|
||||||
|
|
||||||
|
public static final String NEW_TOOLING = "new_tooling";
|
||||||
|
|
||||||
|
public static final String SHAPING_METHOD = "shaping_method";
|
||||||
|
|
||||||
|
public static final String WORK_CONTENT = "work_content";
|
||||||
|
|
||||||
|
public static final String PROCESS_LOCATION = "process_location";
|
||||||
|
|
||||||
|
public static final String COST_CENTER = "cost_center";
|
||||||
|
|
||||||
|
public static final String UNIT_PRICE = "unit_price";
|
||||||
|
|
||||||
|
public static final String TOTAL_PRICE = "total_price";
|
||||||
|
|
||||||
|
public static final String MOULD_PRICE = "mould_price";
|
||||||
|
|
||||||
|
public static final String CREATE_BY = "create_by";
|
||||||
|
|
||||||
|
public static final String CREATE_TIME = "create_time";
|
||||||
|
|
||||||
|
public static final String UPDATE_BY = "update_by";
|
||||||
|
|
||||||
|
public static final String UPDATE_TIME = "update_time";
|
||||||
|
|
||||||
|
public static final String REMARK = "remark";
|
||||||
|
|
||||||
|
}
|
||||||
+174
@@ -0,0 +1,174 @@
|
|||||||
|
package com.zzsmart.qomo.kn.cost.manage.entity;
|
||||||
|
|
||||||
|
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 java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 物料工时工序表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author
|
||||||
|
* @since 2024-06-19
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@TableName("cost_material_process_hours")
|
||||||
|
public class CostMaterialProcessHours implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "id")
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料编码
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "物料编码")
|
||||||
|
@TableField("material_code")
|
||||||
|
private String materialCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "物料名称")
|
||||||
|
@TableField("material_name")
|
||||||
|
private String materialName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 层级
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "层级")
|
||||||
|
@TableField("level")
|
||||||
|
private String level;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数量
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "数量")
|
||||||
|
@TableField("quantity")
|
||||||
|
private BigDecimal quantity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 采购类型
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "采购类型")
|
||||||
|
@TableField("purchase_type")
|
||||||
|
private String purchaseType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工序
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "工序")
|
||||||
|
@TableField("work_process")
|
||||||
|
private String workProcess;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 描述
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "描述")
|
||||||
|
@TableField("described")
|
||||||
|
private String described;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人工工时
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "人工工时")
|
||||||
|
@TableField("labor_hours")
|
||||||
|
private BigDecimal laborHours;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备工时
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "设备工时")
|
||||||
|
@TableField("device_hours")
|
||||||
|
private BigDecimal deviceHours;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工作中心
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "工作中心")
|
||||||
|
@TableField("work_center")
|
||||||
|
private String workCenter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人
|
||||||
|
*/
|
||||||
|
@TableField("create_by")
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@TableField("create_time")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改人
|
||||||
|
*/
|
||||||
|
@TableField("update_by")
|
||||||
|
private String updateBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改时间
|
||||||
|
*/
|
||||||
|
@TableField("update_time")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
@TableField("remark")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
public static final String ID = "id";
|
||||||
|
|
||||||
|
public static final String MATERIAL_CODE = "material_code";
|
||||||
|
|
||||||
|
public static final String MATERIAL_NAME = "material_name";
|
||||||
|
|
||||||
|
public static final String LEVEL = "level";
|
||||||
|
|
||||||
|
public static final String QUANTITY = "quantity";
|
||||||
|
|
||||||
|
public static final String PURCHASE_TYPE = "purchase_type";
|
||||||
|
|
||||||
|
public static final String WORK_PROCESS = "work_process";
|
||||||
|
|
||||||
|
public static final String DESCRIBED = "described";
|
||||||
|
|
||||||
|
public static final String LABOR_HOURS = "labor_hours";
|
||||||
|
|
||||||
|
public static final String DEVICE_HOURS = "device_hours";
|
||||||
|
|
||||||
|
public static final String WORK_CENTER = "work_center";
|
||||||
|
|
||||||
|
public static final String CREATE_BY = "create_by";
|
||||||
|
|
||||||
|
public static final String CREATE_TIME = "create_time";
|
||||||
|
|
||||||
|
public static final String UPDATE_BY = "update_by";
|
||||||
|
|
||||||
|
public static final String UPDATE_TIME = "update_time";
|
||||||
|
|
||||||
|
public static final String REMARK = "remark";
|
||||||
|
|
||||||
|
}
|
||||||
+2
-2
@@ -35,11 +35,11 @@ public class CostPartMissingInfo implements Serializable {
|
|||||||
/**id*/
|
/**id*/
|
||||||
@TableId(type = IdType.ASSIGN_ID)
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
@ApiModelProperty(value = "id")
|
@ApiModelProperty(value = "id")
|
||||||
private Integer id;
|
private String id;
|
||||||
/**标准成本表主键id*/
|
/**标准成本表主键id*/
|
||||||
@Excel(name = "标准成本表主键id", width = 15)
|
@Excel(name = "标准成本表主键id", width = 15)
|
||||||
@ApiModelProperty(value = "标准成本表主键id")
|
@ApiModelProperty(value = "标准成本表主键id")
|
||||||
private Integer costStandardId;
|
private String costStandardId;
|
||||||
/**物料号*/
|
/**物料号*/
|
||||||
@Excel(name = "物料号", width = 15)
|
@Excel(name = "物料号", width = 15)
|
||||||
@ApiModelProperty(value = "物料号")
|
@ApiModelProperty(value = "物料号")
|
||||||
|
|||||||
+215
@@ -0,0 +1,215 @@
|
|||||||
|
package com.zzsmart.qomo.kn.cost.manage.entity;
|
||||||
|
|
||||||
|
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 java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 物料采购单价
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author
|
||||||
|
* @since 2024-06-19
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@TableName("cost_purchase_price")
|
||||||
|
public class CostPurchasePrice implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料编码
|
||||||
|
*/
|
||||||
|
@TableField("material_code")
|
||||||
|
private String materialCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料名称
|
||||||
|
*/
|
||||||
|
@TableField("material_name")
|
||||||
|
private String materialName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规格型号
|
||||||
|
*/
|
||||||
|
@TableField("specification")
|
||||||
|
private String specification;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 采购类型
|
||||||
|
*/
|
||||||
|
@TableField("purchase_type")
|
||||||
|
private String purchaseType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 供应商代码
|
||||||
|
*/
|
||||||
|
@TableField("supplier_code")
|
||||||
|
private String supplierCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 供应商名称
|
||||||
|
*/
|
||||||
|
@TableField("supplier_name")
|
||||||
|
private String supplierName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 采购价时间
|
||||||
|
*/
|
||||||
|
@TableField("purchase_price_time")
|
||||||
|
private LocalDateTime purchasePriceTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 采购价合计
|
||||||
|
*/
|
||||||
|
@TableField("purchase_price_sum")
|
||||||
|
private BigDecimal purchasePriceSum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 最低采购单价
|
||||||
|
*/
|
||||||
|
@TableField("min_purchase_price")
|
||||||
|
private BigDecimal minPurchasePrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 最新采购单价
|
||||||
|
*/
|
||||||
|
@TableField("last_purchase_price")
|
||||||
|
private BigDecimal lastPurchasePrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 平均采购价
|
||||||
|
*/
|
||||||
|
@TableField("purchase_price_avg")
|
||||||
|
private BigDecimal purchasePriceAvg;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 直接材料费
|
||||||
|
*/
|
||||||
|
@TableField("direct_material_cost")
|
||||||
|
private BigDecimal directMaterialCost;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工艺加工费用
|
||||||
|
*/
|
||||||
|
@TableField("process_cost")
|
||||||
|
private BigDecimal processCost;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运输费用
|
||||||
|
*/
|
||||||
|
@TableField("transport_cost")
|
||||||
|
private BigDecimal transportCost;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模具费用
|
||||||
|
*/
|
||||||
|
@TableField("mould_cost")
|
||||||
|
private BigDecimal mouldCost;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 其他费用
|
||||||
|
*/
|
||||||
|
@TableField("orther_cost")
|
||||||
|
private BigDecimal ortherCost;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 税率
|
||||||
|
*/
|
||||||
|
@TableField("tax_tate")
|
||||||
|
private BigDecimal taxTate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人
|
||||||
|
*/
|
||||||
|
@TableField("create_by")
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@TableField("create_time")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改人
|
||||||
|
*/
|
||||||
|
@TableField("update_by")
|
||||||
|
private String updateBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改时间
|
||||||
|
*/
|
||||||
|
@TableField("update_time")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
@TableField("remark")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
public static final String ID = "id";
|
||||||
|
|
||||||
|
public static final String MATERIAL_CODE = "material_code";
|
||||||
|
|
||||||
|
public static final String MATERIAL_NAME = "material_name";
|
||||||
|
|
||||||
|
public static final String SPECIFICATION = "specification";
|
||||||
|
|
||||||
|
public static final String PURCHASE_TYPE = "purchase_type";
|
||||||
|
|
||||||
|
public static final String SUPPLIER_CODE = "supplier_code";
|
||||||
|
|
||||||
|
public static final String SUPPLIER_NAME = "supplier_name";
|
||||||
|
|
||||||
|
public static final String PURCHASE_PRICE_TIME = "purchase_price_time";
|
||||||
|
|
||||||
|
public static final String PURCHASE_PRICE_SUM = "purchase_price_sum";
|
||||||
|
|
||||||
|
public static final String MIN_PURCHASE_PRICE = "min_purchase_price";
|
||||||
|
|
||||||
|
public static final String LAST_PURCHASE_PRICE = "last_purchase_price";
|
||||||
|
|
||||||
|
public static final String PURCHASE_PRICE_AVG = "purchase_price_avg";
|
||||||
|
|
||||||
|
public static final String DIRECT_MATERIAL_COST = "direct_material_cost";
|
||||||
|
|
||||||
|
public static final String PROCESS_COST = "process_cost";
|
||||||
|
|
||||||
|
public static final String TRANSPORT_COST = "transport_cost";
|
||||||
|
|
||||||
|
public static final String MOULD_COST = "mould_cost";
|
||||||
|
|
||||||
|
public static final String ORTHER_COST = "orther_cost";
|
||||||
|
|
||||||
|
public static final String TAX_TATE = "tax_tate";
|
||||||
|
|
||||||
|
public static final String CREATE_BY = "create_by";
|
||||||
|
|
||||||
|
public static final String CREATE_TIME = "create_time";
|
||||||
|
|
||||||
|
public static final String UPDATE_BY = "update_by";
|
||||||
|
|
||||||
|
public static final String UPDATE_TIME = "update_time";
|
||||||
|
|
||||||
|
public static final String REMARK = "remark";
|
||||||
|
|
||||||
|
}
|
||||||
+2
-2
@@ -35,7 +35,7 @@ public class CostStandard implements Serializable {
|
|||||||
/**id*/
|
/**id*/
|
||||||
@TableId(type = IdType.ASSIGN_ID)
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
@ApiModelProperty(value = "id")
|
@ApiModelProperty(value = "id")
|
||||||
private Integer id;
|
private String id;
|
||||||
/**物料号*/
|
/**物料号*/
|
||||||
@Excel(name = "物料号", width = 15)
|
@Excel(name = "物料号", width = 15)
|
||||||
@ApiModelProperty(value = "物料号")
|
@ApiModelProperty(value = "物料号")
|
||||||
@@ -44,7 +44,7 @@ public class CostStandard implements Serializable {
|
|||||||
/**版本号ID*/
|
/**版本号ID*/
|
||||||
@Excel(name = "版本号ID", width = 15)
|
@Excel(name = "版本号ID", width = 15)
|
||||||
@ApiModelProperty(value = "版本号ID")
|
@ApiModelProperty(value = "版本号ID")
|
||||||
private Integer versionNumberId;
|
private String versionNumberId;
|
||||||
|
|
||||||
/**bom材料费*/
|
/**bom材料费*/
|
||||||
@Excel(name = "bom材料费", width = 15)
|
@Excel(name = "bom材料费", width = 15)
|
||||||
|
|||||||
+255
@@ -0,0 +1,255 @@
|
|||||||
|
package com.zzsmart.qomo.kn.cost.manage.entity;
|
||||||
|
|
||||||
|
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 java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 标准成本明细表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cost_purchase_price
|
||||||
|
* @since 2024-06-19
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@TableName("cost_standard_detail")
|
||||||
|
public class CostStandardDetail implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 子物料号,关联kn_new_sap_mara表matnr字段
|
||||||
|
*/
|
||||||
|
@TableField("material_number")
|
||||||
|
private String materialNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 版本号id
|
||||||
|
*/
|
||||||
|
@TableField("version_number_id")
|
||||||
|
private String versionNumberId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 层级
|
||||||
|
*/
|
||||||
|
@TableField("level")
|
||||||
|
private String level;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 图号
|
||||||
|
*/
|
||||||
|
@TableField("figure_number")
|
||||||
|
private String figureNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用量
|
||||||
|
*/
|
||||||
|
@TableField("dosage")
|
||||||
|
private String dosage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单位
|
||||||
|
*/
|
||||||
|
@TableField("unit")
|
||||||
|
private String unit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规格
|
||||||
|
*/
|
||||||
|
@TableField("specification")
|
||||||
|
private String specification;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* bom材料费
|
||||||
|
*/
|
||||||
|
@TableField("bom_cost")
|
||||||
|
private BigDecimal bomCost;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 包装费
|
||||||
|
*/
|
||||||
|
@TableField("packing_cost")
|
||||||
|
private BigDecimal packingCost;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 本阶辅料费
|
||||||
|
*/
|
||||||
|
@TableField("auxiliary_cost")
|
||||||
|
private BigDecimal auxiliaryCost;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 本阶人工费
|
||||||
|
*/
|
||||||
|
@TableField("labor_cost")
|
||||||
|
private BigDecimal laborCost;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 机器折旧费
|
||||||
|
*/
|
||||||
|
@TableField("euip_depreciation_cost")
|
||||||
|
private BigDecimal euipDepreciationCost;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 机物料消耗费
|
||||||
|
*/
|
||||||
|
@TableField("equip_consume_cost")
|
||||||
|
private BigDecimal equipConsumeCost;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 水电费
|
||||||
|
*/
|
||||||
|
@TableField("hydroelectricity_cost")
|
||||||
|
private BigDecimal hydroelectricityCost;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 其他制造费
|
||||||
|
*/
|
||||||
|
@TableField("other_cost")
|
||||||
|
private BigDecimal otherCost;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物流费
|
||||||
|
*/
|
||||||
|
@TableField("trail_cost")
|
||||||
|
private BigDecimal trailCost;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 制造成本
|
||||||
|
*/
|
||||||
|
@TableField("manufacture_cost")
|
||||||
|
private BigDecimal manufactureCost;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 累计人工费
|
||||||
|
*/
|
||||||
|
@TableField("total_labor_cost")
|
||||||
|
private BigDecimal totalLaborCost;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 累计机器消耗费
|
||||||
|
*/
|
||||||
|
@TableField("total_equip_consume_cost")
|
||||||
|
private BigDecimal totalEquipConsumeCost;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 累计机器折旧费
|
||||||
|
*/
|
||||||
|
@TableField("total_euip_depreciation_cost")
|
||||||
|
private BigDecimal totalEuipDepreciationCost;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 累计水电费
|
||||||
|
*/
|
||||||
|
@TableField("total_hydroelectricity_cost")
|
||||||
|
private BigDecimal totalHydroelectricityCost;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 累计其它费用
|
||||||
|
*/
|
||||||
|
@TableField("total_other_cost")
|
||||||
|
private BigDecimal totalOtherCost;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人
|
||||||
|
*/
|
||||||
|
@TableField("create_by")
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建日期
|
||||||
|
*/
|
||||||
|
@TableField("create_time")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改人
|
||||||
|
*/
|
||||||
|
@TableField("update_by")
|
||||||
|
private String updateBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改日期
|
||||||
|
*/
|
||||||
|
@TableField("update_time")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
@TableField("remark")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
public static final String ID = "id";
|
||||||
|
|
||||||
|
public static final String MATERIAL_NUMBER = "material_number";
|
||||||
|
|
||||||
|
public static final String VERSION_NUMBER_ID = "version_number_id";
|
||||||
|
|
||||||
|
public static final String LEVEL = "level";
|
||||||
|
|
||||||
|
public static final String FIGURE_NUMBER = "figure_number";
|
||||||
|
|
||||||
|
public static final String DOSAGE = "dosage";
|
||||||
|
|
||||||
|
public static final String UNIT = "unit";
|
||||||
|
|
||||||
|
public static final String SPECIFICATION = "specification";
|
||||||
|
|
||||||
|
public static final String BOM_COST = "bom_cost";
|
||||||
|
|
||||||
|
public static final String PACKING_COST = "packing_cost";
|
||||||
|
|
||||||
|
public static final String AUXILIARY_COST = "auxiliary_cost";
|
||||||
|
|
||||||
|
public static final String LABOR_COST = "labor_cost";
|
||||||
|
|
||||||
|
public static final String EUIP_DEPRECIATION_COST = "euip_depreciation_cost";
|
||||||
|
|
||||||
|
public static final String EQUIP_CONSUME_COST = "equip_consume_cost";
|
||||||
|
|
||||||
|
public static final String HYDROELECTRICITY_COST = "hydroelectricity_cost";
|
||||||
|
|
||||||
|
public static final String OTHER_COST = "other_cost";
|
||||||
|
|
||||||
|
public static final String TRAIL_COST = "trail_cost";
|
||||||
|
|
||||||
|
public static final String MANUFACTURE_COST = "manufacture_cost";
|
||||||
|
|
||||||
|
public static final String TOTAL_LABOR_COST = "total_labor_cost";
|
||||||
|
|
||||||
|
public static final String TOTAL_EQUIP_CONSUME_COST = "total_equip_consume_cost";
|
||||||
|
|
||||||
|
public static final String TOTAL_EUIP_DEPRECIATION_COST = "total_euip_depreciation_cost";
|
||||||
|
|
||||||
|
public static final String TOTAL_HYDROELECTRICITY_COST = "total_hydroelectricity_cost";
|
||||||
|
|
||||||
|
public static final String TOTAL_OTHER_COST = "total_other_cost";
|
||||||
|
|
||||||
|
public static final String CREATE_BY = "create_by";
|
||||||
|
|
||||||
|
public static final String CREATE_TIME = "create_time";
|
||||||
|
|
||||||
|
public static final String UPDATE_BY = "update_by";
|
||||||
|
|
||||||
|
public static final String UPDATE_TIME = "update_time";
|
||||||
|
|
||||||
|
public static final String REMARK = "remark";
|
||||||
|
|
||||||
|
}
|
||||||
+2
-8
@@ -35,9 +35,10 @@ public class CostStandardVersion implements Serializable {
|
|||||||
/**id*/
|
/**id*/
|
||||||
@TableId(type = IdType.ASSIGN_ID)
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
@ApiModelProperty(value = "id")
|
@ApiModelProperty(value = "id")
|
||||||
private Integer id;
|
private String id;
|
||||||
|
|
||||||
/**图号*/
|
/**图号*/
|
||||||
|
@Excel(name = "图号", width = 15)
|
||||||
@ApiModelProperty(value = "图号")
|
@ApiModelProperty(value = "图号")
|
||||||
private String figureNumber;
|
private String figureNumber;
|
||||||
/**阶段,A-初始,B-首批,C-量产*/
|
/**阶段,A-初始,B-首批,C-量产*/
|
||||||
@@ -49,15 +50,12 @@ public class CostStandardVersion implements Serializable {
|
|||||||
@ApiModelProperty(value = "物料号")
|
@ApiModelProperty(value = "物料号")
|
||||||
private String materialNumber;
|
private String materialNumber;
|
||||||
/**版本号*/
|
/**版本号*/
|
||||||
@Excel(name = "版本号", width = 15)
|
|
||||||
@ApiModelProperty(value = "版本号")
|
@ApiModelProperty(value = "版本号")
|
||||||
private String versionNumber;
|
private String versionNumber;
|
||||||
/**版本状态*/
|
/**版本状态*/
|
||||||
@Excel(name = "版本状态", width = 15)
|
|
||||||
@ApiModelProperty(value = "版本状态")
|
@ApiModelProperty(value = "版本状态")
|
||||||
private String versionStatus;
|
private String versionStatus;
|
||||||
/**创建人*/
|
/**创建人*/
|
||||||
@Excel(name = "创建人", width = 15)
|
|
||||||
@ApiModelProperty(value = "创建人")
|
@ApiModelProperty(value = "创建人")
|
||||||
private String createBy;
|
private String createBy;
|
||||||
/**创建时间*/
|
/**创建时间*/
|
||||||
@@ -66,21 +64,17 @@ public class CostStandardVersion implements Serializable {
|
|||||||
@ApiModelProperty(value = "创建时间")
|
@ApiModelProperty(value = "创建时间")
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
/**修改人*/
|
/**修改人*/
|
||||||
@Excel(name = "修改人", width = 15)
|
|
||||||
@ApiModelProperty(value = "修改人")
|
@ApiModelProperty(value = "修改人")
|
||||||
private String updateBy;
|
private String updateBy;
|
||||||
/**修改时间*/
|
/**修改时间*/
|
||||||
@Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
@ApiModelProperty(value = "修改时间")
|
@ApiModelProperty(value = "修改时间")
|
||||||
private Date updateTime;
|
private Date updateTime;
|
||||||
/**备注*/
|
/**备注*/
|
||||||
@Excel(name = "备注", width = 15)
|
|
||||||
@ApiModelProperty(value = "备注")
|
@ApiModelProperty(value = "备注")
|
||||||
private String remark;
|
private String remark;
|
||||||
/**年份*/
|
/**年份*/
|
||||||
@Excel(name = "年份", width = 15)
|
|
||||||
@ApiModelProperty(value = "年份")
|
@ApiModelProperty(value = "年份")
|
||||||
private String versionYear;
|
private String versionYear;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -23,7 +23,7 @@ import lombok.experimental.Accessors;
|
|||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@TableName("hour_rate")
|
@TableName("cost_hour_rate")
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@ApiModel(value="hour_rate对象", description="hour_rate")
|
@ApiModel(value="hour_rate对象", description="hour_rate")
|
||||||
|
|||||||
+63
@@ -0,0 +1,63 @@
|
|||||||
|
package com.zzsmart.qomo.kn.cost.manage.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Classname StandardStageEnum
|
||||||
|
* @Description 阶段枚举
|
||||||
|
* @Version 1.0.0
|
||||||
|
* @Date 2024/6/18 9:51
|
||||||
|
* @Created wangqiong
|
||||||
|
*/
|
||||||
|
public enum StandardStageEnum {
|
||||||
|
INIT("A", "初始"),
|
||||||
|
FIRST_BATCH("B", "首批"),
|
||||||
|
MASS_PRODUCTION("C", "量产"),
|
||||||
|
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
|
private final String code;
|
||||||
|
private final String text;
|
||||||
|
|
||||||
|
StandardStageEnum(String code, String text)
|
||||||
|
{
|
||||||
|
this.code = code;
|
||||||
|
this.text = text;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCode()
|
||||||
|
{
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getText()
|
||||||
|
{
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 根据code获取text
|
||||||
|
* @param codeNo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String getTextByCode(String codeNo){
|
||||||
|
for (StandardStageEnum value : StandardStageEnum.values()) {
|
||||||
|
if (value.getCode().equals(codeNo)){
|
||||||
|
return value.getText();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return codeNo.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据text获取code
|
||||||
|
* @param textStr
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String getCodeByText(String textStr){
|
||||||
|
for (StandardStageEnum value : StandardStageEnum.values()) {
|
||||||
|
if (value.getText().equals(textStr)){
|
||||||
|
return value.getText();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return textStr;
|
||||||
|
}
|
||||||
|
}
|
||||||
+18
@@ -0,0 +1,18 @@
|
|||||||
|
package com.zzsmart.qomo.kn.cost.manage.mapper;
|
||||||
|
|
||||||
|
import com.zzsmart.qomo.kn.cost.manage.entity.CostMaterialBom;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 物料bom Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author
|
||||||
|
* @since 2024-06-19
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface CostMaterialBomMapper extends BaseMapper<CostMaterialBom> {
|
||||||
|
|
||||||
|
}
|
||||||
+18
@@ -0,0 +1,18 @@
|
|||||||
|
package com.zzsmart.qomo.kn.cost.manage.mapper;
|
||||||
|
|
||||||
|
import com.zzsmart.qomo.kn.cost.manage.entity.CostMaterialProcessHours;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 物料工时工序表 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author
|
||||||
|
* @since 2024-06-19
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface CostMaterialProcessHoursMapper extends BaseMapper<CostMaterialProcessHours> {
|
||||||
|
|
||||||
|
}
|
||||||
+18
@@ -0,0 +1,18 @@
|
|||||||
|
package com.zzsmart.qomo.kn.cost.manage.mapper;
|
||||||
|
|
||||||
|
import com.zzsmart.qomo.kn.cost.manage.entity.CostPurchasePrice;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 物料采购单价 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author
|
||||||
|
* @since 2024-06-19
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface CostPurchasePriceMapper extends BaseMapper<CostPurchasePrice> {
|
||||||
|
|
||||||
|
}
|
||||||
+18
@@ -0,0 +1,18 @@
|
|||||||
|
package com.zzsmart.qomo.kn.cost.manage.mapper;
|
||||||
|
|
||||||
|
import com.zzsmart.qomo.kn.cost.manage.entity.CostStandardDetail;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 标准成本明细表 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cost_purchase_price
|
||||||
|
* @since 2024-06-19
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface CostStandardDetailMapper extends BaseMapper<CostStandardDetail> {
|
||||||
|
|
||||||
|
}
|
||||||
+52
@@ -0,0 +1,52 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.zzsmart.qomo.kn.cost.manage.mapper.CostMaterialBomMapper">
|
||||||
|
|
||||||
|
<!-- 通用查询映射结果 -->
|
||||||
|
<resultMap id="BaseResultMap" type="com.zzsmart.qomo.kn.cost.manage.entity.CostMaterialBom">
|
||||||
|
<id column="id" property="id" />
|
||||||
|
<result column="material_code" property="materialCode" />
|
||||||
|
<result column="material_name" property="materialName" />
|
||||||
|
<result column="parent_material_code" property="parentMaterialCode" />
|
||||||
|
<result column="level" property="level" />
|
||||||
|
<result column="sort" property="sort" />
|
||||||
|
<result column="unit" property="unit" />
|
||||||
|
<result column="number" property="number" />
|
||||||
|
<result column="labor_hours" property="laborHours" />
|
||||||
|
<result column="device_hours" property="deviceHours" />
|
||||||
|
<result column="borrow_material_code" property="borrowMaterialCode" />
|
||||||
|
<result column="refer_material_code" property="referMaterialCode" />
|
||||||
|
<result column="purchase_type" property="purchaseType" />
|
||||||
|
<result column="special_purchase_type" property="specialPurchaseType" />
|
||||||
|
<result column="explanation" property="explanation" />
|
||||||
|
<result column="quantity" property="quantity" />
|
||||||
|
<result column="weight" property="weight" />
|
||||||
|
<result column="material_and_brand" property="materialAndBrand" />
|
||||||
|
<result column="surface_material" property="surfaceMaterial" />
|
||||||
|
<result column="surface_thickness" property="surfaceThickness" />
|
||||||
|
<result column="surface_area" property="surfaceArea" />
|
||||||
|
<result column="length" property="length" />
|
||||||
|
<result column="width" property="width" />
|
||||||
|
<result column="height" property="height" />
|
||||||
|
<result column="figure_file_id" property="figureFileId" />
|
||||||
|
<result column="new_tooling" property="newTooling" />
|
||||||
|
<result column="shaping_method" property="shapingMethod" />
|
||||||
|
<result column="work_content" property="workContent" />
|
||||||
|
<result column="process_location" property="processLocation" />
|
||||||
|
<result column="cost_center" property="costCenter" />
|
||||||
|
<result column="unit_price" property="unitPrice" />
|
||||||
|
<result column="total_price" property="totalPrice" />
|
||||||
|
<result column="mould_price" property="mouldPrice" />
|
||||||
|
<result column="create_by" property="createBy" />
|
||||||
|
<result column="create_time" property="createTime" />
|
||||||
|
<result column="update_by" property="updateBy" />
|
||||||
|
<result column="update_time" property="updateTime" />
|
||||||
|
<result column="remark" property="remark" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<!-- 通用查询结果列 -->
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
id, material_code, material_name, parent_material_code, level, sort, unit, number, labor_hours, device_hours, borrow_material_code, refer_material_code, purchase_type, special_purchase_type, explanation, quantity, weight, material_and_brand, surface_material, surface_thickness, surface_area, length, width, height, figure_file_id, new_tooling, shaping_method, work_content, process_location, cost_center, unit_price, total_price, mould_price, create_by, create_time, update_by, update_time, remark
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
+30
@@ -0,0 +1,30 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.zzsmart.qomo.kn.cost.manage.mapper.CostMaterialProcessHoursMapper">
|
||||||
|
|
||||||
|
<!-- 通用查询映射结果 -->
|
||||||
|
<resultMap id="BaseResultMap" type="com.zzsmart.qomo.kn.cost.manage.entity.CostMaterialProcessHours">
|
||||||
|
<id column="id" property="id" />
|
||||||
|
<result column="material_code" property="materialCode" />
|
||||||
|
<result column="material_name" property="materialName" />
|
||||||
|
<result column="level" property="level" />
|
||||||
|
<result column="quantity" property="quantity" />
|
||||||
|
<result column="purchase_type" property="purchaseType" />
|
||||||
|
<result column="work_process" property="workProcess" />
|
||||||
|
<result column="described" property="described" />
|
||||||
|
<result column="labor_hours" property="laborHours" />
|
||||||
|
<result column="device_hours" property="deviceHours" />
|
||||||
|
<result column="work_center" property="workCenter" />
|
||||||
|
<result column="create_by" property="createBy" />
|
||||||
|
<result column="create_time" property="createTime" />
|
||||||
|
<result column="update_by" property="updateBy" />
|
||||||
|
<result column="update_time" property="updateTime" />
|
||||||
|
<result column="remark" property="remark" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<!-- 通用查询结果列 -->
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
id, material_code, material_name, level, quantity, purchase_type, work_process, described, labor_hours, device_hours, work_center, create_by, create_time, update_by, update_time, remark
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
+37
@@ -0,0 +1,37 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.zzsmart.qomo.kn.cost.manage.mapper.CostPurchasePriceMapper">
|
||||||
|
|
||||||
|
<!-- 通用查询映射结果 -->
|
||||||
|
<resultMap id="BaseResultMap" type="com.zzsmart.qomo.kn.cost.manage.entity.CostPurchasePrice">
|
||||||
|
<id column="id" property="id" />
|
||||||
|
<result column="material_code" property="materialCode" />
|
||||||
|
<result column="material_name" property="materialName" />
|
||||||
|
<result column="specification" property="specification" />
|
||||||
|
<result column="purchase_type" property="purchaseType" />
|
||||||
|
<result column="supplier_code" property="supplierCode" />
|
||||||
|
<result column="supplier_name" property="supplierName" />
|
||||||
|
<result column="purchase_price_time" property="purchasePriceTime" />
|
||||||
|
<result column="purchase_price_sum" property="purchasePriceSum" />
|
||||||
|
<result column="min_purchase_price" property="minPurchasePrice" />
|
||||||
|
<result column="last_purchase_price" property="lastPurchasePrice" />
|
||||||
|
<result column="purchase_price_avg" property="purchasePriceAvg" />
|
||||||
|
<result column="direct_material_cost" property="directMaterialCost" />
|
||||||
|
<result column="process_cost" property="processCost" />
|
||||||
|
<result column="transport_cost" property="transportCost" />
|
||||||
|
<result column="mould_cost" property="mouldCost" />
|
||||||
|
<result column="orther_cost" property="ortherCost" />
|
||||||
|
<result column="tax_tate" property="taxTate" />
|
||||||
|
<result column="create_by" property="createBy" />
|
||||||
|
<result column="create_time" property="createTime" />
|
||||||
|
<result column="update_by" property="updateBy" />
|
||||||
|
<result column="update_time" property="updateTime" />
|
||||||
|
<result column="remark" property="remark" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<!-- 通用查询结果列 -->
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
id, material_code, material_name, specification, purchase_type, supplier_code, supplier_name, purchase_price_time, purchase_price_sum, min_purchase_price, last_purchase_price, purchase_price_avg, direct_material_cost, process_cost, transport_cost, mould_cost, orther_cost, tax_tate, create_by, create_time, update_by, update_time, remark
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
+42
@@ -0,0 +1,42 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.zzsmart.qomo.kn.cost.manage.mapper.CostStandardDetailMapper">
|
||||||
|
|
||||||
|
<!-- 通用查询映射结果 -->
|
||||||
|
<resultMap id="BaseResultMap" type="com.zzsmart.qomo.kn.cost.manage.entity.CostStandardDetail">
|
||||||
|
<id column="id" property="id" />
|
||||||
|
<result column="material_number" property="materialNumber" />
|
||||||
|
<result column="version_number_id" property="versionNumberId" />
|
||||||
|
<result column="level" property="level" />
|
||||||
|
<result column="figure_number" property="figureNumber" />
|
||||||
|
<result column="dosage" property="dosage" />
|
||||||
|
<result column="unit" property="unit" />
|
||||||
|
<result column="specification" property="specification" />
|
||||||
|
<result column="bom_cost" property="bomCost" />
|
||||||
|
<result column="packing_cost" property="packingCost" />
|
||||||
|
<result column="auxiliary_cost" property="auxiliaryCost" />
|
||||||
|
<result column="labor_cost" property="laborCost" />
|
||||||
|
<result column="euip_depreciation_cost" property="euipDepreciationCost" />
|
||||||
|
<result column="equip_consume_cost" property="equipConsumeCost" />
|
||||||
|
<result column="hydroelectricity_cost" property="hydroelectricityCost" />
|
||||||
|
<result column="other_cost" property="otherCost" />
|
||||||
|
<result column="trail_cost" property="trailCost" />
|
||||||
|
<result column="manufacture_cost" property="manufactureCost" />
|
||||||
|
<result column="total_labor_cost" property="totalLaborCost" />
|
||||||
|
<result column="total_equip_consume_cost" property="totalEquipConsumeCost" />
|
||||||
|
<result column="total_euip_depreciation_cost" property="totalEuipDepreciationCost" />
|
||||||
|
<result column="total_hydroelectricity_cost" property="totalHydroelectricityCost" />
|
||||||
|
<result column="total_other_cost" property="totalOtherCost" />
|
||||||
|
<result column="create_by" property="createBy" />
|
||||||
|
<result column="create_time" property="createTime" />
|
||||||
|
<result column="update_by" property="updateBy" />
|
||||||
|
<result column="update_time" property="updateTime" />
|
||||||
|
<result column="remark" property="remark" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<!-- 通用查询结果列 -->
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
id, material_number, version_number_id, level, figure_number, dosage, unit, specification, bom_cost, packing_cost, auxiliary_cost, labor_cost, euip_depreciation_cost, equip_consume_cost, hydroelectricity_cost, other_cost, trail_cost, manufacture_cost, total_labor_cost, total_equip_consume_cost, total_euip_depreciation_cost, total_hydroelectricity_cost, total_other_cost, create_by, create_time, update_by, update_time, remark
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
package com.zzsmart.qomo.kn.cost.manage.service;
|
||||||
|
|
||||||
|
import com.zzsmart.qomo.kn.cost.manage.entity.CostMaterialBom;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 物料bom 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author
|
||||||
|
* @since 2024-06-19
|
||||||
|
*/
|
||||||
|
public interface CostMaterialBomService extends IService<CostMaterialBom> {
|
||||||
|
|
||||||
|
}
|
||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
package com.zzsmart.qomo.kn.cost.manage.service;
|
||||||
|
|
||||||
|
import com.zzsmart.qomo.kn.cost.manage.entity.CostMaterialProcessHours;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 物料工时工序表 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author
|
||||||
|
* @since 2024-06-19
|
||||||
|
*/
|
||||||
|
public interface CostMaterialProcessHoursService extends IService<CostMaterialProcessHours> {
|
||||||
|
|
||||||
|
}
|
||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
package com.zzsmart.qomo.kn.cost.manage.service;
|
||||||
|
|
||||||
|
import com.zzsmart.qomo.kn.cost.manage.entity.CostPurchasePrice;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 物料采购单价 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author
|
||||||
|
* @since 2024-06-19
|
||||||
|
*/
|
||||||
|
public interface CostPurchasePriceService extends IService<CostPurchasePrice> {
|
||||||
|
|
||||||
|
}
|
||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
package com.zzsmart.qomo.kn.cost.manage.service;
|
||||||
|
|
||||||
|
import com.zzsmart.qomo.kn.cost.manage.entity.CostStandardDetail;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 标准成本明细表 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cost_purchase_price
|
||||||
|
* @since 2024-06-19
|
||||||
|
*/
|
||||||
|
public interface CostStandardDetailService extends IService<CostStandardDetail> {
|
||||||
|
|
||||||
|
}
|
||||||
+11
@@ -3,7 +3,10 @@ package com.zzsmart.qomo.kn.cost.manage.service;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.zzsmart.qomo.kn.cost.manage.entity.CostStandardVersion;
|
import com.zzsmart.qomo.kn.cost.manage.entity.CostStandardVersion;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -13,5 +16,13 @@ import com.zzsmart.qomo.kn.cost.manage.entity.CostStandardVersion;
|
|||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
public interface ICostStandardVersionService extends IService<CostStandardVersion> {
|
public interface ICostStandardVersionService extends IService<CostStandardVersion> {
|
||||||
|
/**
|
||||||
|
* excel导入
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @param costStandardVersionClass
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Result<?> importExcel(HttpServletRequest request, HttpServletResponse response, Class<CostStandardVersion> costStandardVersionClass);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
package com.zzsmart.qomo.kn.cost.manage.service.impl;
|
||||||
|
|
||||||
|
import com.zzsmart.qomo.kn.cost.manage.entity.CostMaterialBom;
|
||||||
|
import com.zzsmart.qomo.kn.cost.manage.mapper.CostMaterialBomMapper;
|
||||||
|
import com.zzsmart.qomo.kn.cost.manage.service.CostMaterialBomService;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 物料bom 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author
|
||||||
|
* @since 2024-06-19
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class CostMaterialBomServiceImpl extends ServiceImpl<CostMaterialBomMapper, CostMaterialBom> implements CostMaterialBomService {
|
||||||
|
|
||||||
|
}
|
||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
package com.zzsmart.qomo.kn.cost.manage.service.impl;
|
||||||
|
|
||||||
|
import com.zzsmart.qomo.kn.cost.manage.entity.CostMaterialProcessHours;
|
||||||
|
import com.zzsmart.qomo.kn.cost.manage.mapper.CostMaterialProcessHoursMapper;
|
||||||
|
import com.zzsmart.qomo.kn.cost.manage.service.CostMaterialProcessHoursService;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 物料工时工序表 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author
|
||||||
|
* @since 2024-06-19
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class CostMaterialProcessHoursServiceImpl extends ServiceImpl<CostMaterialProcessHoursMapper, CostMaterialProcessHours> implements CostMaterialProcessHoursService {
|
||||||
|
|
||||||
|
}
|
||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
package com.zzsmart.qomo.kn.cost.manage.service.impl;
|
||||||
|
|
||||||
|
import com.zzsmart.qomo.kn.cost.manage.entity.CostPurchasePrice;
|
||||||
|
import com.zzsmart.qomo.kn.cost.manage.mapper.CostPurchasePriceMapper;
|
||||||
|
import com.zzsmart.qomo.kn.cost.manage.service.CostPurchasePriceService;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 物料采购单价 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author
|
||||||
|
* @since 2024-06-19
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class CostPurchasePriceServiceImpl extends ServiceImpl<CostPurchasePriceMapper, CostPurchasePrice> implements CostPurchasePriceService {
|
||||||
|
|
||||||
|
}
|
||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
package com.zzsmart.qomo.kn.cost.manage.service.impl;
|
||||||
|
|
||||||
|
import com.zzsmart.qomo.kn.cost.manage.entity.CostStandardDetail;
|
||||||
|
import com.zzsmart.qomo.kn.cost.manage.mapper.CostStandardDetailMapper;
|
||||||
|
import com.zzsmart.qomo.kn.cost.manage.service.CostStandardDetailService;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 标准成本明细表 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cost_purchase_price
|
||||||
|
* @since 2024-06-19
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class CostStandardDetailServiceImpl extends ServiceImpl<CostStandardDetailMapper, CostStandardDetail> implements CostStandardDetailService {
|
||||||
|
|
||||||
|
}
|
||||||
+138
-11
@@ -1,22 +1,42 @@
|
|||||||
package com.zzsmart.qomo.kn.cost.manage.service.impl;
|
package com.zzsmart.qomo.kn.cost.manage.service.impl;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.zzsmart.qomo.kn.cost.manage.constants.Constants;
|
||||||
import com.zzsmart.qomo.kn.cost.manage.entity.CostStandard;
|
import com.zzsmart.qomo.kn.cost.manage.entity.CostStandard;
|
||||||
import com.zzsmart.qomo.kn.cost.manage.entity.CostStandardVersion;
|
import com.zzsmart.qomo.kn.cost.manage.entity.CostStandardVersion;
|
||||||
|
import com.zzsmart.qomo.kn.cost.manage.enums.StandardStageEnum;
|
||||||
import com.zzsmart.qomo.kn.cost.manage.mapper.CostStandardMapper;
|
import com.zzsmart.qomo.kn.cost.manage.mapper.CostStandardMapper;
|
||||||
import com.zzsmart.qomo.kn.cost.manage.mapper.CostStandardVersionMapper;
|
import com.zzsmart.qomo.kn.cost.manage.mapper.CostStandardVersionMapper;
|
||||||
import com.zzsmart.qomo.kn.cost.manage.service.ICostStandardVersionService;
|
import com.zzsmart.qomo.kn.cost.manage.service.ICostStandardVersionService;
|
||||||
|
|
||||||
import org.apache.shiro.SecurityUtils;
|
import org.apache.shiro.SecurityUtils;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.exception.JeecgBootException;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
import org.jeecg.common.system.vo.LoginUser;
|
import org.jeecg.common.system.vo.LoginUser;
|
||||||
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.time.ZoneId;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -29,9 +49,14 @@ import java.util.Date;
|
|||||||
public class CostStandardVersionServiceImpl extends ServiceImpl<CostStandardVersionMapper, CostStandardVersion> implements ICostStandardVersionService {
|
public class CostStandardVersionServiceImpl extends ServiceImpl<CostStandardVersionMapper, CostStandardVersion> implements ICostStandardVersionService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private CostStandardMapper costStandardMapper;
|
private CostStandardMapper costStandardMapper;
|
||||||
@Transactional
|
@Autowired
|
||||||
|
private ICostStandardVersionService costStandardVersionService;
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(CostStandardVersionServiceImpl.class);
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@Override
|
@Override
|
||||||
public boolean save(CostStandardVersion costStandardVersion) {
|
public boolean save(CostStandardVersion costStandardVersion) {
|
||||||
|
// todo 查物料表看是否存在改物料,没有抛异常
|
||||||
LoginUser sysUser = null;
|
LoginUser sysUser = null;
|
||||||
try {
|
try {
|
||||||
sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
@@ -43,7 +68,7 @@ public class CostStandardVersionServiceImpl extends ServiceImpl<CostStandardVers
|
|||||||
}
|
}
|
||||||
// 保存版本号表
|
// 保存版本号表
|
||||||
boolean save = super.save(costStandardVersion);
|
boolean save = super.save(costStandardVersion);
|
||||||
// todo 标准成本计算,并且设置字段对应值(计算时版本状态为枚举,比如计算中,计算终止,计算出错,已完成)
|
// todo 标准成本计算
|
||||||
CostStandard standard = standardCalculate(costStandardVersion);
|
CostStandard standard = standardCalculate(costStandardVersion);
|
||||||
// standard.setMaterialNumber(costStandardVersion.getMaterialNumber());
|
// standard.setMaterialNumber(costStandardVersion.getMaterialNumber());
|
||||||
// standard.setVersionNumberId(costStandardVersion.getId());
|
// standard.setVersionNumberId(costStandardVersion.getId());
|
||||||
@@ -56,16 +81,25 @@ public class CostStandardVersionServiceImpl extends ServiceImpl<CostStandardVers
|
|||||||
return save;
|
return save;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 标准成本计算
|
* 标准成本计算
|
||||||
|
*
|
||||||
* @param costStandardVersion 版本号
|
* @param costStandardVersion 版本号
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private CostStandard standardCalculate(CostStandardVersion costStandardVersion) {
|
private CostStandard standardCalculate(CostStandardVersion costStandardVersion) {
|
||||||
|
// 计算逻辑,生成版本号输入的物料号是根节点物料号,
|
||||||
|
// 1,根据根节点物料号查找物料表kn_new_sap_mara
|
||||||
|
|
||||||
|
// 2,去bom表找出对应下的所有层级物料cost_material_bom
|
||||||
|
|
||||||
|
// 3,根据物料去工时工序表找出对应工序,工序表中包含所计算的工时,cost_material_process_hours
|
||||||
|
// 4,查小时费率表,找到对应工时费率cost_hour_rate
|
||||||
|
// 5,查采购单价表,找到对应采购单价cost_purchase_price
|
||||||
|
// 5,计算每层级的物料标准成本,存到标准成本明细表cost_standard_detail
|
||||||
CostStandard standard = new CostStandard();
|
CostStandard standard = new CostStandard();
|
||||||
// todo 1,查工序
|
|
||||||
// 2, 查时间
|
|
||||||
// 3,查费率
|
|
||||||
// 4,计算bom费用,BOM表清单物料用量*采购单价
|
// 4,计算bom费用,BOM表清单物料用量*采购单价
|
||||||
// 5,计算包装费
|
// 5,计算包装费
|
||||||
// 6,计算辅料费
|
// 6,计算辅料费
|
||||||
@@ -75,13 +109,106 @@ public class CostStandardVersionServiceImpl extends ServiceImpl<CostStandardVers
|
|||||||
// 10,计算水电费,燃动力工时*费率
|
// 10,计算水电费,燃动力工时*费率
|
||||||
// 11,计算其他制造费,其他工时*费率
|
// 11,计算其他制造费,其他工时*费率
|
||||||
// 12,计算物流费,物流费用=(机器折旧+机物料消耗+水电费+其他制费)*10.16%
|
// 12,计算物流费,物流费用=(机器折旧+机物料消耗+水电费+其他制费)*10.16%
|
||||||
// 13,计算制造成本,前面所有费用汇总(即bom费+包装费+辅料费+人工费+机器折旧费+机物料消耗费+水电费+其他制造费+物流费)
|
// 13,计算制造成本,前面所有费用汇总(即人工费+机器折旧费+机物料消耗费+水电费+其他制造费+物流费)
|
||||||
// 14,计算工装费
|
|
||||||
// 15,计算检具费
|
|
||||||
// 16,计算模具费
|
|
||||||
// 17,计算测试费
|
|
||||||
// 18,计算总成本
|
// 18,计算总成本
|
||||||
|
|
||||||
return standard;
|
return standard;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* excel导入
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @param clazz
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
@Override
|
||||||
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response, Class<CostStandardVersion> clazz) {
|
||||||
|
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
|
||||||
|
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
|
||||||
|
Iterator iterator = fileMap.entrySet().iterator();
|
||||||
|
if (iterator.hasNext()) {
|
||||||
|
Map.Entry<String, MultipartFile> entity = (Map.Entry) iterator.next();
|
||||||
|
MultipartFile file = (MultipartFile) entity.getValue();
|
||||||
|
ImportParams params = new ImportParams();
|
||||||
|
params.setTitleRows(2);
|
||||||
|
params.setHeadRows(1);
|
||||||
|
params.setNeedSave(true);
|
||||||
|
try {
|
||||||
|
List<CostStandardVersion> list = ExcelImportUtil.importExcel(file.getInputStream(), clazz, params);
|
||||||
|
if (CollectionUtil.isEmpty(list)) {
|
||||||
|
log.error("无可导入的数据!");
|
||||||
|
return Result.error("无可导入的数据!");
|
||||||
|
}
|
||||||
|
int successNum = 0;
|
||||||
|
int failureNum = 0;
|
||||||
|
// StringBuilder successMsg = new StringBuilder();
|
||||||
|
StringBuilder failureMsg = new StringBuilder();
|
||||||
|
long start = System.currentTimeMillis();
|
||||||
|
// 校验并组装list
|
||||||
|
for (int i = 0; i < list.size(); i++) {
|
||||||
|
CostStandardVersion standardVersion = list.get(i);
|
||||||
|
// 校验物料号是否为空
|
||||||
|
if (StrUtil.isEmpty(standardVersion.getMaterialNumber())) {
|
||||||
|
failureNum++;
|
||||||
|
failureMsg.append("<br/>第 " + (i + 2) + " 行【物料号】字段不能为空:");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (StrUtil.isNotEmpty(standardVersion.getStage())) {
|
||||||
|
standardVersion.setStage(StandardStageEnum.getCodeByText(standardVersion.getStage()));
|
||||||
|
}
|
||||||
|
// 创建日期
|
||||||
|
Date createDate = new Date();
|
||||||
|
standardVersion.setCreateTime(createDate);
|
||||||
|
String dateStr = new SimpleDateFormat("yyyyMMddHHmmss").format(createDate);
|
||||||
|
// 生成版本号,版本号=图号_阶段_创建日期(格式:yyyyMMddHHmmss)
|
||||||
|
standardVersion.setVersionNumber(standardVersion.getFigureNumber()+ Constants.UNDER_LINE +standardVersion.getStage()+Constants.UNDER_LINE+dateStr);
|
||||||
|
// 设置年份
|
||||||
|
standardVersion.setVersionYear(String.valueOf(createDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate().getYear()));
|
||||||
|
// 调用保存方法
|
||||||
|
try {
|
||||||
|
costStandardVersionService.save(standardVersion);
|
||||||
|
} catch (Exception e) {
|
||||||
|
failureNum++;
|
||||||
|
String msg = "<br/>第 " + (i + 2) + " 行数据导入失败;";
|
||||||
|
failureMsg.append(msg);
|
||||||
|
log.error(msg, e);
|
||||||
|
}
|
||||||
|
successNum++;
|
||||||
|
}
|
||||||
|
// costStandardVersionService.saveBatch(list);
|
||||||
|
log.info("消耗时间" + (System.currentTimeMillis() - start) + "毫秒");
|
||||||
|
String returnMsg = "文件导入成功!数据行数:" + successNum;
|
||||||
|
if (failureNum > 0) {
|
||||||
|
returnMsg += "<br/>失败数据行数:" + failureNum + ",失败信息如下:<br/>" + failureMsg.toString();
|
||||||
|
}
|
||||||
|
return Result.ok(returnMsg);
|
||||||
|
} catch (Exception exception) {
|
||||||
|
String msg = exception.getMessage();
|
||||||
|
log.error(msg, exception);
|
||||||
|
Result result;
|
||||||
|
String duplicateEntry = "Duplicate entry";
|
||||||
|
if (msg != null && msg.contains(duplicateEntry)) {
|
||||||
|
result = Result.error("文件导入失败:有重复数据!");
|
||||||
|
return result;
|
||||||
|
} else {
|
||||||
|
result = Result.error("文件导入失败:" + exception.getMessage());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
file.getInputStream().close();
|
||||||
|
} catch (IOException var23) {
|
||||||
|
var23.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return Result.error("文件导入失败!");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-7
@@ -21,7 +21,7 @@ public class ApplicationTests {
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void Generation(){
|
public void Generation(){
|
||||||
FastAutoGenerator.create("jdbc:mysql://121.40.189.20:3306/"+"costmanage"+"?&useSSL=true&useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai","root","YMzc157#")
|
FastAutoGenerator.create("jdbc:mysql://121.40.189.20:3306/"+"knne"+"?&useSSL=true&useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai","root","YMzc157#")
|
||||||
.globalConfig(builder -> {
|
.globalConfig(builder -> {
|
||||||
builder.author(" ")
|
builder.author(" ")
|
||||||
.fileOverride()//是否覆盖
|
.fileOverride()//是否覆盖
|
||||||
@@ -42,7 +42,7 @@ public class ApplicationTests {
|
|||||||
.pathInfo(Collections.singletonMap(OutputFile.mapperXml,System.getProperty("user.dir")+"/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml"));
|
.pathInfo(Collections.singletonMap(OutputFile.mapperXml,System.getProperty("user.dir")+"/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml"));
|
||||||
})
|
})
|
||||||
.strategyConfig(builder -> {
|
.strategyConfig(builder -> {
|
||||||
builder.addInclude("authority")// todo 设置需要生成的表名
|
builder.addInclude("cost_material_bom")// todo 设置需要生成的表名
|
||||||
//.addTablePrefix("sys_")//设置表前缀过滤
|
//.addTablePrefix("sys_")//设置表前缀过滤
|
||||||
.entityBuilder()
|
.entityBuilder()
|
||||||
.enableLombok()
|
.enableLombok()
|
||||||
@@ -66,11 +66,11 @@ public class ApplicationTests {
|
|||||||
.enableRestStyle();
|
.enableRestStyle();
|
||||||
})
|
})
|
||||||
// 使用Freemarker引擎模板,默认的是Velocity引擎模板
|
// 使用Freemarker引擎模板,默认的是Velocity引擎模板
|
||||||
.templateConfig(builder -> {
|
// .templateConfig(builder -> {
|
||||||
builder.disable(TemplateType.CONTROLLER)
|
// builder.disable(TemplateType.CONTROLLER)
|
||||||
.disable(TemplateType.SERVICE)
|
// .disable(TemplateType.SERVICE)
|
||||||
.disable(TemplateType.SERVICEIMPL);
|
// .disable(TemplateType.SERVICEIMPL);
|
||||||
})
|
// })
|
||||||
.templateEngine(new FreemarkerTemplateEngine())
|
.templateEngine(new FreemarkerTemplateEngine())
|
||||||
.execute();
|
.execute();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user