feat 物料维护wms自带的属性
This commit is contained in:
parent
9993555611
commit
2bffdd5c59
@ -0,0 +1,30 @@
|
||||
package com.cim.idm.controller;
|
||||
|
||||
import com.cim.idm.model.dto.EditMaterialDto;
|
||||
import com.cim.idm.service.IMaterialSpecService;
|
||||
import com.cim.idm.utils.AjaxResult;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@RestController
|
||||
@EnableAutoConfiguration
|
||||
@RequestMapping("/api/materialSpec")
|
||||
public class MaterialSpecController {
|
||||
|
||||
@Resource
|
||||
private IMaterialSpecService msService;
|
||||
|
||||
@RequestMapping(value = "/edit", method = RequestMethod.POST)
|
||||
public AjaxResult editMaterialSpec(@RequestBody EditMaterialDto editMaterialDto){
|
||||
if (msService.editMaterialSpec(editMaterialDto) > 0) {
|
||||
return AjaxResult.me().setSuccess(true).setMessage("编辑成功");
|
||||
}
|
||||
return AjaxResult.me().setErrorCode(-1).setMessage("编辑失败");
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.cim.idm.dao;
|
||||
|
||||
import com.cim.idm.model.dto.EditMaterialDto;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@Mapper
|
||||
public interface MaterialSpecDao {
|
||||
|
||||
/**
|
||||
* 编辑物料
|
||||
*/
|
||||
int editMaterialSpec(@Param("dto") EditMaterialDto dto);
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.cim.idm.model.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class EditMaterialDto {
|
||||
|
||||
// 工厂名
|
||||
private String siteName;
|
||||
// 物料号
|
||||
private String materialSpecName;
|
||||
|
||||
// 启用批次管理(Y:启用,N:不启用)
|
||||
private String isBatch;
|
||||
|
||||
// 有效期计算规则(0:到货时间,1:创建时间)
|
||||
private String expirationRules;
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.cim.idm.service;
|
||||
|
||||
import com.cim.idm.model.dto.EditMaterialDto;
|
||||
|
||||
|
||||
public interface IMaterialSpecService {
|
||||
|
||||
/**
|
||||
* 编辑物料
|
||||
* @param dto 请求
|
||||
* @return 到货单
|
||||
*/
|
||||
int editMaterialSpec(EditMaterialDto dto);
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.cim.idm.service.Impl;
|
||||
|
||||
import com.cim.idm.dao.MaterialSpecDao;
|
||||
import com.cim.idm.model.dto.EditMaterialDto;
|
||||
import com.cim.idm.service.IMaterialSpecService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@Service("msService")
|
||||
public class MaterialSpecServiceImpl implements IMaterialSpecService {
|
||||
|
||||
@Resource
|
||||
private MaterialSpecDao materialSpecDao;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public int editMaterialSpec(EditMaterialDto dto) {
|
||||
return materialSpecDao.editMaterialSpec(dto);
|
||||
}
|
||||
}
|
@ -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.MaterialSpecDao">
|
||||
|
||||
<update id="editMaterialSpec">
|
||||
update MATERIALSPEC set IS_BATCH = #{dto.isBatch}, EXPIRATION_RULES = #{dto.expirationRules}
|
||||
where SITENAME = #{dto.siteName} and MATERIALSPECNAME = #{dto.materialSpecName}
|
||||
</update>
|
||||
</mapper>
|
Loading…
x
Reference in New Issue
Block a user