change - add切换订单

master
yinq 2 years ago
parent 4277f1ccbf
commit af375ffb0e

@ -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.RecordSwitchOrder;
import com.aucma.report.service.IRecordSwitchOrderService;
import com.aucma.common.utils.poi.ExcelUtil;
import com.aucma.common.core.page.TableDataInfo;
/**
* Controller
*
* @author Yinq
* @date 2024-04-23
*/
@RestController
@RequestMapping("/report/switchOrder")
public class RecordSwitchOrderController extends BaseController {
@Autowired
private IRecordSwitchOrderService recordSwitchOrderService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('report:switchOrder:list')")
@GetMapping("/list")
public TableDataInfo list(RecordSwitchOrder recordSwitchOrder) {
startPage();
List<RecordSwitchOrder> list = recordSwitchOrderService.selectRecordSwitchOrderList(recordSwitchOrder);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('report:switchOrder:export')")
@Log(title = "切换订单管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, RecordSwitchOrder recordSwitchOrder) {
List<RecordSwitchOrder> list = recordSwitchOrderService.selectRecordSwitchOrderList(recordSwitchOrder);
ExcelUtil<RecordSwitchOrder> util = new ExcelUtil<RecordSwitchOrder>(RecordSwitchOrder.class);
util.exportExcel(response, list, "切换订单管理数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('report:switchOrder:query')")
@GetMapping(value = "/{objId}")
public AjaxResult getInfo(@PathVariable("objId") Long objId) {
return success(recordSwitchOrderService.selectRecordSwitchOrderByObjId(objId));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('report:switchOrder:add')")
@Log(title = "切换订单管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody RecordSwitchOrder recordSwitchOrder) {
return toAjax(recordSwitchOrderService.insertRecordSwitchOrder(recordSwitchOrder));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('report:switchOrder:edit')")
@Log(title = "切换订单管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody RecordSwitchOrder recordSwitchOrder) {
return toAjax(recordSwitchOrderService.updateRecordSwitchOrder(recordSwitchOrder));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('report:switchOrder:remove')")
@Log(title = "切换订单管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{objIds}")
public AjaxResult remove(@PathVariable Long[] objIds) {
return toAjax(recordSwitchOrderService.deleteRecordSwitchOrderByObjIds(objIds));
}
}

@ -0,0 +1,132 @@
package com.aucma.report.domain;
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;
/**
* record_switch_order
*
* @author Yinq
* @date 2024-04-23
*/
public class RecordSwitchOrder extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
*
*/
@Excel(name = "主键标识")
private Long objId;
/**
*
*/
@Excel(name = "箱体码")
private String materialBarcode;
/**
*
*/
@Excel(name = "切换工位编号")
private String switchStationCode;
/**
*
*/
@Excel(name = "原订单编号")
private String oldOrderCode;
/**
*
*/
@Excel(name = "切换订单标识")
private String isSwitch;
/**
*
*/
@Excel(name = "订单编号")
private String orderCode;
/**
*
*/
@Excel(name = "打印标识")
private String isPrint;
public void setObjId(Long objId) {
this.objId = objId;
}
public Long getObjId() {
return objId;
}
public void setMaterialBarcode(String materialBarcode) {
this.materialBarcode = materialBarcode;
}
public String getMaterialBarcode() {
return materialBarcode;
}
public void setSwitchStationCode(String switchStationCode) {
this.switchStationCode = switchStationCode;
}
public String getSwitchStationCode() {
return switchStationCode;
}
public void setOldOrderCode(String oldOrderCode) {
this.oldOrderCode = oldOrderCode;
}
public String getOldOrderCode() {
return oldOrderCode;
}
public void setIsSwitch(String isSwitch) {
this.isSwitch = isSwitch;
}
public String getIsSwitch() {
return isSwitch;
}
public void setOrderCode(String orderCode) {
this.orderCode = orderCode;
}
public String getOrderCode() {
return orderCode;
}
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("materialBarcode", getMaterialBarcode())
.append("switchStationCode", getSwitchStationCode())
.append("oldOrderCode", getOldOrderCode())
.append("isSwitch", getIsSwitch())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.append("orderCode", getOrderCode())
.append("isPrint", getIsPrint())
.toString();
}
}

@ -0,0 +1,61 @@
package com.aucma.report.mapper;
import java.util.List;
import com.aucma.report.domain.RecordSwitchOrder;
/**
* Mapper
*
* @author Yinq
* @date 2024-04-23
*/
public interface RecordSwitchOrderMapper
{
/**
*
*
* @param objId
* @return
*/
public RecordSwitchOrder selectRecordSwitchOrderByObjId(Long objId);
/**
*
*
* @param recordSwitchOrder
* @return
*/
public List<RecordSwitchOrder> selectRecordSwitchOrderList(RecordSwitchOrder recordSwitchOrder);
/**
*
*
* @param recordSwitchOrder
* @return
*/
public int insertRecordSwitchOrder(RecordSwitchOrder recordSwitchOrder);
/**
*
*
* @param recordSwitchOrder
* @return
*/
public int updateRecordSwitchOrder(RecordSwitchOrder recordSwitchOrder);
/**
*
*
* @param objId
* @return
*/
public int deleteRecordSwitchOrderByObjId(Long objId);
/**
*
*
* @param objIds
* @return
*/
public int deleteRecordSwitchOrderByObjIds(Long[] objIds);
}

@ -0,0 +1,61 @@
package com.aucma.report.service;
import java.util.List;
import com.aucma.report.domain.RecordSwitchOrder;
/**
* Service
*
* @author Yinq
* @date 2024-04-23
*/
public interface IRecordSwitchOrderService
{
/**
*
*
* @param objId
* @return
*/
public RecordSwitchOrder selectRecordSwitchOrderByObjId(Long objId);
/**
*
*
* @param recordSwitchOrder
* @return
*/
public List<RecordSwitchOrder> selectRecordSwitchOrderList(RecordSwitchOrder recordSwitchOrder);
/**
*
*
* @param recordSwitchOrder
* @return
*/
public int insertRecordSwitchOrder(RecordSwitchOrder recordSwitchOrder);
/**
*
*
* @param recordSwitchOrder
* @return
*/
public int updateRecordSwitchOrder(RecordSwitchOrder recordSwitchOrder);
/**
*
*
* @param objIds
* @return
*/
public int deleteRecordSwitchOrderByObjIds(Long[] objIds);
/**
*
*
* @param objId
* @return
*/
public int deleteRecordSwitchOrderByObjId(Long objId);
}

@ -0,0 +1,96 @@
package com.aucma.report.service.impl;
import java.util.List;
import com.aucma.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.aucma.report.mapper.RecordSwitchOrderMapper;
import com.aucma.report.domain.RecordSwitchOrder;
import com.aucma.report.service.IRecordSwitchOrderService;
/**
* Service
*
* @author Yinq
* @date 2024-04-23
*/
@Service
public class RecordSwitchOrderServiceImpl implements IRecordSwitchOrderService
{
@Autowired
private RecordSwitchOrderMapper recordSwitchOrderMapper;
/**
*
*
* @param objId
* @return
*/
@Override
public RecordSwitchOrder selectRecordSwitchOrderByObjId(Long objId)
{
return recordSwitchOrderMapper.selectRecordSwitchOrderByObjId(objId);
}
/**
*
*
* @param recordSwitchOrder
* @return
*/
@Override
public List<RecordSwitchOrder> selectRecordSwitchOrderList(RecordSwitchOrder recordSwitchOrder)
{
return recordSwitchOrderMapper.selectRecordSwitchOrderList(recordSwitchOrder);
}
/**
*
*
* @param recordSwitchOrder
* @return
*/
@Override
public int insertRecordSwitchOrder(RecordSwitchOrder recordSwitchOrder)
{
recordSwitchOrder.setCreateTime(DateUtils.getNowDate());
return recordSwitchOrderMapper.insertRecordSwitchOrder(recordSwitchOrder);
}
/**
*
*
* @param recordSwitchOrder
* @return
*/
@Override
public int updateRecordSwitchOrder(RecordSwitchOrder recordSwitchOrder)
{
recordSwitchOrder.setUpdateTime(DateUtils.getNowDate());
return recordSwitchOrderMapper.updateRecordSwitchOrder(recordSwitchOrder);
}
/**
*
*
* @param objIds
* @return
*/
@Override
public int deleteRecordSwitchOrderByObjIds(Long[] objIds)
{
return recordSwitchOrderMapper.deleteRecordSwitchOrderByObjIds(objIds);
}
/**
*
*
* @param objId
* @return
*/
@Override
public int deleteRecordSwitchOrderByObjId(Long objId)
{
return recordSwitchOrderMapper.deleteRecordSwitchOrderByObjId(objId);
}
}

@ -0,0 +1,130 @@
<?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.RecordSwitchOrderMapper">
<resultMap type="RecordSwitchOrder" id="RecordSwitchOrderResult">
<result property="objId" column="obj_id"/>
<result property="materialBarcode" column="material_barcode"/>
<result property="switchStationCode" column="switch_station_code"/>
<result property="oldOrderCode" column="old_order_code"/>
<result property="isSwitch" column="is_switch"/>
<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="remark" column="remark"/>
<result property="orderCode" column="order_code"/>
<result property="isPrint" column="is_print"/>
</resultMap>
<sql id="selectRecordSwitchOrderVo">
select obj_id,
material_barcode,
switch_station_code,
old_order_code,
is_switch,
create_by,
create_time,
update_by,
update_time,
remark,
order_code,
is_print
from record_switch_order
</sql>
<select id="selectRecordSwitchOrderList" parameterType="RecordSwitchOrder" resultMap="RecordSwitchOrderResult">
<include refid="selectRecordSwitchOrderVo"/>
<where>
<if test="objId != null ">and obj_id = #{objId}</if>
<if test="materialBarcode != null and materialBarcode != ''">and material_barcode = #{materialBarcode}</if>
<if test="switchStationCode != null and switchStationCode != ''">and switch_station_code =
#{switchStationCode}
</if>
<if test="oldOrderCode != null and oldOrderCode != ''">and old_order_code = #{oldOrderCode}</if>
<if test="isSwitch != null and isSwitch != ''">and is_switch = #{isSwitch}</if>
<if test="createBy != null and createBy != ''">and create_by = #{createBy}</if>
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''">
and create_time between to_date(#{params.beginCreateTime}, 'yyyy-mm-dd hh24:mi:ss') and
to_date(#{params.endCreateTime}, 'yyyy-mm-dd hh24:mi:ss')
</if>
<if test="updateBy != null and updateBy != ''">and update_by = #{updateBy}</if>
<if test="params.beginUpdateTime != null and params.beginUpdateTime != '' and params.endUpdateTime != null and params.endUpdateTime != ''">
and update_time between to_date(#{params.beginUpdateTime}, 'yyyy-mm-dd hh24:mi:ss') and
to_date(#{params.endUpdateTime}, 'yyyy-mm-dd hh24:mi:ss')
</if>
<if test="orderCode != null and orderCode != ''">and order_code = #{orderCode}</if>
<if test="isPrint != null and isPrint != ''">and is_print = #{isPrint}</if>
</where>
</select>
<select id="selectRecordSwitchOrderByObjId" parameterType="Long" resultMap="RecordSwitchOrderResult">
<include refid="selectRecordSwitchOrderVo"/>
where obj_id = #{objId}
</select>
<insert id="insertRecordSwitchOrder" parameterType="RecordSwitchOrder">
insert into record_switch_order
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="objId != null">obj_id,</if>
<if test="materialBarcode != null">material_barcode,</if>
<if test="switchStationCode != null">switch_station_code,</if>
<if test="oldOrderCode != null">old_order_code,</if>
<if test="isSwitch != null">is_switch,</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="remark != null">remark,</if>
<if test="orderCode != null">order_code,</if>
<if test="isPrint != null">is_print,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="objId != null">#{objId},</if>
<if test="materialBarcode != null">#{materialBarcode},</if>
<if test="switchStationCode != null">#{switchStationCode},</if>
<if test="oldOrderCode != null">#{oldOrderCode},</if>
<if test="isSwitch != null">#{isSwitch},</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="remark != null">#{remark},</if>
<if test="orderCode != null">#{orderCode},</if>
<if test="isPrint != null">#{isPrint},</if>
</trim>
</insert>
<update id="updateRecordSwitchOrder" parameterType="RecordSwitchOrder">
update record_switch_order
<trim prefix="SET" suffixOverrides=",">
<if test="materialBarcode != null">material_barcode = #{materialBarcode},</if>
<if test="switchStationCode != null">switch_station_code = #{switchStationCode},</if>
<if test="oldOrderCode != null">old_order_code = #{oldOrderCode},</if>
<if test="isSwitch != null">is_switch = #{isSwitch},</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="remark != null">remark = #{remark},</if>
<if test="orderCode != null">order_code = #{orderCode},</if>
<if test="isPrint != null">is_print = #{isPrint},</if>
</trim>
where obj_id = #{objId}
</update>
<delete id="deleteRecordSwitchOrderByObjId" parameterType="Long">
delete
from record_switch_order
where obj_id = #{objId}
</delete>
<delete id="deleteRecordSwitchOrderByObjIds" parameterType="String">
delete from record_switch_order where obj_id in
<foreach item="objId" collection="array" open="(" separator="," close=")">
#{objId}
</foreach>
</delete>
</mapper>
Loading…
Cancel
Save