Merge remote-tracking branch 'origin/master'

highway
A0010407 1 year ago
commit d33acee6d5

@ -0,0 +1,97 @@
package com.op.mes.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
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.op.common.log.annotation.Log;
import com.op.common.log.enums.BusinessType;
import com.op.common.security.annotation.RequiresPermissions;
import com.op.mes.domain.MesPrepareDetail;
import com.op.mes.service.IMesPrepareDetailService;
import com.op.common.core.web.controller.BaseController;
import com.op.common.core.web.domain.AjaxResult;
import com.op.common.core.utils.poi.ExcelUtil;
import com.op.common.core.web.page.TableDataInfo;
/**
* mesController
*
* @author Open Platform
* @date 2023-08-04
*/
@RestController
@RequestMapping("/prepareDetail")
public class MesPrepareDetailController extends BaseController {
@Autowired
private IMesPrepareDetailService mesPrepareDetailService;
/**
* mes
*/
@RequiresPermissions("mes:prepareDetail:list")
@GetMapping("/list")
public TableDataInfo list(MesPrepareDetail mesPrepareDetail) {
startPage();
List<MesPrepareDetail> list = mesPrepareDetailService.selectMesPrepareDetailList(mesPrepareDetail);
return getDataTable(list);
}
/**
* mes
*/
@RequiresPermissions("mes:prepareDetail:export")
@Log(title = "mes备料单明细", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, MesPrepareDetail mesPrepareDetail) {
List<MesPrepareDetail> list = mesPrepareDetailService.selectMesPrepareDetailList(mesPrepareDetail);
ExcelUtil<MesPrepareDetail> util = new ExcelUtil<MesPrepareDetail>(MesPrepareDetail.class);
util.exportExcel(response, list, "mes备料单明细数据");
}
/**
* mes
*/
@RequiresPermissions("mes:prepareDetail:query")
@GetMapping(value = "/{recordId}")
public AjaxResult getInfo(@PathVariable("recordId") String recordId) {
return success(mesPrepareDetailService.selectMesPrepareDetailByRecordId(recordId));
}
/**
* mes
*/
@RequiresPermissions("mes:prepareDetail:add")
@Log(title = "mes备料单明细", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MesPrepareDetail mesPrepareDetail) {
return toAjax(mesPrepareDetailService.insertMesPrepareDetail(mesPrepareDetail));
}
/**
* mes
*/
@RequiresPermissions("mes:prepareDetail:edit")
@Log(title = "mes备料单明细", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MesPrepareDetail mesPrepareDetail) {
return toAjax(mesPrepareDetailService.updateMesPrepareDetail(mesPrepareDetail));
}
/**
* mes
*/
@RequiresPermissions("mes:prepareDetail:remove")
@Log(title = "mes备料单明细", businessType = BusinessType.DELETE)
@DeleteMapping("/{recordIds}")
public AjaxResult remove(@PathVariable String[] recordIds) {
return toAjax(mesPrepareDetailService.deleteMesPrepareDetailByRecordIds(recordIds));
}
}

@ -0,0 +1,222 @@
package com.op.mes.domain;
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.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity;
/**
* mes mes_prepare_detail
*
* @author Open Platform
* @date 2023-08-04
*/
public class MesPrepareDetail extends BaseEntity {
private static final long serialVersionUID = 1L;
/** ID */
private String recordId;
/** 备料主ID */
@Excel(name = "备料主ID")
private String prepareId;
/** 物料编号 */
@Excel(name = "物料编号")
private String materialCode;
/** 物料名称 */
@Excel(name = "物料名称")
private String materailName;
/** 规格型号 */
@Excel(name = "规格型号")
private String materailSpc;
/** 单位 */
@Excel(name = "单位")
private String unit;
/** 生产数量 */
@Excel(name = "生产数量")
private Long quantity;
/** 工单生产日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "工单生产日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date productDate;
/** 班次 */
@Excel(name = "班次")
private String shiftId;
/** 单据状态 */
@Excel(name = "单据状态")
private String status;
/** 预留字段1 */
@Excel(name = "预留字段1")
private String attr1;
/** 预留字段2 */
@Excel(name = "预留字段2")
private String attr2;
/** 预留字段3 */
@Excel(name = "预留字段3")
private String attr3;
/** 预留字段4 */
@Excel(name = "预留字段4")
private String attr4;
/** 产品类型 */
@Excel(name = "产品类型")
private String prodType;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String factoryCode;
public void setRecordId(String recordId) {
this.recordId = recordId;
}
public String getRecordId() {
return recordId;
}
public void setPrepareId(String prepareId) {
this.prepareId = prepareId;
}
public String getPrepareId() {
return prepareId;
}
public void setMaterialCode(String materialCode) {
this.materialCode = materialCode;
}
public String getMaterialCode() {
return materialCode;
}
public void setMaterailName(String materailName) {
this.materailName = materailName;
}
public String getMaterailName() {
return materailName;
}
public void setMaterailSpc(String materailSpc) {
this.materailSpc = materailSpc;
}
public String getMaterailSpc() {
return materailSpc;
}
public void setUnit(String unit) {
this.unit = unit;
}
public String getUnit() {
return unit;
}
public void setQuantity(Long quantity) {
this.quantity = quantity;
}
public Long getQuantity() {
return quantity;
}
public void setProductDate(Date productDate) {
this.productDate = productDate;
}
public Date getProductDate() {
return productDate;
}
public void setShiftId(String shiftId) {
this.shiftId = shiftId;
}
public String getShiftId() {
return shiftId;
}
public void setStatus(String status) {
this.status = status;
}
public String getStatus() {
return status;
}
public void setAttr1(String attr1) {
this.attr1 = attr1;
}
public String getAttr1() {
return attr1;
}
public void setAttr2(String attr2) {
this.attr2 = attr2;
}
public String getAttr2() {
return attr2;
}
public void setAttr3(String attr3) {
this.attr3 = attr3;
}
public String getAttr3() {
return attr3;
}
public void setAttr4(String attr4) {
this.attr4 = attr4;
}
public String getAttr4() {
return attr4;
}
public void setProdType(String prodType) {
this.prodType = prodType;
}
public String getProdType() {
return prodType;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
public String getFactoryCode() {
return factoryCode;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("recordId", getRecordId())
.append("prepareId", getPrepareId())
.append("materialCode", getMaterialCode())
.append("materailName", getMaterailName())
.append("materailSpc", getMaterailSpc())
.append("unit", getUnit())
.append("quantity", getQuantity())
.append("productDate", getProductDate())
.append("shiftId", getShiftId())
.append("status", getStatus())
.append("remark", getRemark())
.append("attr1", getAttr1())
.append("attr2", getAttr2())
.append("attr3", getAttr3())
.append("attr4", getAttr4())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("prodType", getProdType())
.append("factoryCode", getFactoryCode())
.toString();
}
}

@ -0,0 +1,61 @@
package com.op.mes.mapper;
import java.util.List;
import com.op.mes.domain.MesPrepareDetail;
/**
* mesMapper
*
* @author Open Platform
* @date 2023-08-04
*/
public interface MesPrepareDetailMapper {
/**
* mes
*
* @param recordId mes
* @return mes
*/
public MesPrepareDetail selectMesPrepareDetailByRecordId(String recordId);
/**
* mes
*
* @param mesPrepareDetail mes
* @return mes
*/
public List<MesPrepareDetail> selectMesPrepareDetailList(MesPrepareDetail mesPrepareDetail);
/**
* mes
*
* @param mesPrepareDetail mes
* @return
*/
public int insertMesPrepareDetail(MesPrepareDetail mesPrepareDetail);
/**
* mes
*
* @param mesPrepareDetail mes
* @return
*/
public int updateMesPrepareDetail(MesPrepareDetail mesPrepareDetail);
/**
* mes
*
* @param recordId mes
* @return
*/
public int deleteMesPrepareDetailByRecordId(String recordId);
/**
* mes
*
* @param recordIds
* @return
*/
public int deleteMesPrepareDetailByRecordIds(String[] recordIds);
}

@ -0,0 +1,60 @@
package com.op.mes.service;
import java.util.List;
import com.op.mes.domain.MesPrepareDetail;
/**
* mesService
*
* @author Open Platform
* @date 2023-08-04
*/
public interface IMesPrepareDetailService {
/**
* mes
*
* @param recordId mes
* @return mes
*/
public MesPrepareDetail selectMesPrepareDetailByRecordId(String recordId);
/**
* mes
*
* @param mesPrepareDetail mes
* @return mes
*/
public List<MesPrepareDetail> selectMesPrepareDetailList(MesPrepareDetail mesPrepareDetail);
/**
* mes
*
* @param mesPrepareDetail mes
* @return
*/
public int insertMesPrepareDetail(MesPrepareDetail mesPrepareDetail);
/**
* mes
*
* @param mesPrepareDetail mes
* @return
*/
public int updateMesPrepareDetail(MesPrepareDetail mesPrepareDetail);
/**
* mes
*
* @param recordIds mes
* @return
*/
public int deleteMesPrepareDetailByRecordIds(String[] recordIds);
/**
* mes
*
* @param recordId mes
* @return
*/
public int deleteMesPrepareDetailByRecordId(String recordId);
}

@ -0,0 +1,89 @@
package com.op.mes.service.impl;
import java.util.List;
import com.op.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.mes.mapper.MesPrepareDetailMapper;
import com.op.mes.domain.MesPrepareDetail;
import com.op.mes.service.IMesPrepareDetailService;
/**
* mesService
*
* @author Open Platform
* @date 2023-08-04
*/
@Service
public class MesPrepareDetailServiceImpl implements IMesPrepareDetailService {
@Autowired
private MesPrepareDetailMapper mesPrepareDetailMapper;
/**
* mes
*
* @param recordId mes
* @return mes
*/
@Override
public MesPrepareDetail selectMesPrepareDetailByRecordId(String recordId) {
return mesPrepareDetailMapper.selectMesPrepareDetailByRecordId(recordId);
}
/**
* mes
*
* @param mesPrepareDetail mes
* @return mes
*/
@Override
public List<MesPrepareDetail> selectMesPrepareDetailList(MesPrepareDetail mesPrepareDetail) {
return mesPrepareDetailMapper.selectMesPrepareDetailList(mesPrepareDetail);
}
/**
* mes
*
* @param mesPrepareDetail mes
* @return
*/
@Override
public int insertMesPrepareDetail(MesPrepareDetail mesPrepareDetail) {
mesPrepareDetail.setCreateTime(DateUtils.getNowDate());
return mesPrepareDetailMapper.insertMesPrepareDetail(mesPrepareDetail);
}
/**
* mes
*
* @param mesPrepareDetail mes
* @return
*/
@Override
public int updateMesPrepareDetail(MesPrepareDetail mesPrepareDetail) {
mesPrepareDetail.setUpdateTime(DateUtils.getNowDate());
return mesPrepareDetailMapper.updateMesPrepareDetail(mesPrepareDetail);
}
/**
* mes
*
* @param recordIds mes
* @return
*/
@Override
public int deleteMesPrepareDetailByRecordIds(String[] recordIds) {
return mesPrepareDetailMapper.deleteMesPrepareDetailByRecordIds(recordIds);
}
/**
* mes
*
* @param recordId mes
* @return
*/
@Override
public int deleteMesPrepareDetailByRecordId(String recordId) {
return mesPrepareDetailMapper.deleteMesPrepareDetailByRecordId(recordId);
}
}

@ -0,0 +1,148 @@
<?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.op.mes.mapper.MesPrepareDetailMapper">
<resultMap type="MesPrepareDetail" id="MesPrepareDetailResult">
<result property="recordId" column="record_id" />
<result property="prepareId" column="prepare_id" />
<result property="materialCode" column="material_code" />
<result property="materailName" column="materail_name" />
<result property="materailSpc" column="materail_spc" />
<result property="unit" column="unit" />
<result property="quantity" column="quantity" />
<result property="productDate" column="product_date" />
<result property="shiftId" column="shift_id" />
<result property="status" column="status" />
<result property="remark" column="remark" />
<result property="attr1" column="attr1" />
<result property="attr2" column="attr2" />
<result property="attr3" column="attr3" />
<result property="attr4" column="attr4" />
<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="prodType" column="prod_type" />
<result property="factoryCode" column="factory_code" />
</resultMap>
<sql id="selectMesPrepareDetailVo">
select record_id, prepare_id, material_code, materail_name, materail_spc, unit, quantity, product_date, shift_id, status, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time, prod_type, factory_code from mes_prepare_detail
</sql>
<select id="selectMesPrepareDetailList" parameterType="MesPrepareDetail" resultMap="MesPrepareDetailResult">
<include refid="selectMesPrepareDetailVo"/>
<where>
<if test="prepareId != null and prepareId != ''"> and prepare_id = #{prepareId}</if>
<if test="materialCode != null and materialCode != ''"> and material_code = #{materialCode}</if>
<if test="materailName != null and materailName != ''"> and materail_name like concat('%', #{materailName}, '%')</if>
<if test="materailSpc != null and materailSpc != ''"> and materail_spc = #{materailSpc}</if>
<if test="unit != null and unit != ''"> and unit = #{unit}</if>
<if test="quantity != null "> and quantity = #{quantity}</if>
<if test="productDate != null "> and product_date = #{productDate}</if>
<if test="shiftId != null and shiftId != ''"> and shift_id = #{shiftId}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
<if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if>
<if test="attr3 != null and attr3 != ''"> and attr3 = #{attr3}</if>
<if test="attr4 != null and attr4 != ''"> and attr4 = #{attr4}</if>
<if test="prodType != null and prodType != ''"> and prod_type = #{prodType}</if>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
</where>
</select>
<select id="selectMesPrepareDetailByRecordId" parameterType="String" resultMap="MesPrepareDetailResult">
<include refid="selectMesPrepareDetailVo"/>
where record_id = #{recordId}
</select>
<insert id="insertMesPrepareDetail" parameterType="MesPrepareDetail">
insert into mes_prepare_detail
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="recordId != null">record_id,</if>
<if test="prepareId != null and prepareId != ''">prepare_id,</if>
<if test="materialCode != null and materialCode != ''">material_code,</if>
<if test="materailName != null and materailName != ''">materail_name,</if>
<if test="materailSpc != null">materail_spc,</if>
<if test="unit != null and unit != ''">unit,</if>
<if test="quantity != null">quantity,</if>
<if test="productDate != null">product_date,</if>
<if test="shiftId != null">shift_id,</if>
<if test="status != null">status,</if>
<if test="remark != null">remark,</if>
<if test="attr1 != null">attr1,</if>
<if test="attr2 != null">attr2,</if>
<if test="attr3 != null">attr3,</if>
<if test="attr4 != null">attr4,</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="prodType != null">prod_type,</if>
<if test="factoryCode != null">factory_code,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="recordId != null">#{recordId},</if>
<if test="prepareId != null and prepareId != ''">#{prepareId},</if>
<if test="materialCode != null and materialCode != ''">#{materialCode},</if>
<if test="materailName != null and materailName != ''">#{materailName},</if>
<if test="materailSpc != null">#{materailSpc},</if>
<if test="unit != null and unit != ''">#{unit},</if>
<if test="quantity != null">#{quantity},</if>
<if test="productDate != null">#{productDate},</if>
<if test="shiftId != null">#{shiftId},</if>
<if test="status != null">#{status},</if>
<if test="remark != null">#{remark},</if>
<if test="attr1 != null">#{attr1},</if>
<if test="attr2 != null">#{attr2},</if>
<if test="attr3 != null">#{attr3},</if>
<if test="attr4 != null">#{attr4},</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="prodType != null">#{prodType},</if>
<if test="factoryCode != null">#{factoryCode},</if>
</trim>
</insert>
<update id="updateMesPrepareDetail" parameterType="MesPrepareDetail">
update mes_prepare_detail
<trim prefix="SET" suffixOverrides=",">
<if test="prepareId != null and prepareId != ''">prepare_id = #{prepareId},</if>
<if test="materialCode != null and materialCode != ''">material_code = #{materialCode},</if>
<if test="materailName != null and materailName != ''">materail_name = #{materailName},</if>
<if test="materailSpc != null">materail_spc = #{materailSpc},</if>
<if test="unit != null and unit != ''">unit = #{unit},</if>
<if test="quantity != null">quantity = #{quantity},</if>
<if test="productDate != null">product_date = #{productDate},</if>
<if test="shiftId != null">shift_id = #{shiftId},</if>
<if test="status != null">status = #{status},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="attr1 != null">attr1 = #{attr1},</if>
<if test="attr2 != null">attr2 = #{attr2},</if>
<if test="attr3 != null">attr3 = #{attr3},</if>
<if test="attr4 != null">attr4 = #{attr4},</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="prodType != null">prod_type = #{prodType},</if>
<if test="factoryCode != null">factory_code = #{factoryCode},</if>
</trim>
where record_id = #{recordId}
</update>
<delete id="deleteMesPrepareDetailByRecordId" parameterType="String">
delete from mes_prepare_detail where record_id = #{recordId}
</delete>
<delete id="deleteMesPrepareDetailByRecordIds" parameterType="String">
delete from mes_prepare_detail where record_id in
<foreach item="recordId" collection="array" open="(" separator="," close=")">
#{recordId}
</foreach>
</delete>
</mapper>
Loading…
Cancel
Save