add - 货道明细

master
yinq 1 year ago
parent dcedbd020a
commit dbeeaa17bb

@ -0,0 +1,103 @@
package com.aucma.base.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.aucma.common.utils.DateUtils;
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 com.aucma.common.annotation.Log;
import com.aucma.common.core.controller.BaseController;
import com.aucma.common.core.domain.AjaxResult;
import com.aucma.common.enums.BusinessType;
import com.aucma.base.domain.BaseSpaceDetail;
import com.aucma.base.service.IBaseSpaceDetailService;
import com.aucma.common.utils.poi.ExcelUtil;
import com.aucma.common.core.page.TableDataInfo;
/**
* Controller
*
* @author Yinq
* @date 2023-10-30
*/
@RestController
@RequestMapping("/base/spaceDetail" )
public class BaseSpaceDetailController extends BaseController {
@Autowired
private IBaseSpaceDetailService baseSpaceDetailService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('base:spaceDetail:list')" )
@GetMapping("/list" )
public TableDataInfo list(BaseSpaceDetail baseSpaceDetail) {
startPage();
List<BaseSpaceDetail> list = baseSpaceDetailService.selectBaseSpaceDetailList(baseSpaceDetail);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('base:spaceDetail:export')" )
@Log(title = "货道明细" , businessType = BusinessType.EXPORT)
@PostMapping("/export" )
public void export(HttpServletResponse response, BaseSpaceDetail baseSpaceDetail) {
List<BaseSpaceDetail> list = baseSpaceDetailService.selectBaseSpaceDetailList(baseSpaceDetail);
ExcelUtil<BaseSpaceDetail> util = new ExcelUtil<BaseSpaceDetail>(BaseSpaceDetail. class);
util.exportExcel(response, list, "货道明细数据" );
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('base:spaceDetail:query')" )
@GetMapping(value = "/{objId}" )
public AjaxResult getInfo(@PathVariable("objId" ) Long objId) {
return success(baseSpaceDetailService.selectBaseSpaceDetailByObjId(objId));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('base:spaceDetail:add')" )
@Log(title = "货道明细" , businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody BaseSpaceDetail baseSpaceDetail) {
baseSpaceDetail.setCreatedBy(getUsername());
baseSpaceDetail.setCreatedTime(DateUtils.getNowDate());
return toAjax(baseSpaceDetailService.insertBaseSpaceDetail(baseSpaceDetail));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('base:spaceDetail:edit')" )
@Log(title = "货道明细" , businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody BaseSpaceDetail baseSpaceDetail) {
baseSpaceDetail.setUpdatedBy(getUsername());
baseSpaceDetail.setUpdatedTime(DateUtils.getNowDate());
return toAjax(baseSpaceDetailService.updateBaseSpaceDetail(baseSpaceDetail));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('base:spaceDetail:remove')" )
@Log(title = "货道明细" , businessType = BusinessType.DELETE)
@DeleteMapping("/{objIds}" )
public AjaxResult remove(@PathVariable Long[] objIds) {
return toAjax(baseSpaceDetailService.deleteBaseSpaceDetailByObjIds(objIds));
}
}

@ -0,0 +1,235 @@
package com.aucma.base.domain;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.aucma.common.annotation.Excel;
import com.aucma.common.core.domain.BaseEntity;
/**
* base_spacedetail
*
* @author Yinq
* @date 2023-10-30
*/
public class BaseSpaceDetail extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
*
*/
private Long objId;
/**
*
*/
@Excel(name = "所属仓库")
private String storeCode;
/**
*
*/
@Excel(name = "所属仓库名称")
private String storeName;
/**
*
*/
@Excel(name = "货道编号")
private String spaceCode;
/**
*
*/
@Excel(name = "货道名称")
private String spaceName;
/**
*
*/
@Excel(name = "物料编号")
private String materialCode;
/**
*
*/
@Excel(name = "物料名称")
private String materialName;
/**
*
*/
@Excel(name = "物料类型")
private String materialType;
/**
*
*/
@Excel(name = "物料数量")
private BigDecimal materialAmount;
/**
*
*/
@Excel(name = "是否标识")
private Long isFlag;
/**
*
*/
@Excel(name = "创建人")
private String createdBy;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date createdTime;
/**
*
*/
@Excel(name = "更新人")
private String updatedBy;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date updatedTime;
public String getStoreName() {
return storeName;
}
public void setStoreName(String storeName) {
this.storeName = storeName;
}
public String getSpaceName() {
return spaceName;
}
public void setSpaceName(String spaceName) {
this.spaceName = spaceName;
}
public void setObjId(Long objId) {
this.objId = objId;
}
public Long getObjId() {
return objId;
}
public void setStoreCode(String storeCode) {
this.storeCode = storeCode;
}
public String getStoreCode() {
return storeCode;
}
public void setSpaceCode(String spaceCode) {
this.spaceCode = spaceCode;
}
public String getSpaceCode() {
return spaceCode;
}
public void setMaterialCode(String materialCode) {
this.materialCode = materialCode;
}
public String getMaterialCode() {
return materialCode;
}
public void setMaterialName(String materialName) {
this.materialName = materialName;
}
public String getMaterialName() {
return materialName;
}
public void setMaterialType(String materialType) {
this.materialType = materialType;
}
public String getMaterialType() {
return materialType;
}
public void setMaterialAmount(BigDecimal materialAmount) {
this.materialAmount = materialAmount;
}
public BigDecimal getMaterialAmount() {
return materialAmount;
}
public void setIsFlag(Long isFlag) {
this.isFlag = isFlag;
}
public Long getIsFlag() {
return isFlag;
}
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
public String getCreatedBy() {
return createdBy;
}
public void setCreatedTime(Date createdTime) {
this.createdTime = createdTime;
}
public Date getCreatedTime() {
return createdTime;
}
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
public String getUpdatedBy() {
return updatedBy;
}
public void setUpdatedTime(Date updatedTime) {
this.updatedTime = updatedTime;
}
public Date getUpdatedTime() {
return updatedTime;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("objId", getObjId())
.append("storeCode", getStoreCode())
.append("spaceCode", getSpaceCode())
.append("materialCode", getMaterialCode())
.append("materialName", getMaterialName())
.append("materialType", getMaterialType())
.append("materialAmount", getMaterialAmount())
.append("isFlag", getIsFlag())
.append("createdBy", getCreatedBy())
.append("createdTime", getCreatedTime())
.append("updatedBy", getUpdatedBy())
.append("updatedTime", getUpdatedTime())
.toString();
}
}

@ -0,0 +1,61 @@
package com.aucma.base.mapper;
import java.util.List;
import com.aucma.base.domain.BaseSpaceDetail;
/**
* Mapper
*
* @author Yinq
* @date 2023-10-30
*/
public interface BaseSpaceDetailMapper {
/**
*
*
* @param objId
* @return
*/
public BaseSpaceDetail selectBaseSpaceDetailByObjId(Long objId);
/**
*
*
* @param baseSpaceDetail
* @return
*/
public List<BaseSpaceDetail> selectBaseSpaceDetailList(BaseSpaceDetail baseSpaceDetail);
/**
*
*
* @param baseSpaceDetail
* @return
*/
public int insertBaseSpaceDetail(BaseSpaceDetail baseSpaceDetail);
/**
*
*
* @param baseSpaceDetail
* @return
*/
public int updateBaseSpaceDetail(BaseSpaceDetail baseSpaceDetail);
/**
*
*
* @param objId
* @return
*/
public int deleteBaseSpaceDetailByObjId(Long objId);
/**
*
*
* @param objIds
* @return
*/
public int deleteBaseSpaceDetailByObjIds(Long[] objIds);
}

@ -0,0 +1,61 @@
package com.aucma.base.service;
import java.util.List;
import com.aucma.base.domain.BaseSpaceDetail;
/**
* Service
*
* @author Yinq
* @date 2023-10-30
*/
public interface IBaseSpaceDetailService {
/**
*
*
* @param objId
* @return
*/
public BaseSpaceDetail selectBaseSpaceDetailByObjId(Long objId);
/**
*
*
* @param baseSpaceDetail
* @return
*/
public List<BaseSpaceDetail> selectBaseSpaceDetailList(BaseSpaceDetail baseSpaceDetail);
/**
*
*
* @param baseSpaceDetail
* @return
*/
public int insertBaseSpaceDetail(BaseSpaceDetail baseSpaceDetail);
/**
*
*
* @param baseSpaceDetail
* @return
*/
public int updateBaseSpaceDetail(BaseSpaceDetail baseSpaceDetail);
/**
*
*
* @param objIds
* @return
*/
public int deleteBaseSpaceDetailByObjIds(Long[] objIds);
/**
*
*
* @param objId
* @return
*/
public int deleteBaseSpaceDetailByObjId(Long objId);
}

@ -0,0 +1,87 @@
package com.aucma.base.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.aucma.base.mapper.BaseSpaceDetailMapper;
import com.aucma.base.domain.BaseSpaceDetail;
import com.aucma.base.service.IBaseSpaceDetailService;
/**
* Service
*
* @author Yinq
* @date 2023-10-30
*/
@Service
public class BaseSpaceDetailServiceImpl implements IBaseSpaceDetailService {
@Autowired
private BaseSpaceDetailMapper baseSpaceDetailMapper;
/**
*
*
* @param objId
* @return
*/
@Override
public BaseSpaceDetail selectBaseSpaceDetailByObjId(Long objId) {
return baseSpaceDetailMapper.selectBaseSpaceDetailByObjId(objId);
}
/**
*
*
* @param baseSpaceDetail
* @return
*/
@Override
public List<BaseSpaceDetail> selectBaseSpaceDetailList(BaseSpaceDetail baseSpaceDetail) {
return baseSpaceDetailMapper.selectBaseSpaceDetailList(baseSpaceDetail);
}
/**
*
*
* @param baseSpaceDetail
* @return
*/
@Override
public int insertBaseSpaceDetail(BaseSpaceDetail baseSpaceDetail) {
return baseSpaceDetailMapper.insertBaseSpaceDetail(baseSpaceDetail);
}
/**
*
*
* @param baseSpaceDetail
* @return
*/
@Override
public int updateBaseSpaceDetail(BaseSpaceDetail baseSpaceDetail) {
return baseSpaceDetailMapper.updateBaseSpaceDetail(baseSpaceDetail);
}
/**
*
*
* @param objIds
* @return
*/
@Override
public int deleteBaseSpaceDetailByObjIds(Long[] objIds) {
return baseSpaceDetailMapper.deleteBaseSpaceDetailByObjIds(objIds);
}
/**
*
*
* @param objId
* @return
*/
@Override
public int deleteBaseSpaceDetailByObjId(Long objId) {
return baseSpaceDetailMapper.deleteBaseSpaceDetailByObjId(objId);
}
}

@ -0,0 +1,133 @@
<?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.aucma.base.mapper.BaseSpaceDetailMapper">
<resultMap type="BaseSpaceDetail" id="BaseSpaceDetailResult">
<result property="objId" column="obj_id"/>
<result property="storeCode" column="store_code"/>
<result property="storeName" column="store_name"/>
<result property="spaceCode" column="space_code"/>
<result property="spaceName" column="space_name"/>
<result property="materialCode" column="material_code"/>
<result property="materialName" column="material_name"/>
<result property="materialType" column="material_type"/>
<result property="materialAmount" column="material_amount"/>
<result property="isFlag" column="is_flag"/>
<result property="createdBy" column="created_by"/>
<result property="createdTime" column="created_time"/>
<result property="updatedBy" column="updated_by"/>
<result property="updatedTime" column="updated_time"/>
</resultMap>
<sql id="selectBaseSpaceDetailVo">
select sd.obj_id,
sd.store_code,
si.store_name,
sd.space_code,
sp.space_name,
sd.material_code,
sd.material_name,
sd.material_type,
sd.material_amount,
sd.is_flag,
sd.created_by,
sd.created_time,
sd.updated_by,
sd.updated_time
from base_spacedetail sd
left join BASE_STOREINFO si on si.STORE_CODE = sd.STORE_CODE
left join BASE_SPACEINFO sp on sp.SPACE_CODE = sd.SPACE_CODE
</sql>
<select id="selectBaseSpaceDetailList" parameterType="BaseSpaceDetail" resultMap="BaseSpaceDetailResult">
<include refid="selectBaseSpaceDetailVo"/>
<where>
<if test="storeCode != null and storeCode != ''">and sd.store_code = #{storeCode}</if>
<if test="spaceCode != null and spaceCode != ''">and sd.space_code = #{spaceCode}</if>
<if test="materialCode != null and materialCode != ''">and sd.material_code = #{materialCode}</if>
<if test="materialName != null and materialName != ''">and sd.material_name like concat(concat('%',
#{materialName}), '%')
</if>
<if test="materialType != null and materialType != ''">and sd.material_type = #{materialType}</if>
<if test="materialAmount != null ">and sd.material_amount = #{materialAmount}</if>
<if test="isFlag != null ">and sd.is_flag = #{isFlag}</if>
<if test="createdBy != null and createdBy != ''">and sd.created_by = #{createdBy}</if>
<if test="createdTime != null ">and sd.created_time = #{createdTime}</if>
<if test="updatedBy != null and updatedBy != ''">and sd.updated_by = #{updatedBy}</if>
<if test="updatedTime != null ">and sd.updated_time = #{updatedTime}</if>
</where>
</select>
<select id="selectBaseSpaceDetailByObjId" parameterType="Long" resultMap="BaseSpaceDetailResult">
<include refid="selectBaseSpaceDetailVo"/>
where sd.obj_id = #{objId}
</select>
<insert id="insertBaseSpaceDetail" parameterType="BaseSpaceDetail">
<selectKey keyProperty="objId" resultType="long" order="BEFORE">
SELECT seq_base_spacedetail.NEXTVAL as objId FROM DUAL
</selectKey>
insert into base_spacedetail
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="objId != null">obj_id,</if>
<if test="storeCode != null">store_code,</if>
<if test="spaceCode != null">space_code,</if>
<if test="materialCode != null">material_code,</if>
<if test="materialName != null">material_name,</if>
<if test="materialType != null">material_type,</if>
<if test="materialAmount != null">material_amount,</if>
<if test="isFlag != null">is_flag,</if>
<if test="createdBy != null">created_by,</if>
<if test="createdTime != null">created_time,</if>
<if test="updatedBy != null">updated_by,</if>
<if test="updatedTime != null">updated_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="objId != null">#{objId},</if>
<if test="storeCode != null">#{storeCode},</if>
<if test="spaceCode != null">#{spaceCode},</if>
<if test="materialCode != null">#{materialCode},</if>
<if test="materialName != null">#{materialName},</if>
<if test="materialType != null">#{materialType},</if>
<if test="materialAmount != null">#{materialAmount},</if>
<if test="isFlag != null">#{isFlag},</if>
<if test="createdBy != null">#{createdBy},</if>
<if test="createdTime != null">#{createdTime},</if>
<if test="updatedBy != null">#{updatedBy},</if>
<if test="updatedTime != null">#{updatedTime},</if>
</trim>
</insert>
<update id="updateBaseSpaceDetail" parameterType="BaseSpaceDetail">
update base_spacedetail
<trim prefix="SET" suffixOverrides=",">
<if test="storeCode != null">store_code = #{storeCode},</if>
<if test="spaceCode != null">space_code = #{spaceCode},</if>
<if test="materialCode != null">material_code = #{materialCode},</if>
<if test="materialName != null">material_name = #{materialName},</if>
<if test="materialType != null">material_type = #{materialType},</if>
<if test="materialAmount != null">material_amount = #{materialAmount},</if>
<if test="isFlag != null">is_flag = #{isFlag},</if>
<if test="createdBy != null">created_by = #{createdBy},</if>
<if test="createdTime != null">created_time = #{createdTime},</if>
<if test="updatedBy != null">updated_by = #{updatedBy},</if>
<if test="updatedTime != null">updated_time = #{updatedTime},</if>
</trim>
where obj_id = #{objId}
</update>
<delete id="deleteBaseSpaceDetailByObjId" parameterType="Long">
delete
from base_spacedetail
where obj_id = #{objId}
</delete>
<delete id="deleteBaseSpaceDetailByObjIds" parameterType="String">
delete from base_spacedetail where obj_id in
<foreach item="objId" collection="array" open="(" separator="," close=")">
#{objId}
</foreach>
</delete>
</mapper>
Loading…
Cancel
Save