change - add物料信息、自定义数据

main
yinq 7 months ago
parent ca32fb9b7e
commit 9b0c7b7636

@ -0,0 +1,100 @@
package com.os.mes.base.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.os.common.annotation.Log;
import com.os.common.core.controller.BaseController;
import com.os.common.core.domain.AjaxResult;
import com.os.common.enums.BusinessType;
import com.os.mes.base.domain.BaseCustomData;
import com.os.mes.base.service.IBaseCustomDataService;
import com.os.common.utils.poi.ExcelUtil;
import com.os.common.core.page.TableDataInfo;
/**
* Controller
*
* @author Yinq
* @date 2024-05-10
*/
@RestController
@RequestMapping("/mes/base/baseCustomData")
public class BaseCustomDataController extends BaseController {
@Autowired
private IBaseCustomDataService baseCustomDataService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('mes/base:baseCustomData:list')")
@GetMapping("/list")
public TableDataInfo list(BaseCustomData baseCustomData) {
startPage();
List<BaseCustomData> list = baseCustomDataService.selectBaseCustomDataList(baseCustomData);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('mes/base:baseCustomData:export')")
@Log(title = "自定义数据维护", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, BaseCustomData baseCustomData) {
List<BaseCustomData> list = baseCustomDataService.selectBaseCustomDataList(baseCustomData);
ExcelUtil<BaseCustomData> util = new ExcelUtil<BaseCustomData>(BaseCustomData.class);
util.exportExcel(response, list, "自定义数据维护数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('mes/base:baseCustomData:query')")
@GetMapping(value = "/{objId}")
public AjaxResult getInfo(@PathVariable("objId") Long objId) {
return success(baseCustomDataService.selectBaseCustomDataByObjId(objId));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('mes/base:baseCustomData:add')")
@Log(title = "自定义数据维护", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody BaseCustomData baseCustomData) {
baseCustomData.setCreateBy(getUsername());
return toAjax(baseCustomDataService.insertBaseCustomData(baseCustomData));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('mes/base:baseCustomData:edit')")
@Log(title = "自定义数据维护", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody BaseCustomData baseCustomData) {
baseCustomData.setUpdateBy(getUsername());
return toAjax(baseCustomDataService.updateBaseCustomData(baseCustomData));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('mes/base:baseCustomData:remove')")
@Log(title = "自定义数据维护", businessType = BusinessType.DELETE)
@DeleteMapping("/{objIds}")
public AjaxResult remove(@PathVariable Long[] objIds) {
return toAjax(baseCustomDataService.deleteBaseCustomDataByObjIds(objIds));
}
}

@ -103,4 +103,13 @@ public class BaseDeviceLedgerController extends BaseController
{
return toAjax(baseDeviceLedgerService.deleteBaseDeviceLedgerByObjIds(objIds));
}
/**
*
* @return
*/
@GetMapping("/getDeviceCode")
public AjaxResult getDeviceCode() {
return success(baseDeviceLedgerService.getDeviceCode());
}
}

@ -0,0 +1,106 @@
package com.os.mes.base.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.os.common.annotation.Log;
import com.os.common.core.controller.BaseController;
import com.os.common.core.domain.AjaxResult;
import com.os.common.enums.BusinessType;
import com.os.mes.base.domain.BaseMaterialInfo;
import com.os.mes.base.service.IBaseMaterialInfoService;
import com.os.common.utils.poi.ExcelUtil;
import com.os.common.core.page.TableDataInfo;
/**
* Controller
*
* @author Yinq
* @date 2024-05-10
*/
@RestController
@RequestMapping("/mes/base/baseMaterialInfo")
public class BaseMaterialInfoController extends BaseController
{
@Autowired
private IBaseMaterialInfoService baseMaterialInfoService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('mes/base:baseMaterialInfo:list')")
@GetMapping("/list")
public TableDataInfo list(BaseMaterialInfo baseMaterialInfo)
{
startPage();
List<BaseMaterialInfo> list = baseMaterialInfoService.selectBaseMaterialInfoList(baseMaterialInfo);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('mes/base:baseMaterialInfo:export')")
@Log(title = "物料信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, BaseMaterialInfo baseMaterialInfo)
{
List<BaseMaterialInfo> list = baseMaterialInfoService.selectBaseMaterialInfoList(baseMaterialInfo);
ExcelUtil<BaseMaterialInfo> util = new ExcelUtil<BaseMaterialInfo>(BaseMaterialInfo.class);
util.exportExcel(response, list, "物料信息数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('mes/base:baseMaterialInfo:query')")
@GetMapping(value = "/{objId}")
public AjaxResult getInfo(@PathVariable("objId") Long objId)
{
return success(baseMaterialInfoService.selectBaseMaterialInfoByObjId(objId));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('mes/base:baseMaterialInfo:add')")
@Log(title = "物料信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody BaseMaterialInfo baseMaterialInfo)
{
baseMaterialInfo.setCreateBy(getUsername());
return toAjax(baseMaterialInfoService.insertBaseMaterialInfo(baseMaterialInfo));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('mes/base:baseMaterialInfo:edit')")
@Log(title = "物料信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody BaseMaterialInfo baseMaterialInfo)
{
baseMaterialInfo.setUpdateBy(getUsername());
return toAjax(baseMaterialInfoService.updateBaseMaterialInfo(baseMaterialInfo));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('mes/base:baseMaterialInfo:remove')")
@Log(title = "物料信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{objIds}")
public AjaxResult remove(@PathVariable Long[] objIds)
{
return toAjax(baseMaterialInfoService.deleteBaseMaterialInfoByObjIds(objIds));
}
}

@ -0,0 +1,131 @@
package com.os.mes.base.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.os.common.annotation.Excel;
import com.os.common.core.domain.BaseEntity;
/**
* base_custom_data
*
* @author Yinq
* @date 2024-05-10
*/
public class BaseCustomData extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
*
*/
private Long objId;
/**
* 0OS 1EMS
*/
@Excel(name = "自定义数据类型", readConverterExp = "0=OS数据,1=EMS数据")
private String customType;
/**
*
*/
@Excel(name = "自定义功能")
private String customFunction;
/**
*
*/
@Excel(name = "自定义编号")
private String customCode;
/**
*
*/
@Excel(name = "自定义数据")
private String customData;
/**
*
*/
@Excel(name = "排序")
private Long customSort;
/**
*
*/
@Excel(name = "是否标识")
private String isFlag;
public void setObjId(Long objId) {
this.objId = objId;
}
public Long getObjId() {
return objId;
}
public void setCustomType(String customType) {
this.customType = customType;
}
public String getCustomType() {
return customType;
}
public void setCustomFunction(String customFunction) {
this.customFunction = customFunction;
}
public String getCustomFunction() {
return customFunction;
}
public void setCustomCode(String customCode) {
this.customCode = customCode;
}
public String getCustomCode() {
return customCode;
}
public void setCustomData(String customData) {
this.customData = customData;
}
public String getCustomData() {
return customData;
}
public void setCustomSort(Long customSort) {
this.customSort = customSort;
}
public Long getCustomSort() {
return customSort;
}
public void setIsFlag(String isFlag) {
this.isFlag = isFlag;
}
public String getIsFlag() {
return isFlag;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("objId", getObjId())
.append("customType", getCustomType())
.append("customFunction", getCustomFunction())
.append("customCode", getCustomCode())
.append("customData", getCustomData())
.append("customSort", getCustomSort())
.append("remark", getRemark())
.append("isFlag", getIsFlag())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

@ -0,0 +1,255 @@
package com.os.mes.base.domain;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.os.common.annotation.Excel;
import com.os.common.core.domain.BaseEntity;
/**
* base_material_info
*
* @author Yinq
* @date 2024-05-10
*/
public class BaseMaterialInfo extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
*
*/
private Long objId;
/**
*
*/
@Excel(name = "物料编码")
private String materialCode;
/**
*
*/
@Excel(name = "物料名称")
private String materialName;
/**
*
*/
@Excel(name = "物料大类")
private String materialCategories;
/**
* 1 2BOM
*/
@Excel(name = "物料小类", readConverterExp = "1=成品,2=BOM")
private String materialSubclass;
/**
* SAP
*/
@Excel(name = "SAP物料类型")
private String materialType;
/**
*
*/
@Excel(name = "计量单位")
private String materialUnit;
/**
* ()
*/
@Excel(name = "单位工资(元)")
private BigDecimal unitPrice;
/**
*
*/
@Excel(name = "物料型号")
private String materialSpecifications;
/**
*
*/
@Excel(name = "工厂编号")
private String factoryCode;
/**
*
*/
@Excel(name = "所属工位")
private String productLineCode;
/**
*
*/
@Excel(name = "是否标识")
private String isFlag;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "增量日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date incrementDate;
/**
*
*/
@Excel(name = "商品编码")
private String productCode;
/**
*
*/
@Excel(name = "商品名称")
private String productName;
public void setObjId(Long objId) {
this.objId = objId;
}
public Long getObjId() {
return objId;
}
public void setMaterialCode(String materialCode) {
this.materialCode = materialCode;
}
public String getMaterialCode() {
return materialCode;
}
public void setMaterialName(String materialName) {
this.materialName = materialName;
}
public String getMaterialName() {
return materialName;
}
public void setMaterialCategories(String materialCategories) {
this.materialCategories = materialCategories;
}
public String getMaterialCategories() {
return materialCategories;
}
public void setMaterialSubclass(String materialSubclass) {
this.materialSubclass = materialSubclass;
}
public String getMaterialSubclass() {
return materialSubclass;
}
public void setMaterialType(String materialType) {
this.materialType = materialType;
}
public String getMaterialType() {
return materialType;
}
public void setMaterialUnit(String materialUnit) {
this.materialUnit = materialUnit;
}
public String getMaterialUnit() {
return materialUnit;
}
public void setUnitPrice(BigDecimal unitPrice) {
this.unitPrice = unitPrice;
}
public BigDecimal getUnitPrice() {
return unitPrice;
}
public void setMaterialSpecifications(String materialSpecifications) {
this.materialSpecifications = materialSpecifications;
}
public String getMaterialSpecifications() {
return materialSpecifications;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
public String getFactoryCode() {
return factoryCode;
}
public void setProductLineCode(String productLineCode) {
this.productLineCode = productLineCode;
}
public String getProductLineCode() {
return productLineCode;
}
public void setIsFlag(String isFlag) {
this.isFlag = isFlag;
}
public String getIsFlag() {
return isFlag;
}
public void setIncrementDate(Date incrementDate) {
this.incrementDate = incrementDate;
}
public Date getIncrementDate() {
return incrementDate;
}
public void setProductCode(String productCode) {
this.productCode = productCode;
}
public String getProductCode() {
return productCode;
}
public void setProductName(String productName) {
this.productName = productName;
}
public String getProductName() {
return productName;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("objId", getObjId())
.append("materialCode", getMaterialCode())
.append("materialName", getMaterialName())
.append("materialCategories", getMaterialCategories())
.append("materialSubclass", getMaterialSubclass())
.append("materialType", getMaterialType())
.append("materialUnit", getMaterialUnit())
.append("unitPrice", getUnitPrice())
.append("materialSpecifications", getMaterialSpecifications())
.append("factoryCode", getFactoryCode())
.append("productLineCode", getProductLineCode())
.append("isFlag", getIsFlag())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("incrementDate", getIncrementDate())
.append("productCode", getProductCode())
.append("productName", getProductName())
.toString();
}
}

@ -0,0 +1,61 @@
package com.os.mes.base.mapper;
import java.util.List;
import com.os.mes.base.domain.BaseCustomData;
/**
* Mapper
*
* @author Yinq
* @date 2024-05-10
*/
public interface BaseCustomDataMapper {
/**
*
*
* @param objId
* @return
*/
public BaseCustomData selectBaseCustomDataByObjId(Long objId);
/**
*
*
* @param baseCustomData
* @return
*/
public List<BaseCustomData> selectBaseCustomDataList(BaseCustomData baseCustomData);
/**
*
*
* @param baseCustomData
* @return
*/
public int insertBaseCustomData(BaseCustomData baseCustomData);
/**
*
*
* @param baseCustomData
* @return
*/
public int updateBaseCustomData(BaseCustomData baseCustomData);
/**
*
*
* @param objId
* @return
*/
public int deleteBaseCustomDataByObjId(Long objId);
/**
*
*
* @param objIds
* @return
*/
public int deleteBaseCustomDataByObjIds(Long[] objIds);
}

@ -58,4 +58,10 @@ public interface BaseDeviceLedgerMapper
* @return
*/
public int deleteBaseDeviceLedgerByObjIds(Long[] objIds);
/**
*
* @return
*/
public String getDeviceCode();
}

@ -0,0 +1,61 @@
package com.os.mes.base.mapper;
import java.util.List;
import com.os.mes.base.domain.BaseMaterialInfo;
/**
* Mapper
*
* @author Yinq
* @date 2024-05-10
*/
public interface BaseMaterialInfoMapper
{
/**
*
*
* @param objId
* @return
*/
public BaseMaterialInfo selectBaseMaterialInfoByObjId(Long objId);
/**
*
*
* @param baseMaterialInfo
* @return
*/
public List<BaseMaterialInfo> selectBaseMaterialInfoList(BaseMaterialInfo baseMaterialInfo);
/**
*
*
* @param baseMaterialInfo
* @return
*/
public int insertBaseMaterialInfo(BaseMaterialInfo baseMaterialInfo);
/**
*
*
* @param baseMaterialInfo
* @return
*/
public int updateBaseMaterialInfo(BaseMaterialInfo baseMaterialInfo);
/**
*
*
* @param objId
* @return
*/
public int deleteBaseMaterialInfoByObjId(Long objId);
/**
*
*
* @param objIds
* @return
*/
public int deleteBaseMaterialInfoByObjIds(Long[] objIds);
}

@ -0,0 +1,61 @@
package com.os.mes.base.service;
import java.util.List;
import com.os.mes.base.domain.BaseCustomData;
/**
* Service
*
* @author Yinq
* @date 2024-05-10
*/
public interface IBaseCustomDataService {
/**
*
*
* @param objId
* @return
*/
public BaseCustomData selectBaseCustomDataByObjId(Long objId);
/**
*
*
* @param baseCustomData
* @return
*/
public List<BaseCustomData> selectBaseCustomDataList(BaseCustomData baseCustomData);
/**
*
*
* @param baseCustomData
* @return
*/
public int insertBaseCustomData(BaseCustomData baseCustomData);
/**
*
*
* @param baseCustomData
* @return
*/
public int updateBaseCustomData(BaseCustomData baseCustomData);
/**
*
*
* @param objIds
* @return
*/
public int deleteBaseCustomDataByObjIds(Long[] objIds);
/**
*
*
* @param objId
* @return
*/
public int deleteBaseCustomDataByObjId(Long objId);
}

@ -58,4 +58,10 @@ public interface IBaseDeviceLedgerService
* @return
*/
public int deleteBaseDeviceLedgerByObjId(Long objId);
/**
*
* @return
*/
public String getDeviceCode();
}

@ -0,0 +1,61 @@
package com.os.mes.base.service;
import java.util.List;
import com.os.mes.base.domain.BaseMaterialInfo;
/**
* Service
*
* @author Yinq
* @date 2024-05-10
*/
public interface IBaseMaterialInfoService
{
/**
*
*
* @param objId
* @return
*/
public BaseMaterialInfo selectBaseMaterialInfoByObjId(Long objId);
/**
*
*
* @param baseMaterialInfo
* @return
*/
public List<BaseMaterialInfo> selectBaseMaterialInfoList(BaseMaterialInfo baseMaterialInfo);
/**
*
*
* @param baseMaterialInfo
* @return
*/
public int insertBaseMaterialInfo(BaseMaterialInfo baseMaterialInfo);
/**
*
*
* @param baseMaterialInfo
* @return
*/
public int updateBaseMaterialInfo(BaseMaterialInfo baseMaterialInfo);
/**
*
*
* @param objIds
* @return
*/
public int deleteBaseMaterialInfoByObjIds(Long[] objIds);
/**
*
*
* @param objId
* @return
*/
public int deleteBaseMaterialInfoByObjId(Long objId);
}

@ -0,0 +1,90 @@
package com.os.mes.base.service.impl;
import java.util.List;
import com.os.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.os.mes.base.mapper.BaseCustomDataMapper;
import com.os.mes.base.domain.BaseCustomData;
import com.os.mes.base.service.IBaseCustomDataService;
/**
* Service
*
* @author Yinq
* @date 2024-05-10
*/
@Service
public class BaseCustomDataServiceImpl implements IBaseCustomDataService {
@Autowired
private BaseCustomDataMapper baseCustomDataMapper;
/**
*
*
* @param objId
* @return
*/
@Override
public BaseCustomData selectBaseCustomDataByObjId(Long objId) {
return baseCustomDataMapper.selectBaseCustomDataByObjId(objId);
}
/**
*
*
* @param baseCustomData
* @return
*/
@Override
public List<BaseCustomData> selectBaseCustomDataList(BaseCustomData baseCustomData) {
return baseCustomDataMapper.selectBaseCustomDataList(baseCustomData);
}
/**
*
*
* @param baseCustomData
* @return
*/
@Override
public int insertBaseCustomData(BaseCustomData baseCustomData) {
baseCustomData.setCreateTime(DateUtils.getNowDate());
return baseCustomDataMapper.insertBaseCustomData(baseCustomData);
}
/**
*
*
* @param baseCustomData
* @return
*/
@Override
public int updateBaseCustomData(BaseCustomData baseCustomData) {
baseCustomData.setUpdateTime(DateUtils.getNowDate());
return baseCustomDataMapper.updateBaseCustomData(baseCustomData);
}
/**
*
*
* @param objIds
* @return
*/
@Override
public int deleteBaseCustomDataByObjIds(Long[] objIds) {
return baseCustomDataMapper.deleteBaseCustomDataByObjIds(objIds);
}
/**
*
*
* @param objId
* @return
*/
@Override
public int deleteBaseCustomDataByObjId(Long objId) {
return baseCustomDataMapper.deleteBaseCustomDataByObjId(objId);
}
}

@ -2,6 +2,7 @@ package com.os.mes.base.service.impl;
import java.util.List;
import com.os.common.utils.DateUtils;
import com.os.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.os.mes.base.mapper.BaseDeviceLedgerMapper;
@ -93,4 +94,24 @@ public class BaseDeviceLedgerServiceImpl implements IBaseDeviceLedgerService
{
return baseDeviceLedgerMapper.deleteBaseDeviceLedgerByObjId(objId);
}
/**
*
* @return
*/
@Override
public String getDeviceCode() {
int incrementedNumber = 1;
String deviceCode = baseDeviceLedgerMapper.getDeviceCode();
if (StringUtils.isNotEmpty(deviceCode)){
String numericPart = deviceCode.substring(1);
// 将数字部分转换为整数并加1
incrementedNumber = Integer.parseInt(numericPart) + 1;
}
// 格式化加1后的数字部分确保总长度为5位
String formattedNumber = String.format("%05d", incrementedNumber);
// 拼接 'E' 和格式化后的数字部分
return "E" + formattedNumber;
}
}

@ -0,0 +1,96 @@
package com.os.mes.base.service.impl;
import java.util.List;
import com.os.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.os.mes.base.mapper.BaseMaterialInfoMapper;
import com.os.mes.base.domain.BaseMaterialInfo;
import com.os.mes.base.service.IBaseMaterialInfoService;
/**
* Service
*
* @author Yinq
* @date 2024-05-10
*/
@Service
public class BaseMaterialInfoServiceImpl implements IBaseMaterialInfoService
{
@Autowired
private BaseMaterialInfoMapper baseMaterialInfoMapper;
/**
*
*
* @param objId
* @return
*/
@Override
public BaseMaterialInfo selectBaseMaterialInfoByObjId(Long objId)
{
return baseMaterialInfoMapper.selectBaseMaterialInfoByObjId(objId);
}
/**
*
*
* @param baseMaterialInfo
* @return
*/
@Override
public List<BaseMaterialInfo> selectBaseMaterialInfoList(BaseMaterialInfo baseMaterialInfo)
{
return baseMaterialInfoMapper.selectBaseMaterialInfoList(baseMaterialInfo);
}
/**
*
*
* @param baseMaterialInfo
* @return
*/
@Override
public int insertBaseMaterialInfo(BaseMaterialInfo baseMaterialInfo)
{
baseMaterialInfo.setCreateTime(DateUtils.getNowDate());
return baseMaterialInfoMapper.insertBaseMaterialInfo(baseMaterialInfo);
}
/**
*
*
* @param baseMaterialInfo
* @return
*/
@Override
public int updateBaseMaterialInfo(BaseMaterialInfo baseMaterialInfo)
{
baseMaterialInfo.setUpdateTime(DateUtils.getNowDate());
return baseMaterialInfoMapper.updateBaseMaterialInfo(baseMaterialInfo);
}
/**
*
*
* @param objIds
* @return
*/
@Override
public int deleteBaseMaterialInfoByObjIds(Long[] objIds)
{
return baseMaterialInfoMapper.deleteBaseMaterialInfoByObjIds(objIds);
}
/**
*
*
* @param objId
* @return
*/
@Override
public int deleteBaseMaterialInfoByObjId(Long objId)
{
return baseMaterialInfoMapper.deleteBaseMaterialInfoByObjId(objId);
}
}

@ -0,0 +1,115 @@
<?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.os.mes.base.mapper.BaseCustomDataMapper">
<resultMap type="BaseCustomData" id="BaseCustomDataResult">
<result property="objId" column="obj_id"/>
<result property="customType" column="custom_type"/>
<result property="customFunction" column="custom_function"/>
<result property="customCode" column="custom_code"/>
<result property="customData" column="custom_data"/>
<result property="customSort" column="custom_sort"/>
<result property="remark" column="remark"/>
<result property="isFlag" column="is_flag"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
</resultMap>
<sql id="selectBaseCustomDataVo">
select obj_id,
custom_type,
custom_function,
custom_code,
custom_data,
custom_sort,
remark,
is_flag,
create_by,
create_time,
update_by,
update_time
from base_custom_data
</sql>
<select id="selectBaseCustomDataList" parameterType="BaseCustomData" resultMap="BaseCustomDataResult">
<include refid="selectBaseCustomDataVo"/>
<where>
<if test="customType != null and customType != ''">and custom_type = #{customType}</if>
<if test="customFunction != null and customFunction != ''">and custom_function = #{customFunction}</if>
<if test="customCode != null and customCode != ''">and custom_code = #{customCode}</if>
<if test="customData != null and customData != ''">and custom_data = #{customData}</if>
<if test="customSort != null ">and custom_sort = #{customSort}</if>
<if test="isFlag != null and isFlag != ''">and is_flag = #{isFlag}</if>
</where>
</select>
<select id="selectBaseCustomDataByObjId" parameterType="Long" resultMap="BaseCustomDataResult">
<include refid="selectBaseCustomDataVo"/>
where obj_id = #{objId}
</select>
<insert id="insertBaseCustomData" parameterType="BaseCustomData" useGeneratedKeys="true" keyProperty="objId">
insert into base_custom_data
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="customType != null">custom_type,</if>
<if test="customFunction != null">custom_function,</if>
<if test="customCode != null">custom_code,</if>
<if test="customData != null">custom_data,</if>
<if test="customSort != null">custom_sort,</if>
<if test="remark != null">remark,</if>
<if test="isFlag != null">is_flag,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="customType != null">#{customType},</if>
<if test="customFunction != null">#{customFunction},</if>
<if test="customCode != null">#{customCode},</if>
<if test="customData != null">#{customData},</if>
<if test="customSort != null">#{customSort},</if>
<if test="remark != null">#{remark},</if>
<if test="isFlag != null">#{isFlag},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateBaseCustomData" parameterType="BaseCustomData">
update base_custom_data
<trim prefix="SET" suffixOverrides=",">
<if test="customType != null">custom_type = #{customType},</if>
<if test="customFunction != null">custom_function = #{customFunction},</if>
<if test="customCode != null">custom_code = #{customCode},</if>
<if test="customData != null">custom_data = #{customData},</if>
<if test="customSort != null">custom_sort = #{customSort},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="isFlag != null">is_flag = #{isFlag},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where obj_id = #{objId}
</update>
<delete id="deleteBaseCustomDataByObjId" parameterType="Long">
delete
from base_custom_data
where obj_id = #{objId}
</delete>
<delete id="deleteBaseCustomDataByObjIds" parameterType="String">
delete from base_custom_data where obj_id in
<foreach item="objId" collection="array" open="(" separator="," close=")">
#{objId}
</foreach>
</delete>
</mapper>

@ -139,4 +139,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{objId}
</foreach>
</delete>
<select id="getDeviceCode" resultType="java.lang.String">
SELECT MAX(DEVICE_CODE) DEVICE_CODE
from base_deviceledger
</select>
</mapper>

@ -0,0 +1,137 @@
<?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.os.mes.base.mapper.BaseMaterialInfoMapper">
<resultMap type="BaseMaterialInfo" id="BaseMaterialInfoResult">
<result property="objId" column="obj_id" />
<result property="materialCode" column="material_code" />
<result property="materialName" column="material_name" />
<result property="materialCategories" column="material_categories" />
<result property="materialSubclass" column="material_subclass" />
<result property="materialType" column="material_type" />
<result property="materialUnit" column="material_unit" />
<result property="unitPrice" column="unit_price" />
<result property="materialSpecifications" column="material_specifications" />
<result property="factoryCode" column="factory_code" />
<result property="productLineCode" column="product_line_code" />
<result property="isFlag" column="is_flag" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="incrementDate" column="increment_date" />
<result property="productCode" column="product_code" />
<result property="productName" column="product_name" />
</resultMap>
<sql id="selectBaseMaterialInfoVo">
select obj_id, material_code, material_name, material_categories, material_subclass, material_type, material_unit, unit_price, material_specifications, factory_code, product_line_code, is_flag, create_by, create_time, update_by, update_time, increment_date, product_code, product_name from base_material_info
</sql>
<select id="selectBaseMaterialInfoList" parameterType="BaseMaterialInfo" resultMap="BaseMaterialInfoResult">
<include refid="selectBaseMaterialInfoVo"/>
<where>
<if test="materialCode != null and materialCode != ''"> and material_code = #{materialCode}</if>
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
<if test="materialCategories != null and materialCategories != ''"> and material_categories = #{materialCategories}</if>
<if test="materialSubclass != null and materialSubclass != ''"> and material_subclass = #{materialSubclass}</if>
<if test="materialType != null and materialType != ''"> and material_type = #{materialType}</if>
<if test="materialUnit != null and materialUnit != ''"> and material_unit = #{materialUnit}</if>
<if test="unitPrice != null "> and unit_price = #{unitPrice}</if>
<if test="materialSpecifications != null and materialSpecifications != ''"> and material_specifications = #{materialSpecifications}</if>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
<if test="productLineCode != null and productLineCode != ''"> and product_line_code = #{productLineCode}</if>
<if test="isFlag != null and isFlag != ''"> and is_flag = #{isFlag}</if>
<if test="incrementDate != null "> and increment_date = #{incrementDate}</if>
<if test="productCode != null and productCode != ''"> and product_code = #{productCode}</if>
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
</where>
</select>
<select id="selectBaseMaterialInfoByObjId" parameterType="Long" resultMap="BaseMaterialInfoResult">
<include refid="selectBaseMaterialInfoVo"/>
where obj_id = #{objId}
</select>
<insert id="insertBaseMaterialInfo" parameterType="BaseMaterialInfo" useGeneratedKeys="true" keyProperty="objId">
insert into base_material_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="materialCode != null and materialCode != ''">material_code,</if>
<if test="materialName != null">material_name,</if>
<if test="materialCategories != null">material_categories,</if>
<if test="materialSubclass != null">material_subclass,</if>
<if test="materialType != null">material_type,</if>
<if test="materialUnit != null">material_unit,</if>
<if test="unitPrice != null">unit_price,</if>
<if test="materialSpecifications != null">material_specifications,</if>
<if test="factoryCode != null">factory_code,</if>
<if test="productLineCode != null">product_line_code,</if>
<if test="isFlag != null">is_flag,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="incrementDate != null">increment_date,</if>
<if test="productCode != null">product_code,</if>
<if test="productName != null">product_name,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="materialCode != null and materialCode != ''">#{materialCode},</if>
<if test="materialName != null">#{materialName},</if>
<if test="materialCategories != null">#{materialCategories},</if>
<if test="materialSubclass != null">#{materialSubclass},</if>
<if test="materialType != null">#{materialType},</if>
<if test="materialUnit != null">#{materialUnit},</if>
<if test="unitPrice != null">#{unitPrice},</if>
<if test="materialSpecifications != null">#{materialSpecifications},</if>
<if test="factoryCode != null">#{factoryCode},</if>
<if test="productLineCode != null">#{productLineCode},</if>
<if test="isFlag != null">#{isFlag},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="incrementDate != null">#{incrementDate},</if>
<if test="productCode != null">#{productCode},</if>
<if test="productName != null">#{productName},</if>
</trim>
</insert>
<update id="updateBaseMaterialInfo" parameterType="BaseMaterialInfo">
update base_material_info
<trim prefix="SET" suffixOverrides=",">
<if test="materialCode != null and materialCode != ''">material_code = #{materialCode},</if>
<if test="materialName != null">material_name = #{materialName},</if>
<if test="materialCategories != null">material_categories = #{materialCategories},</if>
<if test="materialSubclass != null">material_subclass = #{materialSubclass},</if>
<if test="materialType != null">material_type = #{materialType},</if>
<if test="materialUnit != null">material_unit = #{materialUnit},</if>
<if test="unitPrice != null">unit_price = #{unitPrice},</if>
<if test="materialSpecifications != null">material_specifications = #{materialSpecifications},</if>
<if test="factoryCode != null">factory_code = #{factoryCode},</if>
<if test="productLineCode != null">product_line_code = #{productLineCode},</if>
<if test="isFlag != null">is_flag = #{isFlag},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="incrementDate != null">increment_date = #{incrementDate},</if>
<if test="productCode != null">product_code = #{productCode},</if>
<if test="productName != null">product_name = #{productName},</if>
</trim>
where obj_id = #{objId}
</update>
<delete id="deleteBaseMaterialInfoByObjId" parameterType="Long">
delete from base_material_info where obj_id = #{objId}
</delete>
<delete id="deleteBaseMaterialInfoByObjIds" parameterType="String">
delete from base_material_info where obj_id in
<foreach item="objId" collection="array" open="(" separator="," close=")">
#{objId}
</foreach>
</delete>
</mapper>
Loading…
Cancel
Save