Compare commits

...

2 Commits

Author SHA1 Message Date
7df9918382 Merge remote-tracking branch 'origin/main' 2025-04-09 10:07:36 +08:00
9cc586b936 feat 仓库编辑 2025-04-09 10:07:26 +08:00
6 changed files with 108 additions and 0 deletions

View File

@ -0,0 +1,34 @@
package com.cim.idm.controller;
import com.cim.idm.model.dto.WareHouseEditDto;
import com.cim.idm.service.IWareHouseService;
import com.cim.idm.utils.AjaxResult;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
@RestController
@RequestMapping("/api/wareHouse")
@EnableAutoConfiguration
public class WareHouseController {
@Resource
private IWareHouseService wareHouseService;
/**
* 编辑
*/
@PostMapping(value = "/edit")
public AjaxResult edit(@RequestBody WareHouseEditDto wareHouseEditDto) {
if (wareHouseService.edit(wareHouseEditDto) > 0) {
return AjaxResult.me().setSuccess(true).setMessage("编辑成功");
} else {
return AjaxResult.me().setErrorCode(-1).setMessage("编辑失败");
}
}
}

View File

@ -0,0 +1,19 @@
package com.cim.idm.dao;
import com.cim.idm.model.dto.WareHouseEditDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;
@Component
@Mapper
public interface WareHouseDao {
/**
* 编辑
* @param dto 请求
* @return 结果
*/
int edit(@Param("dto") WareHouseEditDto dto);
}

View File

@ -0,0 +1,13 @@
package com.cim.idm.model.dto;
import lombok.Data;
@Data
public class WareHouseEditDto {
private String erpFactoryName;
private String erpLocationName;
// 是否货位管理
private String useLocation;
// 是否熟化
private String isOven;
}

View File

@ -0,0 +1,12 @@
package com.cim.idm.service;
import com.cim.idm.model.dto.WareHouseEditDto;
public interface IWareHouseService {
/**
* 编辑
* @param dto 请求
* @return 结果
*/
int edit(WareHouseEditDto dto);
}

View File

@ -0,0 +1,21 @@
package com.cim.idm.service.Impl;
import com.cim.idm.dao.WareHouseDao;
import com.cim.idm.model.dto.WareHouseEditDto;
import com.cim.idm.service.IWareHouseService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Service
public class WareHouseServiceImpl implements IWareHouseService {
@Resource
private WareHouseDao wareHouseDao;
@Override
public int edit(WareHouseEditDto dto) {
return wareHouseDao.edit(dto);
}
}

View File

@ -0,0 +1,9 @@
<?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.cim.idm.dao.WareHouseDao">
<update id="edit">
update BS_ERPLOCATION set USE_LOCATION = #{dto.useLocation}, IS_OVEN = #{dto.isOven}
where ERPFACTORYNAME = #{dto.erpFactoryName} and ERPLOCATIONNAME = #{dto.erpLocationName}
</update>
</mapper>