beautify code

This commit is contained in:
李宇奇 2025-02-24 15:56:21 +08:00
parent 3ffa5181a7
commit 47cd81f4c9
10 changed files with 222 additions and 7 deletions

View File

@ -4,6 +4,8 @@ import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.ruoyi.app.domain.AppPendingStorage; import com.ruoyi.app.domain.AppPendingStorage;
import com.ruoyi.app.domain.AppPendingStorageRequest;
import com.ruoyi.app.domain.DTO.OtherStockInRequest;
import com.ruoyi.app.service.IAppPendingStorageService; import com.ruoyi.app.service.IAppPendingStorageService;
import com.ruoyi.common.annotation.Anonymous; import com.ruoyi.common.annotation.Anonymous;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
@ -106,7 +108,7 @@ public class AppPendingStorageController extends BaseController
} }
@PostMapping("/addOtherList") @PostMapping("/addOtherList")
public AjaxResult addOtherList(@RequestBody List<AppPendingStorage> appPendingStorageList) { public AjaxResult addOtherList(@RequestBody OtherStockInRequest otherStockInRequest) {
return toAjax(appPendingStorageService.addAppListPmsOrderIn(appPendingStorageList)); return toAjax(appPendingStorageService.addAppListPmsOrderIn(otherStockInRequest));
} }
} }

View File

@ -6,6 +6,7 @@ import javax.servlet.http.HttpServletResponse;
import com.ruoyi.app.domain.AppPmsOrderIn; import com.ruoyi.app.domain.AppPmsOrderIn;
import com.ruoyi.app.domain.AppPmsOrderOut; import com.ruoyi.app.domain.AppPmsOrderOut;
import com.ruoyi.app.service.IAppPmsOrderOutService; import com.ruoyi.app.service.IAppPmsOrderOutService;
import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.web.controller.section.EnhanceDataList; import com.ruoyi.web.controller.section.EnhanceDataList;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -76,9 +77,9 @@ public class AppPmsOrderOutController extends BaseController
/** /**
* 新增请填写功能名称 * 新增请填写功能名称
*/ */
@PreAuthorize("@ss.hasPermi('system:out:add')")
@Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT) @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
@Anonymous
public AjaxResult add(@RequestBody AppPmsOrderOut appPmsOrderOut) public AjaxResult add(@RequestBody AppPmsOrderOut appPmsOrderOut)
{ {
return toAjax(appPmsOrderOutService.insertAppPmsOrderOut(appPmsOrderOut)); return toAjax(appPmsOrderOutService.insertAppPmsOrderOut(appPmsOrderOut));

View File

@ -6,6 +6,7 @@ import javax.servlet.http.HttpServletResponse;
import com.ruoyi.app.domain.AppTask; import com.ruoyi.app.domain.AppTask;
import com.ruoyi.app.domain.AppVehicle; import com.ruoyi.app.domain.AppVehicle;
import com.ruoyi.app.service.IAppVehicleService; import com.ruoyi.app.service.IAppVehicleService;
import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.web.controller.section.EnhanceDataList; import com.ruoyi.web.controller.section.EnhanceDataList;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -66,8 +67,8 @@ public class AppVehicleController extends BaseController
/** /**
* 获取请填写功能名称详细信息 * 获取请填写功能名称详细信息
*/ */
@PreAuthorize("@ss.hasPermi('system:vehicle:query')")
@GetMapping(value = "/{vehicleId}") @GetMapping(value = "/{vehicleId}")
@Anonymous
public AjaxResult getInfo(@PathVariable("vehicleId") String vehicleId) public AjaxResult getInfo(@PathVariable("vehicleId") String vehicleId)
{ {
return success(appVehicleService.selectAppVehicleByVehicleId(vehicleId)); return success(appVehicleService.selectAppVehicleByVehicleId(vehicleId));

View File

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

View File

@ -0,0 +1,145 @@
package com.ruoyi.app.domain;
import java.math.BigDecimal;
public class AppPendingStorageRequest {
/** 物料号 */
private String goodsId;
/** 物料数量 */
private BigDecimal goodsNum;
/** 单据号 */
private String listId;
/** 单据类型 */
private Long orderType;
/** 客户名称 */
private String customerName;
/** 物料描述 */
private String goodsDesc;
/** 重量 */
private Double weight;
/** 尺寸 */
private Long size;
/** 单位 */
private String unit;
/** 备用一 */
private String spare1;
/** 备用二 */
private String spare2;
public String getGoodsId() {
return goodsId;
}
public void setGoodsId(String goodsId) {
this.goodsId = goodsId;
}
public BigDecimal getGoodsNum() {
return goodsNum;
}
public void setGoodsNum(BigDecimal goodsNum) {
this.goodsNum = goodsNum;
}
public String getListId() {
return listId;
}
public void setListId(String listId) {
this.listId = listId;
}
public Long getOrderType() {
return orderType;
}
public void setOrderType(Long orderType) {
this.orderType = orderType;
}
public String getCustomerName() {
return customerName;
}
public void setCustomerName(String customerName) {
this.customerName = customerName;
}
public String getGoodsDesc() {
return goodsDesc;
}
public void setGoodsDesc(String goodsDesc) {
this.goodsDesc = goodsDesc;
}
public Double getWeight() {
return weight;
}
public void setWeight(Double weight) {
this.weight = weight;
}
public Long getSize() {
return size;
}
public void setSize(Long size) {
this.size = size;
}
public String getSpare1() {
return spare1;
}
public void setSpare1(String spare1) {
this.spare1 = spare1;
}
public String getSpare2() {
return spare2;
}
public void setSpare2(String spare2) {
this.spare2 = spare2;
}
public String getUnit() {
return unit;
}
public void setUnit(String unit) {
this.unit = unit;
}
@Override
public String toString() {
return "AppPendingStorageRequest{" +
"goodsId='" + goodsId + '\'' +
", goodsNum=" + goodsNum +
", listId='" + listId + '\'' +
", orderType=" + orderType +
", customerName='" + customerName + '\'' +
", goodsDesc='" + goodsDesc + '\'' +
", weight=" + weight +
", size=" + size +
", spare1='" + spare1 + '\'' +
", spare2='" + spare2 + '\'' +
'}';
}
public AppPendingStorageRequest() {
}
}

View File

@ -47,6 +47,9 @@ public class AppPmsOrderOut extends BaseEntity
@Excel(name = "预留2") @Excel(name = "预留2")
private String spare2; private String spare2;
@Excel(name = "订单状态")
private String orderStatus;
public void setListId(String listId) public void setListId(String listId)
{ {
this.listId = listId; this.listId = listId;
@ -120,6 +123,14 @@ public class AppPmsOrderOut extends BaseEntity
return spare2; return spare2;
} }
public String getOrderStatus() {
return orderStatus;
}
public void setOrderStatus(String orderStatus) {
this.orderStatus = orderStatus;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

View File

@ -0,0 +1,28 @@
package com.ruoyi.app.domain.DTO;
import com.ruoyi.app.domain.AppPendingStorageRequest;
import java.util.List;
public class OtherStockInRequest {
private List<AppPendingStorageRequest> data;
private String vehicleNo;
public String getVehicleNo() {
return vehicleNo;
}
public void setVehicleNo(String vehicleNo) {
this.vehicleNo = vehicleNo;
}
public List<AppPendingStorageRequest> getData() {
return data;
}
public void setData(List<AppPendingStorageRequest> data) {
this.data = data;
}
}

View File

@ -1,6 +1,7 @@
package com.ruoyi.app.service; package com.ruoyi.app.service;
import com.ruoyi.app.domain.AppPendingStorage; import com.ruoyi.app.domain.AppPendingStorage;
import com.ruoyi.app.domain.DTO.OtherStockInRequest;
import java.util.List; import java.util.List;
@ -74,5 +75,5 @@ public interface IAppPendingStorageService
* @param appPendingStorageList 载具号 * @param appPendingStorageList 载具号
* @return 结果 * @return 结果
*/ */
public int addAppListPmsOrderIn(List<AppPendingStorage> appPendingStorageList); public int addAppListPmsOrderIn(OtherStockInRequest otherStockInRequest);
} }

View File

@ -1,14 +1,18 @@
package com.ruoyi.app.service.impl; package com.ruoyi.app.service.impl;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import com.ruoyi.app.domain.AppPendingStorage; import com.ruoyi.app.domain.AppPendingStorage;
import com.ruoyi.app.domain.AppPendingStorageRequest;
import com.ruoyi.app.domain.DTO.OtherStockInRequest;
import com.ruoyi.app.mapper.AppPendingStorageMapper; import com.ruoyi.app.mapper.AppPendingStorageMapper;
import com.ruoyi.app.service.IAppPendingStorageService; import com.ruoyi.app.service.IAppPendingStorageService;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.uuid.UUID; import com.ruoyi.common.utils.uuid.UUID;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -129,7 +133,27 @@ public class AppPendingStorageServiceImpl implements IAppPendingStorageService
return appPendingStorageMapper.insertAppPendingStorage(appPendingStorage); return appPendingStorageMapper.insertAppPendingStorage(appPendingStorage);
} }
public int addAppListPmsOrderIn(List<AppPendingStorage> appPendingStorageList) { public int addAppListPmsOrderIn(OtherStockInRequest otherStockInRequest) {
List<AppPendingStorage> appPendingStorageList = new ArrayList<AppPendingStorage>();
List<AppPendingStorageRequest> appPendingStorageRequestList = otherStockInRequest.getData();
String vehicleNo = otherStockInRequest.getVehicleNo();
for (AppPendingStorageRequest appPendingStorageRequest : appPendingStorageRequestList) {
AppPendingStorage appPendingStorage = new AppPendingStorage();
BeanUtils.copyProperties(appPendingStorageRequest, appPendingStorage);
appPendingStorage.setCreateTime(DateUtils.getNowDate());
appPendingStorage.setUpdateTime(DateUtils.getNowDate());
appPendingStorage.setVehicleNo(vehicleNo);
appPendingStorage.setOrderId(appPendingStorageRequest.getListId());
appPendingStorage.setRecordId(UUID.randomUUID().toString());
appPendingStorage.setGoodsCode(appPendingStorageRequest.getGoodsId());
appPendingStorage.setStatus(2L);
appPendingStorage.setStorageType(1L);
appPendingStorage.setCreatePerson("test");
appPendingStorage.setCustomerId(appPendingStorageRequest.getCustomerName());
appPendingStorageList.add(appPendingStorage);
}
return appPendingStorageMapper.insertAppPendingStorageList(appPendingStorageList); return appPendingStorageMapper.insertAppPendingStorageList(appPendingStorageList);
} }
} }

View File

@ -48,6 +48,7 @@
<if test="goodsDesc != null and goodsDesc != ''">goods_desc,</if> <if test="goodsDesc != null and goodsDesc != ''">goods_desc,</if>
<if test="spare1 != null and spare1 != ''">spare1,</if> <if test="spare1 != null and spare1 != ''">spare1,</if>
<if test="spare2 != null">spare2,</if> <if test="spare2 != null">spare2,</if>
<if test="orderStatus != null">order_status,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="listId != null">#{listId},</if> <if test="listId != null">#{listId},</if>
@ -58,6 +59,7 @@
<if test="goodsDesc != null and goodsDesc != ''">#{goodsDesc},</if> <if test="goodsDesc != null and goodsDesc != ''">#{goodsDesc},</if>
<if test="spare1 != null and spare1 != ''">#{spare1},</if> <if test="spare1 != null and spare1 != ''">#{spare1},</if>
<if test="spare2 != null">#{spare2},</if> <if test="spare2 != null">#{spare2},</if>
<if test="orderStatus != null">#{orderStatus},</if>
</trim> </trim>
</insert> </insert>