change - add补打条码记录

master
yinq 7 months ago
parent d3a00531c4
commit 915d86885f

@ -0,0 +1,99 @@
package com.aucma.report.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.aucma.common.utils.DateUtils;
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.aucma.common.annotation.Log;
import com.aucma.common.core.controller.BaseController;
import com.aucma.common.core.domain.AjaxResult;
import com.aucma.common.enums.BusinessType;
import com.aucma.report.domain.PrintSupplementBarCode;
import com.aucma.report.service.IPrintSupplementBarCodeService;
import com.aucma.common.utils.poi.ExcelUtil;
import com.aucma.common.core.page.TableDataInfo;
/**
* Controller
*
* @author Yinq
* @date 2024-04-17
*/
@RestController
@RequestMapping("/report/supplementBarCode")
public class PrintSupplementBarCodeController extends BaseController {
@Autowired
private IPrintSupplementBarCodeService printSupplementBarCodeService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('report:supplementBarCode:list')")
@GetMapping("/list")
public TableDataInfo list(PrintSupplementBarCode printSupplementBarCode) {
startPage();
List<PrintSupplementBarCode> list = printSupplementBarCodeService.selectPrintSupplementBarCodeList(printSupplementBarCode);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('report:supplementBarCode:export')")
@Log(title = "补打条码记录", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, PrintSupplementBarCode printSupplementBarCode) {
List<PrintSupplementBarCode> list = printSupplementBarCodeService.selectPrintSupplementBarCodeList(printSupplementBarCode);
ExcelUtil<PrintSupplementBarCode> util = new ExcelUtil<PrintSupplementBarCode>(PrintSupplementBarCode.class);
util.exportExcel(response, list, "补打条码记录数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('report:supplementBarCode:query')")
@GetMapping(value = "/{objId}")
public AjaxResult getInfo(@PathVariable("objId") Long objId) {
return success(printSupplementBarCodeService.selectPrintSupplementBarCodeByObjId(objId));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('report:supplementBarCode:add')")
@Log(title = "补打条码记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody PrintSupplementBarCode printSupplementBarCode) {
return toAjax(printSupplementBarCodeService.insertPrintSupplementBarCode(printSupplementBarCode));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('report:supplementBarCode:edit')")
@Log(title = "补打条码记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody PrintSupplementBarCode printSupplementBarCode) {
return toAjax(printSupplementBarCodeService.updatePrintSupplementBarCode(printSupplementBarCode));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('report:supplementBarCode:remove')")
@Log(title = "补打条码记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{objIds}")
public AjaxResult remove(@PathVariable Long[] objIds) {
return toAjax(printSupplementBarCodeService.deletePrintSupplementBarCodeByObjIds(objIds));
}
}

@ -0,0 +1,160 @@
package com.aucma.report.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.aucma.common.annotation.Excel;
import com.aucma.common.core.domain.BaseEntity;
/**
* print_supplementbarcode
*
* @author Yinq
* @date 2024-04-17
*/
public class PrintSupplementBarCode extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
*
*/
private Long objId;
/**
* SAP
*/
@Excel(name = "SAP计划编号")
private String orderCode;
/**
*
*/
@Excel(name = "物料编码")
private String materialCode;
/**
*
*/
@Excel(name = "物料名称")
private String materialName;
/**
*
*/
@Excel(name = "打印条码")
private String materialBarcode;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "打印时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date printTime;
/**
*
*/
@Excel(name = "打印类型")
private String printBartype;
/**
*
*/
@Excel(name = "打印名称")
private String printName;
/**
* 1=,0=
*/
@Excel(name = "是否打印 1=已打印,0=未打印")
private String isPrint;
public void setObjId(Long objId) {
this.objId = objId;
}
public Long getObjId() {
return objId;
}
public void setOrderCode(String orderCode) {
this.orderCode = orderCode;
}
public String getOrderCode() {
return orderCode;
}
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 setMaterialBarcode(String materialBarcode) {
this.materialBarcode = materialBarcode;
}
public String getMaterialBarcode() {
return materialBarcode;
}
public void setPrintTime(Date printTime) {
this.printTime = printTime;
}
public Date getPrintTime() {
return printTime;
}
public void setPrintBartype(String printBartype) {
this.printBartype = printBartype;
}
public String getPrintBartype() {
return printBartype;
}
public void setPrintName(String printName) {
this.printName = printName;
}
public String getPrintName() {
return printName;
}
public void setIsPrint(String isPrint) {
this.isPrint = isPrint;
}
public String getIsPrint() {
return isPrint;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("objId", getObjId())
.append("orderCode", getOrderCode())
.append("materialCode", getMaterialCode())
.append("materialName", getMaterialName())
.append("materialBarcode", getMaterialBarcode())
.append("printTime", getPrintTime())
.append("printBartype", getPrintBartype())
.append("printName", getPrintName())
.append("isPrint", getIsPrint())
.toString();
}
}

@ -0,0 +1,61 @@
package com.aucma.report.mapper;
import java.util.List;
import com.aucma.report.domain.PrintSupplementBarCode;
/**
* Mapper
*
* @author Yinq
* @date 2024-04-17
*/
public interface PrintSupplementBarCodeMapper {
/**
*
*
* @param objId
* @return
*/
public PrintSupplementBarCode selectPrintSupplementBarCodeByObjId(Long objId);
/**
*
*
* @param printSupplementBarCode
* @return
*/
public List<PrintSupplementBarCode> selectPrintSupplementBarCodeList(PrintSupplementBarCode printSupplementBarCode);
/**
*
*
* @param printSupplementBarCode
* @return
*/
public int insertPrintSupplementBarCode(PrintSupplementBarCode printSupplementBarCode);
/**
*
*
* @param printSupplementBarCode
* @return
*/
public int updatePrintSupplementBarCode(PrintSupplementBarCode printSupplementBarCode);
/**
*
*
* @param objId
* @return
*/
public int deletePrintSupplementBarCodeByObjId(Long objId);
/**
*
*
* @param objIds
* @return
*/
public int deletePrintSupplementBarCodeByObjIds(Long[] objIds);
}

@ -0,0 +1,61 @@
package com.aucma.report.service;
import java.util.List;
import com.aucma.report.domain.PrintSupplementBarCode;
/**
* Service
*
* @author Yinq
* @date 2024-04-17
*/
public interface IPrintSupplementBarCodeService {
/**
*
*
* @param objId
* @return
*/
public PrintSupplementBarCode selectPrintSupplementBarCodeByObjId(Long objId);
/**
*
*
* @param printSupplementBarCode
* @return
*/
public List<PrintSupplementBarCode> selectPrintSupplementBarCodeList(PrintSupplementBarCode printSupplementBarCode);
/**
*
*
* @param printSupplementBarCode
* @return
*/
public int insertPrintSupplementBarCode(PrintSupplementBarCode printSupplementBarCode);
/**
*
*
* @param printSupplementBarCode
* @return
*/
public int updatePrintSupplementBarCode(PrintSupplementBarCode printSupplementBarCode);
/**
*
*
* @param objIds
* @return
*/
public int deletePrintSupplementBarCodeByObjIds(Long[] objIds);
/**
*
*
* @param objId
* @return
*/
public int deletePrintSupplementBarCodeByObjId(Long objId);
}

@ -0,0 +1,87 @@
package com.aucma.report.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.aucma.report.mapper.PrintSupplementBarCodeMapper;
import com.aucma.report.domain.PrintSupplementBarCode;
import com.aucma.report.service.IPrintSupplementBarCodeService;
/**
* Service
*
* @author Yinq
* @date 2024-04-17
*/
@Service
public class PrintSupplementBarCodeServiceImpl implements IPrintSupplementBarCodeService {
@Autowired
private PrintSupplementBarCodeMapper printSupplementBarCodeMapper;
/**
*
*
* @param objId
* @return
*/
@Override
public PrintSupplementBarCode selectPrintSupplementBarCodeByObjId(Long objId) {
return printSupplementBarCodeMapper.selectPrintSupplementBarCodeByObjId(objId);
}
/**
*
*
* @param printSupplementBarCode
* @return
*/
@Override
public List<PrintSupplementBarCode> selectPrintSupplementBarCodeList(PrintSupplementBarCode printSupplementBarCode) {
return printSupplementBarCodeMapper.selectPrintSupplementBarCodeList(printSupplementBarCode);
}
/**
*
*
* @param printSupplementBarCode
* @return
*/
@Override
public int insertPrintSupplementBarCode(PrintSupplementBarCode printSupplementBarCode) {
return printSupplementBarCodeMapper.insertPrintSupplementBarCode(printSupplementBarCode);
}
/**
*
*
* @param printSupplementBarCode
* @return
*/
@Override
public int updatePrintSupplementBarCode(PrintSupplementBarCode printSupplementBarCode) {
return printSupplementBarCodeMapper.updatePrintSupplementBarCode(printSupplementBarCode);
}
/**
*
*
* @param objIds
* @return
*/
@Override
public int deletePrintSupplementBarCodeByObjIds(Long[] objIds) {
return printSupplementBarCodeMapper.deletePrintSupplementBarCodeByObjIds(objIds);
}
/**
*
*
* @param objId
* @return
*/
@Override
public int deletePrintSupplementBarCodeByObjId(Long objId) {
return printSupplementBarCodeMapper.deletePrintSupplementBarCodeByObjId(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.aucma.report.mapper.PrintSupplementBarCodeMapper">
<resultMap type="PrintSupplementBarCode" id="PrintSupplementBarCodeResult">
<result property="objId" column="obj_id"/>
<result property="orderCode" column="order_code"/>
<result property="materialCode" column="material_code"/>
<result property="materialName" column="material_name"/>
<result property="materialBarcode" column="material_barcode"/>
<result property="printTime" column="print_time"/>
<result property="printBartype" column="print_bartype"/>
<result property="printName" column="print_name"/>
<result property="isPrint" column="is_print"/>
</resultMap>
<sql id="selectPrintSupplementBarCodeVo">
SELECT PS.ORDER_CODE,
PS.MATERIAL_CODE,
BM.MATERIAL_NAME,
PS.MATERIAL_BARCODE,
PS.PRINT_TIME,
CASE WHEN PS.PRINT_BARTYPE = '1' THEN '箱体' ELSE '内胆' END PRINT_BARTYPE,
PS.PRINT_NAME,
CASE WHEN PS.IS_PRINT = '1' THEN '已打印' ELSE '未打印' END IS_PRINT
FROM C##AUCMA_SCADA.PRINT_SUPPLEMENTBARCODE PS
LEFT JOIN C##AUCMA_MES.BASE_MATERIALINFO BM ON BM.MATERIAL_CODE = PS.MATERIAL_CODE
</sql>
<select id="selectPrintSupplementBarCodeList" parameterType="PrintSupplementBarCode"
resultMap="PrintSupplementBarCodeResult">
<include refid="selectPrintSupplementBarCodeVo"/>
<where>
<if test="orderCode != null and orderCode != ''">and PS.order_code = #{orderCode}</if>
<if test="materialCode != null and materialCode != ''">and PS.material_code = #{materialCode}</if>
<if test="materialName != null and materialName != ''">and PS.material_name like concat(concat('%',
#{materialName}), '%')
</if>
<if test="materialBarcode != null and materialBarcode != ''">and PS.material_barcode = #{materialBarcode}</if>
<if test="params.beginPrintTime != null and params.beginPrintTime != '' and params.endPrintTime != null and params.endPrintTime != ''">
and PS.print_time between to_date(#{params.beginPrintTime}, 'yyyy-mm-dd hh24:mi:ss') and
to_date(#{params.endPrintTime}, 'yyyy-mm-dd hh24:mi:ss')
</if>
<if test="printBartype != null ">and PS.print_bartype = #{printBartype}</if>
<if test="printName != null and printName != ''">and PS.print_name like concat(concat('%', #{printName}),
'%')
</if>
<if test="isPrint != null and isPrint != ''">and PS.is_print = #{isPrint}</if>
</where>
</select>
<select id="selectPrintSupplementBarCodeByObjId" parameterType="Long" resultMap="PrintSupplementBarCodeResult">
<include refid="selectPrintSupplementBarCodeVo"/>
where PS.obj_id = #{objId}
</select>
<insert id="insertPrintSupplementBarCode" parameterType="PrintSupplementBarCode">
<selectKey keyProperty="objId" resultType="long" order="BEFORE">
SELECT seq_print_supplementbarcode.NEXTVAL as objId FROM DUAL
</selectKey>
insert into print_supplementbarcode
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="objId != null">obj_id,</if>
<if test="orderCode != null">order_code,</if>
<if test="materialCode != null">material_code,</if>
<if test="materialName != null">material_name,</if>
<if test="materialBarcode != null">material_barcode,</if>
<if test="printTime != null">print_time,</if>
<if test="printBartype != null">print_bartype,</if>
<if test="printName != null">print_name,</if>
<if test="isPrint != null">is_print,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="objId != null">#{objId},</if>
<if test="orderCode != null">#{orderCode},</if>
<if test="materialCode != null">#{materialCode},</if>
<if test="materialName != null">#{materialName},</if>
<if test="materialBarcode != null">#{materialBarcode},</if>
<if test="printTime != null">#{printTime},</if>
<if test="printBartype != null">#{printBartype},</if>
<if test="printName != null">#{printName},</if>
<if test="isPrint != null">#{isPrint},</if>
</trim>
</insert>
<update id="updatePrintSupplementBarCode" parameterType="PrintSupplementBarCode">
update print_supplementbarcode
<trim prefix="SET" suffixOverrides=",">
<if test="orderCode != null">order_code = #{orderCode},</if>
<if test="materialCode != null">material_code = #{materialCode},</if>
<if test="materialName != null">material_name = #{materialName},</if>
<if test="materialBarcode != null">material_barcode = #{materialBarcode},</if>
<if test="printTime != null">print_time = #{printTime},</if>
<if test="printBartype != null">print_bartype = #{printBartype},</if>
<if test="printName != null">print_name = #{printName},</if>
<if test="isPrint != null">is_print = #{isPrint},</if>
</trim>
where obj_id = #{objId}
</update>
<delete id="deletePrintSupplementBarCodeByObjId" parameterType="Long">
delete
from print_supplementbarcode
where obj_id = #{objId}
</delete>
<delete id="deletePrintSupplementBarCodeByObjIds" parameterType="String">
delete from print_supplementbarcode where obj_id in
<foreach item="objId" collection="array" open="(" separator="," close=")">
#{objId}
</foreach>
</delete>
</mapper>
Loading…
Cancel
Save