addEmpty & addOtherList

This commit is contained in:
李宇奇 2025-02-23 15:56:39 +08:00
parent 9bfd58202d
commit 2b6062b51c
10 changed files with 231 additions and 10 deletions

View File

@ -5,16 +5,10 @@ import javax.servlet.http.HttpServletResponse;
import com.ruoyi.app.domain.AppPendingStorage;
import com.ruoyi.app.service.IAppPendingStorageService;
import com.ruoyi.common.annotation.Anonymous;
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 org.springframework.web.bind.annotation.*;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
@ -29,6 +23,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
* @author ruoyi
* @date 2025-02-22
*/
@Anonymous
@RestController
@RequestMapping("/system/storage")
public class AppPendingStorageController extends BaseController
@ -103,4 +98,15 @@ public class AppPendingStorageController extends BaseController
{
return toAjax(appPendingStorageService.deleteAppPendingStorageByRecordIds(recordIds));
}
@Log(title = "空载具入库码盘", businessType = BusinessType.INSERT)
@PostMapping("/addEmpty")
public AjaxResult addEmpty(@RequestParam String vehicleNo) {
return toAjax(appPendingStorageService.addAppEmptyPmsOrderIn(vehicleNo));
}
@PostMapping("/addOtherList")
public AjaxResult addOtherList(@RequestBody List<AppPendingStorage> appPendingStorageList) {
return toAjax(appPendingStorageService.addAppListPmsOrderIn(appPendingStorageList));
}
}

View File

@ -114,7 +114,7 @@ public class SecurityConfig
requests.antMatchers("/login", "/register", "/captchaImage").permitAll()
// 静态资源可匿名访问
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
.antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**","/app/pms/orderIn","/app/task/sendLocation", "/app/task/taskResult","/app/task/kk").permitAll()
.antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**","/app/pms/orderIn","/app/task/sendLocation", "/app/task/taskResult","/app/task/kk", "/system/storage/**").permitAll()
// 除上面外的所有请求全部需要鉴权认证
.anyRequest().authenticated();
})

View File

@ -43,6 +43,9 @@ public class AppPendingStorage extends BaseEntity
@Excel(name = "物料数量")
private BigDecimal goodsNum;
@Excel(name = "载具号")
private String vehicleNo;
/** 物料条码 */
@Excel(name = "物料条码")
private String goodsCode;
@ -211,6 +214,14 @@ public class AppPendingStorage extends BaseEntity
return createPerson;
}
public String getVehicleNo() {
return vehicleNo;
}
public void setVehicleNo(String vehicleNo) {
this.vehicleNo = vehicleNo;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@ -234,4 +245,26 @@ public class AppPendingStorage extends BaseEntity
.append("remark", getRemark())
.toString();
}
public AppPendingStorage(String recordId, String listId, Long orderType, String customerId, String orderId, String vehicleNo, String goodsId, BigDecimal goodsNum, String goodsCode, String goodsDesc, String unit, String spare1, String spare2, Long status, Long storageType, String createPerson, String remark) {
this.goodsDesc = goodsDesc;
this.recordId = recordId;
this.listId = listId;
this.orderType = orderType;
this.customerId = customerId;
this.orderId = orderId;
this.vehicleNo = vehicleNo;
this.goodsId = goodsId;
this.goodsNum = goodsNum;
this.goodsCode = goodsCode;
this.unit = unit;
this.spare1 = spare1;
this.spare2 = spare2;
this.status = status;
this.storageType = storageType;
this.createPerson = createPerson;
}
public AppPendingStorage() {
}
}

View File

@ -60,4 +60,12 @@ public interface AppPendingStorageMapper
* @return 结果
*/
public int deleteAppPendingStorageByRecordIds(String[] recordIds);
/**
* 插入入库列表
*
* @param appPendingStorageList
* @return 结果
*/
public int insertAppPendingStorageList(List<AppPendingStorage> appPendingStorageList);
}

View File

@ -1,5 +1,6 @@
package com.ruoyi.app.mapper;
import com.ruoyi.app.domain.AppPendingStorage;
import com.ruoyi.app.domain.AppPmsOrderIn;
import java.util.List;

View File

@ -60,4 +60,19 @@ public interface IAppPendingStorageService
* @return 结果
*/
public int deleteAppPendingStorageByRecordId(String recordId);
/**
* 添加空载具入库码盘信息
*
* @param vehicleNo 载具号
* @return 结果
*/
public int addAppEmptyPmsOrderIn(String vehicleNo);
/** 添加物料列表入库
*
* @param appPendingStorageList 载具号
* @return 结果
*/
public int addAppListPmsOrderIn(List<AppPendingStorage> appPendingStorageList);
}

View File

@ -1,11 +1,14 @@
package com.ruoyi.app.service.impl;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import com.ruoyi.app.domain.AppPendingStorage;
import com.ruoyi.app.mapper.AppPendingStorageMapper;
import com.ruoyi.app.service.IAppPendingStorageService;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.uuid.UUID;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -95,4 +98,38 @@ public class AppPendingStorageServiceImpl implements IAppPendingStorageService
{
return appPendingStorageMapper.deleteAppPendingStorageByRecordId(recordId);
}
@Override
public int addAppEmptyPmsOrderIn(String vehicleNo) {
AppPendingStorage appPendingStorage = new AppPendingStorage(
UUID.randomUUID().toString(),
"S001",
1L,
"0001",
"OD0001",
vehicleNo,
"1122",
BigDecimal.valueOf(200),
"4545666",
"铅笔",
"",
"test1",
"test2",
2L,
1L,
"empty",
"test"
);
if (appPendingStorage.getCreateTime() == null) {
appPendingStorage.setCreateTime(DateUtils.getNowDate());
}
if (appPendingStorage.getUpdateTime() == null) {
appPendingStorage.setUpdateTime(DateUtils.getNowDate());
}
return appPendingStorageMapper.insertAppPendingStorage(appPendingStorage);
}
public int addAppListPmsOrderIn(List<AppPendingStorage> appPendingStorageList) {
return appPendingStorageMapper.insertAppPendingStorageList(appPendingStorageList);
}
}

View File

@ -92,5 +92,4 @@ public class AppPmsOrderInServiceImpl implements IAppPmsOrderInService
{
return appPmsOrderInMapper.deleteAppPmsOrderInByListId(listId);
}
}

View File

@ -23,6 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="createPerson" column="create_person" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<result property="vehicleNo" column="vehicle_no" />
</resultMap>
<sql id="selectAppPendingStorageVo">
@ -62,6 +63,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="orderType != null">order_type,</if>
<if test="customerId != null and customerId != ''">customer_id,</if>
<if test="orderId != null and orderId != ''">order_id,</if>
<if test="vehicleNo != null and vehicleNo != ''">vehicle_no,</if>
<if test="goodsId != null and goodsId != ''">goods_id,</if>
<if test="goodsNum != null">goods_num,</if>
<if test="goodsCode != null">goods_code,</if>
@ -82,6 +84,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="orderType != null">#{orderType},</if>
<if test="customerId != null and customerId != ''">#{customerId},</if>
<if test="orderId != null and orderId != ''">#{orderId},</if>
<if test="vehicleNo != null and vehicleNo != ''">#{vehicleNo},</if>
<if test="goodsId != null and goodsId != ''">#{goodsId},</if>
<if test="goodsNum != null">#{goodsNum},</if>
<if test="goodsCode != null">#{goodsCode},</if>
@ -132,4 +135,55 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{recordId}
</foreach>
</delete>
<insert id="insertAppPendingStorageList" parameterType="java.util.List">
INSERT INTO app_pending_storage
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="list != null and list.size() > 0">
<if test="list[0].recordId != null">record_id,</if>
<if test="list[0].listId != null">list_id,</if>
<if test="list[0].orderType != null">order_type,</if>
<if test="list[0].customerId != null and list[0].customerId != ''">customer_id,</if>
<if test="list[0].orderId != null and list[0].orderId != ''">order_id,</if>
<if test="list[0].vehicleNo != null and list[0].vehicleNo != ''">vehicle_no,</if>
<if test="list[0].goodsId != null and list[0].goodsId != ''">goods_id,</if>
<if test="list[0].goodsNum != null">goods_num,</if>
<if test="list[0].goodsCode != null and list[0].goodsCode != ''">goods_code,</if>
<if test="list[0].goodsDesc != null and list[0].goodsDesc != ''">goods_desc,</if>
<if test="list[0].unit != null and list[0].unit != ''">unit,</if>
<if test="list[0].spare1 != null">spare1,</if>
<if test="list[0].spare2 != null">spare2,</if>
<if test="list[0].status != null">status,</if>
<if test="list[0].storageType != null">storage_type,</if>
<if test="list[0].createTime != null">create_time,</if>
<if test="list[0].createPerson != null and list[0].createPerson != ''">create_person,</if>
<if test="list[0].updateTime != null">update_time,</if>
<if test="list[0].remark != null and list[0].remark != ''">remark,</if>
</if>
</trim>
VALUES
<foreach collection="list" item="record" separator=",">
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="record.recordId != null">#{record.recordId},</if>
<if test="record.listId != null">#{record.listId},</if>
<if test="record.orderType != null">#{record.orderType},</if>
<if test="record.customerId != null and record.customerId != ''">#{record.customerId},</if>
<if test="record.orderId != null and record.orderId != ''">#{record.orderId},</if>
<if test="record.vehicleNo != null and record.vehicleNo != ''">#{record.vehicleNo},</if>
<if test="record.goodsId != null and record.goodsId != ''">#{record.goodsId},</if>
<if test="record.goodsNum != null">#{record.goodsNum},</if>
<if test="record.goodsCode != null and record.goodsCode != ''">#{record.goodsCode},</if>
<if test="record.goodsDesc != null and record.goodsDesc != ''">#{record.goodsDesc},</if>
<if test="record.unit != null and record.unit != ''">#{record.unit},</if>
<if test="record.spare1 != null">#{record.spare1},</if>
<if test="record.spare2 != null">#{record.spare2},</if>
<if test="record.status != null">#{record.status},</if>
<if test="record.storageType != null">#{record.storageType},</if>
<if test="record.createTime != null">#{record.createTime},</if>
<if test="record.createPerson != null and record.createPerson != ''">#{record.createPerson},</if>
<if test="record.updateTime != null">#{record.updateTime},</if>
<if test="record.remark != null and record.remark != ''">#{record.remark},</if>
</trim>
</foreach>
</insert>
</mapper>

View File

@ -24,6 +24,27 @@
<result property="remark" column="remark" />
</resultMap>
<resultMap type="AppPendingStorage" id="AppEmptyOrderInResult">
<result property="recordId" column="record_id" />
<result property="listId" column="list_id" />
<result property="orderType" column="order_type" />
<result property="customerId" column="customer_id" />
<result property="orderId" column="order_id" />
<result property="vehicleNo" column="vehicle_no" />
<result property="goodsId" column="goods_id" />
<result property="goodsNum" column="goods_num" />
<result property="goodsCode" column="goods_code" />
<result property="goodsDesc" column="goods_desc" />
<result property="unit" column="unit" />
<result property="spare1" column="spare1" />
<result property="spare2" column="spare2" />
<result property="storageType" column="storage_type" />
<result property="createTime" column="create_time" />
<result property="createPerson" column="create_person" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectAppPmsOrderInVo">
select list_id, order_type, customer_id, order_id, goods_id, goods_num, used_num, remaining_num, goods_code, goods_desc, unit, spare1, spare2, order_status, create_time, update_time, remark from app_pms_order_in
</sql>
@ -127,4 +148,51 @@
#{listId}
</foreach>
</delete>
<insert id="insertAppEmpty" parameterType="AppPendingStorage">
insert into app_pending_storage
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="recordId != null">record_id,</if>
<if test="listId != null">list_id,</if>
<if test="orderType != null">order_type,</if>
<if test="customerId != null and customerId != ''">customer_id,</if>
<if test="orderId != null and orderId != ''">order_id,</if>
<if test="vehicleNo != null and vehicleNo != ''">vehicle_no,</if>
<if test="goodsId != null and goodsId != ''">goods_id,</if>
<if test="goodsNum != null">goods_num,</if>
<if test="goodsCode != null and goodsCode != ''">goods_code,</if>
<if test="goodsDesc != null and goodsDesc != ''">goods_desc,</if>
<if test="unit != null and unit != ''">unit,</if>
<if test="spare1 != null">spare1,</if>
<if test="spare2 != null">spare2,</if>
<if test="status != null">status,</if>
<if test="storageType != null">storage_type,</if>
<if test="createTime != null">create_time,</if>
<if test="createPerson != null and createPerson != ''">create_person,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null and remark != ''">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="recordId != null">#{recordId},</if>
<if test="listId != null">#{listId},</if>
<if test="orderType != null">#{orderType},</if>
<if test="customerId != null and customerId != ''">#{customerId},</if>
<if test="orderId != null and orderId != ''">#{orderId},</if>
<if test="vehicleNo != null and vehicleNo != ''">#{vehicleNo},</if>
<if test="goodsId != null and goodsId != ''">#{goodsId},</if>
<if test="goodsNum != null">#{goodsNum},</if>
<if test="goodsCode != null and goodsCode != ''">#{goodsCode},</if>
<if test="goodsDesc != null and goodsDesc != ''">#{goodsDesc},</if>
<if test="unit != null and unit != ''">#{unit},</if>
<if test="spare1 != null">#{spare1},</if>
<if test="spare2 != null">#{spare2},</if>
<if test="status != null">#{status},</if>
<if test="storageType != null">#{storageType},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createPerson != null and createPerson != ''">#{createPerson},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null and remark != ''">#{remark},</if>
</trim>
</insert>
</mapper>