hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/suMaterialWarehouse/controller/SuMaterialWarehouseController.java
对比新文件 @@ -0,0 +1,72 @@ package com.thhy.materials.modules.biz.suMaterialWarehouse.controller; import com.thhy.general.common.BasicResult; import com.thhy.materials.modules.biz.suMaterialWarehouse.entity.SuMaterialWarehouseEntity; import com.thhy.materials.modules.biz.suMaterialWarehouse.service.SuMaterialWarehouseService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.Map; /** * @Author QiuYuHao * @CreateDate 2023-11-15 9:13:31 * 苏州料仓控制层 */ @RestController @RequestMapping("/suMaterialWarehouse") public class SuMaterialWarehouseController { @Autowired private SuMaterialWarehouseService service; /** * 添加/修改 * @param suMaterialWarehouseEntity * @return */ @PostMapping("insertAndUpdate") BasicResult insert(@RequestBody SuMaterialWarehouseEntity suMaterialWarehouseEntity){ return this.service.insertAndUpdate(suMaterialWarehouseEntity); } /** * 删除 * @param id * @return */ @GetMapping("delete") BasicResult delete(@RequestParam String id){ return this.service.delete(id); } /** * 查询列表带分页 * @param map * @return */ @PostMapping("selectPageList") BasicResult selectPageList(@RequestBody Map map){ return this.service.selectPageList(map); } /** * 查询详情 * @param id * @return */ @GetMapping("selectInfo") BasicResult selectInfo(@RequestParam Integer id){ return this.service.selectInfo(id); } /** * 通过屏幕号查询每个号码最新一条数据 大屏上显示 * @param tableNum * @return */ @GetMapping("selectNewOneByTableNum") BasicResult selectNewOneByTableNum(@RequestParam Integer tableNum){ return this.service.selectNewOneByTableNum(tableNum); } } hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/suMaterialWarehouse/entity/SuMaterialWarehouseEntity.java
对比新文件 @@ -0,0 +1,50 @@ package com.thhy.materials.modules.biz.suMaterialWarehouse.entity; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import java.util.Date; /** * @Author QiuYuHao * @CreateDate 2023-11-15 9:14:22 * 苏州料仓实体 */ @Data @AllArgsConstructor @NoArgsConstructor @Builder public class SuMaterialWarehouseEntity { private Integer id; private Integer tableNum;//桌号 private String materialName;//物料名称 private Integer incomingQuantity;//进厂数量 private Date createTime;//创建时间 private Integer status;//检验状态 private Date inspectionDate;//检验日期 private String reportNumber;//报告编号 private String createUser; private Date updateTime; private String updateUser; private Integer isUse; private String companyId; private Date inTime;//进厂日期 private Integer type;//入库方式 1手动 2自动 } hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/suMaterialWarehouse/mapper/SuMaterialWarehouseMapper.java
对比新文件 @@ -0,0 +1,32 @@ package com.thhy.materials.modules.biz.suMaterialWarehouse.mapper; import com.thhy.materials.modules.biz.suMaterialWarehouse.entity.SuMaterialWarehouseEntity; import org.apache.ibatis.annotations.Mapper; import java.util.List; import java.util.Map; /** * @Author QiuYuHao * @CreateDate 2023-11-15 9:22:05 * 苏州料仓mapper */ @Mapper public interface SuMaterialWarehouseMapper { void insertAndUpdate(SuMaterialWarehouseEntity suMaterialWarehouseEntity); void delete(String id); List<SuMaterialWarehouseEntity> selectPageList(Map map); SuMaterialWarehouseEntity selectInfo(Integer id); /** * 通过屏幕号查询最新一条 * @param tableNum * @return */ SuMaterialWarehouseEntity selectNewOneByTableNum(Integer tableNum); } hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/suMaterialWarehouse/service/SuMaterialWarehouseService.java
对比新文件 @@ -0,0 +1,25 @@ package com.thhy.materials.modules.biz.suMaterialWarehouse.service; import com.thhy.general.common.BasicResult; import com.thhy.materials.modules.biz.suMaterialWarehouse.entity.SuMaterialWarehouseEntity; import java.util.List; import java.util.Map; /** * @Author QiuYuHao * @CreateDate 2023-11-15 9:23:03 * 苏州料仓接口 */ public interface SuMaterialWarehouseService { BasicResult insertAndUpdate(SuMaterialWarehouseEntity suMaterialWarehouseEntity); BasicResult delete(String id); BasicResult selectPageList(Map map); BasicResult selectInfo(Integer id); BasicResult selectNewOneByTableNum(Integer tableNum); } hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/suMaterialWarehouse/service/impl/SuMaterialWarehouseServiceImpl.java
对比新文件 @@ -0,0 +1,72 @@ package com.thhy.materials.modules.biz.suMaterialWarehouse.service.impl; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.thhy.general.common.BasicResult; import com.thhy.general.config.SysUserInfo; import com.thhy.general.utils.UserInfoUtils; import com.thhy.materials.modules.biz.suMaterialWarehouse.entity.SuMaterialWarehouseEntity; import com.thhy.materials.modules.biz.suMaterialWarehouse.mapper.SuMaterialWarehouseMapper; import com.thhy.materials.modules.biz.suMaterialWarehouse.service.SuMaterialWarehouseService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.Date; import java.util.Map; /** * @Author QiuYuHao * @CreateDate 2023-11-15 9:23:59 * 苏州料仓实现 */ @Service public class SuMaterialWarehouseServiceImpl implements SuMaterialWarehouseService { @Autowired private SuMaterialWarehouseMapper suMaterialWarehouseMapper; @Override public BasicResult insertAndUpdate(SuMaterialWarehouseEntity suMaterialWarehouseEntity) { SysUserInfo sysUserInfo = UserInfoUtils.getInstance().getUserInfo(); String companyId = sysUserInfo.getCompanyId(); String userId = sysUserInfo.getUserId(); Integer id = suMaterialWarehouseEntity.getId(); if(id != null){ suMaterialWarehouseEntity.setUpdateTime(new Date()); suMaterialWarehouseEntity.setUpdateUser(userId); } suMaterialWarehouseEntity.setCreateUser(userId); suMaterialWarehouseEntity.setCompanyId(companyId); suMaterialWarehouseMapper.insertAndUpdate(suMaterialWarehouseEntity); return BasicResult.success(); } @Override public BasicResult delete(String id) { suMaterialWarehouseMapper.delete(id); return BasicResult.success(); } @Override public BasicResult selectPageList(Map map) { SysUserInfo sysUserInfo = UserInfoUtils.getInstance().getUserInfo(); String companyId = sysUserInfo.getCompanyId(); int pageNum = (int) map.get("pageNum"); int pageSize = (int) map.get("pageSize"); map.put("companyId",companyId); PageHelper.startPage(pageNum,pageSize); return BasicResult.success( new PageInfo<>(suMaterialWarehouseMapper.selectPageList(map)) ); } @Override public BasicResult selectInfo(Integer id) { return BasicResult.success(suMaterialWarehouseMapper.selectInfo(id)); } @Override public BasicResult selectNewOneByTableNum(Integer tableNum) { return BasicResult.success(suMaterialWarehouseMapper.selectNewOneByTableNum(tableNum)); } } hd/pipe/materialsManage/src/main/resources/mapping/SuMaterialWarehouseMapper.xml
对比新文件 @@ -0,0 +1,208 @@ <?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.thhy.materials.modules.biz.suMaterialWarehouse.mapper.SuMaterialWarehouseMapper"> <insert id="insertAndUpdate"> insert ignore into t_su_material_warehouse_record <trim prefix="(" suffix=")" suffixOverrides=","> <if test="tableNum != null"> table_num, </if> <if test="materialName != null"> material_name, </if> <if test="incomingQuantity != null"> incoming_quantity, </if> <if test="status != null"> `status`, </if> <if test="inspectionDate != null"> inspection_date, </if> <if test="reportNumber != null"> report_number, </if> <if test="createUser != null"> create_user, </if> <if test="createTime != null"> create_time, </if> <if test="updateUser != null"> update_user, </if> <if test="updateTime != null"> update_time, </if> <if test="companyId != null"> company_id, </if> <if test="inTime != null"> in_time, </if> <if test="type != null"> type, </if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="tableNum != null"> #{tableNum,jdbcType=INTEGER}, </if> <if test="materialName != null"> #{materialName,jdbcType=VARCHAR}, </if> <if test="incomingQuantity != null"> #{incomingQuantity,jdbcType=INTEGER}, </if> <if test="status != null"> #{status,jdbcType=INTEGER}, </if> <if test="inspectionDate != null"> #{inspectionDate,jdbcType=TIMESTAMP}, </if> <if test="reportNumber != null"> #{reportNumber,jdbcType=VARCHAR}, </if> <if test="createUser != null"> #{createUser,jdbcType=VARCHAR}, </if> <if test="createTime != null"> #{createTime,jdbcType=TIMESTAMP}, </if> <if test="updateUser != null"> #{updateUser,jdbcType=VARCHAR}, </if> <if test="updateTime != null"> #{updateTime,jdbcType=TIMESTAMP}, </if> <if test="companyId != null"> #{companyId,jdbcType=VARCHAR}, </if> <if test="inTime != null"> #{inTime,jdbcType=TIMESTAMP}, </if> <if test="type != null"> #{type,jdbcType=INTEGER}, </if> </trim> on duplicate key update <trim suffixOverrides=","> <if test="tableNum != null"> table_num = #{tableNum,jdbcType=INTEGER}, </if> <if test="materialName != null"> material_name = #{materialName,jdbcType=VARCHAR}, </if> <if test="incomingQuantity != null"> incoming_quantity = #{incomingQuantity,jdbcType=INTEGER}, </if> <if test="status != null"> `status` = #{status,jdbcType=INTEGER}, </if> <if test="inspectionDate != null"> inspection_date = #{inspectionDate,jdbcType=TIMESTAMP}, </if> <if test="reportNumber != null"> report_number = #{reportNumber,jdbcType=VARCHAR}, </if> <if test="createUser != null"> create_user = #{createUser,jdbcType=VARCHAR}, </if> <if test="createTime != null"> create_time = #{createTime,jdbcType=TIMESTAMP}, </if> <if test="updateUser != null"> update_user= #{updateUser,jdbcType=VARCHAR}, </if> <if test="updateTime != null"> update_time #{updateTime,jdbcType=TIMESTAMP}, </if> <if test="companyId != null"> company_id = #{companyId,jdbcType=VARCHAR}, </if> <if test="inTime != null"> in_time = #{inTime,jdbcType=TIMESTAMP}, </if> <if test="type != null"> type = #{type,jdbcType=INTEGER}, </if> </trim> </insert> <delete id="delete"> update t_su_material_warehouse set isUse = 0 where id = #{id,jdbcType=VARCHAR} </delete> <select id="selectPageList" resultType="com.thhy.materials.modules.biz.suMaterialWarehouse.entity.SuMaterialWarehouseEntity"> SELECT t.id AS id, t.table_num AS tableNum, sd.dict_name AS materialName, t.incoming_quantity AS incomingQuantity, t.create_time AS createTime, t.status AS status, t.inspection_date AS inspectionDate, t.report_number AS reportNumber, su.real_name AS createUser, t.update_time AS updateTime, su1.real_name AS updateUser, t.in_time AS inTime, t.type AS type FROM `t_su_material_warehouse_record` t LEFT JOIN sys_users su on su.user_id = t.create_user LEFT JOIN sys_users su1 on su1.user_id = t.update_user LEFT JOIN sys_dict sd on sd.dict_id = t.material_name where t.is_use = 1 and t.company_id = #{companyId} order by </select> <select id="selectInfo" resultType="com.thhy.materials.modules.biz.suMaterialWarehouse.entity.SuMaterialWarehouseEntity"> SELECT t.id AS id, t.table_num AS tableNum, sd.dict_name AS materialName, t.incoming_quantity AS incomingQuantity, t.create_time AS createTime, t.status AS status, t.inspection_date AS inspectionDate, t.report_number AS reportNumber, su.real_name AS createUser, t.update_time AS updateTime, su1.real_name AS updateUser, t.in_time AS inTime, t.type AS type FROM `t_su_material_warehouse_record` t LEFT JOIN sys_users su on su.user_id = t.create_user LEFT JOIN sys_users su1 on su1.user_id = t.update_user LEFT JOIN sys_dict sd on sd.dict_id = t.material_name where t.is_use = 1 AND t.id = #{id} </select> <select id="selectNewOneByTableNum" resultType="com.thhy.materials.modules.biz.suMaterialWarehouse.entity.SuMaterialWarehouseEntity"> SELECT t.id AS id, t.table_num AS tableNum, sd.dict_name AS materialName, t.incoming_quantity AS incomingQuantity, t.create_time AS createTime, t.status AS status, t.inspection_date AS inspectionDate, t.report_number AS reportNumber, su.real_name AS createUser, t.update_time AS updateTime, su1.real_name AS updateUser, t.in_time AS inTime, t.type AS type FROM `t_su_material_warehouse_record` t LEFT JOIN sys_users su on su.user_id = t.create_user LEFT JOIN sys_users su1 on su1.user_id = t.update_user LEFT JOIN sys_dict sd on sd.dict_id = t.material_name where t.is_use = 1 AND t.table_num = #{tableNum} order by t.create_time desc limit 1 </select> </mapper>