add:仓库策略配置页面

This commit is contained in:
zhangzq
2025-06-26 15:58:26 +08:00
parent 7b9ad26e11
commit 3e3ee3f920
7 changed files with 100 additions and 105 deletions

View File

@@ -0,0 +1,19 @@
package org.nl.config.mybatis.typeHandler;
import com.alibaba.fastjson.JSON;
import org.apache.ibatis.type.JdbcType;
import org.apache.ibatis.type.MappedJdbcTypes;
import org.apache.ibatis.type.MappedTypes;
import org.nl.common.domain.handler.ListTypeHandler;
import java.sql.PreparedStatement;
import java.sql.SQLException;
@MappedTypes({Object.class})
@MappedJdbcTypes(JdbcType.VARCHAR)
public class ListStrTypeHandler extends ListTypeHandler {
@Override
public void setNonNullParameter(PreparedStatement ps, int i, Object parameter, JdbcType jdbcType) throws SQLException {
ps.setString(i, JSON.toJSONString(parameter));
}
}

View File

@@ -1,8 +1,12 @@
package org.nl.wms.decision_manage.controller.sectStrategy;
import cn.hutool.core.date.DateUtil;
import org.apache.catalina.security.SecurityUtil;
import org.nl.common.base.TableDataInfo;
import org.nl.common.domain.query.PageQuery;
import org.nl.common.logging.annotation.Log;
import org.nl.common.utils.SecurityUtils;
import org.nl.wms.decision_manage.service.sectStrategy.IStSectStrategyService;
import org.nl.wms.decision_manage.service.sectStrategy.dao.StSectStrategy;
import org.nl.wms.decision_manage.service.sectStrategy.dto.SectStrategyQuery;
@@ -23,7 +27,7 @@ import java.util.Arrays;
* @since 2025-06-25
*/
@RestController
@RequestMapping("/stSectStrategy")
@RequestMapping("/api/sectStrategy")
public class StSectStrategyController {
@Autowired
@@ -31,12 +35,14 @@ public class StSectStrategyController {
@GetMapping
public ResponseEntity<Object> query(SectStrategyQuery query, PageQuery page) {
return new ResponseEntity<>(iStSectStrategyService.page(page.build(),query.build()), HttpStatus.OK);
return new ResponseEntity<>(TableDataInfo.build(iStSectStrategyService.page(page.build(),query.build())), HttpStatus.OK);
}
@PostMapping
@Log("新增库区货位规则")
public ResponseEntity<Object> create(@Validated @RequestBody StSectStrategy dao) {
dao.setUpdate_time(DateUtil.now());
dao.setUpdate_name(SecurityUtils.getCurrentUsername());
iStSectStrategyService.save(dao);
return new ResponseEntity<>(HttpStatus.OK);
}
@@ -44,6 +50,8 @@ public class StSectStrategyController {
@PutMapping
@Log("修改库区货位规则")
public ResponseEntity<Object> update(@Validated @RequestBody StSectStrategy dao) {
dao.setUpdate_time(DateUtil.now());
dao.setUpdate_name(SecurityUtils.getCurrentUsername());
iStSectStrategyService.updateById(dao);
return new ResponseEntity<>(HttpStatus.OK);
}

View File

@@ -1,11 +1,16 @@
package org.nl.wms.decision_manage.service.sectStrategy.dao;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import java.util.List;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.nl.common.domain.handler.ListTypeHandler;
import org.nl.config.mybatis.typeHandler.ListStrTypeHandler;
/**
* <p>
@@ -17,7 +22,7 @@ import lombok.EqualsAndHashCode;
*/
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("st_sect_strategy")
@TableName(value = "st_sect_strategy",autoResultMap = true)
public class StSectStrategy implements Serializable {
private static final long serialVersionUID = 1L;
@@ -36,7 +41,8 @@ public class StSectStrategy implements Serializable {
/**
* 规则
*/
private String strategy;
@TableField(typeHandler = ListStrTypeHandler.class)
private List<String> strategy;
/**
* 描述

View File

@@ -13,13 +13,6 @@ import org.nl.wms.decision_manage.service.sectStrategy.dao.StSectStrategy;
@Data
public class SectStrategyQuery extends BaseQuery<StSectStrategy> {
private String strategy_name;
private Boolean is_delete =Boolean.FALSE;
@Override
public void paramMapping() {
super.doP.put("strategy_name", QParam.builder().k(new String[]{"strategy_name"}).type(QueryTEnum.LK).build());
}
private String sect_code;
}