hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/concret/controller/MixingPlantNewScheduled.java
@@ -1,6 +1,7 @@ package com.thhy.materials.modules.biz.concret.controller; import com.thhy.materials.modules.biz.concret.entity.SysSteel; import com.thhy.materials.modules.biz.concret.entity.dto.DicetName; import com.thhy.materials.modules.biz.concret.entity.dto.TMinxingPlant; import com.thhy.materials.modules.biz.concret.entity.dto.WeighDto; @@ -238,5 +239,39 @@ } //苏州项目------- 地磅入库 记录,及库存修改 钢筋 @Scheduled(fixedRate = 2000000) // 每隔3秒执行一次任务 public void weighbridgeSteel() { //查询搅拌 所有类型 List<SysSteel> steels = weighService.steelType(); List<TWeighbridge> tWeighbridges = weighMapper.weighbridgeListType(); for (SysSteel steel : steels){ for (TWeighbridge weighbridge :tWeighbridges){ if(steel.getSteelName().equals(weighbridge.getMatname())&&steel.getSteelModel().equals(weighbridge.getMatmodel())){ //净重 String jweight = weighbridge.getJweight(); HashMap<String, Object> hashMap = new HashMap<>(); hashMap.put("id",""); hashMap.put("steelId",steel.getSteelId()); hashMap.put("stockType",1); hashMap.put("changeStock",jweight); hashMap.put("companyId","031e3dd577e8ed28e96aa69b"); BigDecimal b1 = new BigDecimal(jweight); BigDecimal b2 = new BigDecimal(steel.getStock()); RLock lock = redissonclient.getLock("materlock"); if(!lock.isLocked()) { lock.lock(10, TimeUnit.SECONDS); //插入记录表//苏州项目(入库计入增加) weighMapper.steelRecordIn(hashMap); //更改记录值 weighMapper.steelUp(steel.getSteelId(),b1.add(b2).doubleValue()); lock.unlock(); } weighMapper.weighbridgeUpdateType(weighbridge.getWeighbridgeId()); } } } } } hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/weigh/controller/WeighController.java
@@ -8,10 +8,7 @@ import com.thhy.materials.modules.biz.weigh.service.WeighService; import org.omg.CORBA.StringHolder; import org.springframework.beans.factory.annotation.Autowired; 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 org.springframework.web.bind.annotation.*; import java.util.Map; @@ -40,6 +37,31 @@ return weighService.weighbridgeList(values); } //原料库存 @PostMapping("/headThingJsInventory") public BasicResult headThingJsInventory(){ return weighService.headThingJsInventory(); } //料仓列表 @PostMapping("/materialWarehouseRecordList") public BasicResult materialWarehouseRecordList(@RequestBody Map<String,Object> values){ return weighService.materialWarehouseRecordList(values); } //料仓添加进仓 @PostMapping("/materialWarehouseRecordInsert") public BasicResult materialWarehouseRecordInsert(@RequestBody Map<String,Object> values){ return weighService.materialWarehouseRecordInsert(values); } //料仓修改进仓 @PostMapping("/materialWarehouseRecordUpdate") public BasicResult materialWarehouseRecordUpdate(@RequestBody Map<String,Object> values){ return weighService.materialWarehouseRecordUpdate(values); } //删除 @GetMapping("/materialWarehouseRecordDel") public BasicResult materialWarehouseRecordDel(@RequestParam String id){ return weighService.materialWarehouseRecordDel(id); } } hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/weigh/entity/TSuMaterialWarehouseRecord.java
对比新文件 @@ -0,0 +1,103 @@ package com.thhy.materials.modules.biz.weigh.entity; import lombok.Data; import lombok.Getter; import lombok.Setter; import lombok.ToString; import java.io.Serializable; import java.util.Date; @Data @Getter @Setter @ToString public class TSuMaterialWarehouseRecord implements Serializable { /** * */ private String id; /** * 桌号 */ private Integer tableNum; /** * 产地名称 */ private String nameOfOrigin; /** * 物料名称 */ private String materialName; /** * 进厂数量 */ private Double incomingQuantity; /** * 进厂日期 */ private Date inTime; /** * 检验状态 */ private Integer status; /** * 检验日期 */ private Date inspectionDate; /** * 报告编号 */ private String reportNumber; /** * 创建日期 */ private Date createTime; /** * */ private String createUser; /** * */ private Date updateTime; /** * */ private String updateUser; /** * */ private Integer isUse; /** * */ private String companyId; /** * 入库方式 1手动 2自动 */ private Integer type; /** * This field was generated by MyBatis Generator. * This field corresponds to the database table t_su_material_warehouse_record * * @mbg.generated Thu Nov 30 14:55:49 CST 2023 */ private static final long serialVersionUID = 1L; } hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/weigh/entity/dto/AssistGoodDto.java
对比新文件 @@ -0,0 +1,16 @@ package com.thhy.materials.modules.biz.weigh.entity.dto; import lombok.Data; import java.io.Serializable; @Data public class AssistGoodDto implements Serializable { //辅材名称 private String assistName; //辅材类型 private String assistType; //辅材库存 private String stock; } hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/weigh/entity/dto/MaterialStockRecordDto.java
对比新文件 @@ -0,0 +1,14 @@ package com.thhy.materials.modules.biz.weigh.entity.dto; import lombok.Data; import java.io.Serializable; @Data public class MaterialStockRecordDto implements Serializable { //原料名称 private String materialName; //原料值 private String materialValue; } hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/weigh/entity/dto/MouldDto.java
对比新文件 @@ -0,0 +1,15 @@ package com.thhy.materials.modules.biz.weigh.entity.dto; import lombok.Data; import java.io.Serializable; @Data public class MouldDto implements Serializable { //模具编号 private String mouldNum; //使用状态 private String free; //次数 private String currentCycleTime; } hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/weigh/entity/dto/SteelDto.java
对比新文件 @@ -0,0 +1,16 @@ package com.thhy.materials.modules.biz.weigh.entity.dto; import lombok.Data; import java.io.Serializable; @Data public class SteelDto implements Serializable { //钢筋名 private String steelName; //钢筋型号 private String steelModel; //库存 private String stock; } hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/weigh/mapper/WeighMapper.java
@@ -1,13 +1,19 @@ package com.thhy.materials.modules.biz.weigh.mapper; import com.thhy.general.annotations.Idkey; import com.thhy.materials.modules.biz.concret.entity.SysSteel; import com.thhy.materials.modules.biz.concret.entity.dto.DicetName; import com.thhy.materials.modules.biz.concret.entity.dto.TMinxingPlant; import com.thhy.materials.modules.biz.concret.entity.dto.WeighDto; import com.thhy.materials.modules.biz.video.entity.TVideoNo; import com.thhy.materials.modules.biz.weigh.dto.QueryWeighDto; import com.thhy.materials.modules.biz.weigh.entity.TSuMaterialWarehouseRecord; import com.thhy.materials.modules.biz.weigh.entity.TWeighbridge; import com.thhy.materials.modules.biz.weigh.entity.WeighVo; import com.thhy.materials.modules.biz.weigh.entity.dto.AssistGoodDto; import com.thhy.materials.modules.biz.weigh.entity.dto.MaterialStockRecordDto; import com.thhy.materials.modules.biz.weigh.entity.dto.MouldDto; import com.thhy.materials.modules.biz.weigh.entity.dto.SteelDto; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.springframework.web.bind.annotation.PostMapping; @@ -81,4 +87,26 @@ void materialStockRecordIns(HashMap<String, Object> hashMap); void weighbridgeUpdateType(Integer weighbridgeId); List<MaterialStockRecordDto> materialStockInventory(); List<SteelDto> steelInventory(); List<AssistGoodDto> assistGoodInventory(); List<MouldDto> mouldInventory(); List<SysSteel> steelType(); void steelRecordIn(@Idkey("id") HashMap<String, Object> hashMap); void steelUp(@Param("steelId") String steelId,@Param("doubleValue") double doubleValue); List<TSuMaterialWarehouseRecord> materialWarehouseRecordList(Map<String, Object> values); void materialWarehouseRecordInsert(@Idkey("id") Map<String, Object> values); void materialWarehouseRecordUpdate(Map<String, Object> values); void materialWarehouseRecordDel(String id); } hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/weigh/service/WeighService.java
@@ -1,6 +1,7 @@ package com.thhy.materials.modules.biz.weigh.service; import com.thhy.general.common.BasicResult; import com.thhy.materials.modules.biz.concret.entity.SysSteel; import com.thhy.materials.modules.biz.concret.entity.dto.DicetName; import com.thhy.materials.modules.biz.concret.entity.dto.TMinxingPlant; import com.thhy.materials.modules.biz.concret.entity.dto.WeighDto; @@ -40,4 +41,15 @@ BasicResult weighbridgeList(Map<String, Object> values); BasicResult headThingJsInventory(); List<SysSteel> steelType(); BasicResult materialWarehouseRecordList(Map<String, Object> values); BasicResult materialWarehouseRecordInsert(Map<String, Object> values); BasicResult materialWarehouseRecordUpdate(Map<String, Object> values); BasicResult materialWarehouseRecordDel(String id); } hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/weigh/service/impl/WeighServiceImpl.java
@@ -3,18 +3,25 @@ import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.thhy.general.common.BasicResult; import com.thhy.materials.modules.biz.concret.entity.SysSteel; import com.thhy.materials.modules.biz.concret.entity.dto.DicetName; import com.thhy.materials.modules.biz.concret.entity.dto.TMinxingPlant; import com.thhy.materials.modules.biz.concret.entity.dto.WeighDto; import com.thhy.materials.modules.biz.weigh.dto.QueryWeighDto; import com.thhy.materials.modules.biz.weigh.entity.TSuMaterialWarehouseRecord; import com.thhy.materials.modules.biz.weigh.entity.TWeighbridge; import com.thhy.materials.modules.biz.weigh.entity.WeighVo; import com.thhy.materials.modules.biz.weigh.entity.dto.AssistGoodDto; import com.thhy.materials.modules.biz.weigh.entity.dto.MaterialStockRecordDto; import com.thhy.materials.modules.biz.weigh.entity.dto.MouldDto; import com.thhy.materials.modules.biz.weigh.entity.dto.SteelDto; import com.thhy.materials.modules.biz.weigh.mapper.WeighMapper; import com.thhy.materials.modules.biz.weigh.service.WeighService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -95,4 +102,58 @@ PageInfo<TWeighbridge> tWeighbridgePageInfo = new PageInfo<>(weighbridges); return BasicResult.success(tWeighbridgePageInfo); } @Override public BasicResult headThingJsInventory() { //原料库存 List<MaterialStockRecordDto> materialStockDtos =weighMapper.materialStockInventory(); //钢筋 List<SteelDto> steelDtos = weighMapper.steelInventory(); //辅材 List<AssistGoodDto> assistGoodDtos = weighMapper.assistGoodInventory(); //模具 List<MouldDto> mouldDtos = weighMapper.mouldInventory(); HashMap<String, Object> map = new HashMap<>(); map.put("materialStockDtos",materialStockDtos); map.put("steelDtos",steelDtos); map.put("assistGoodDtos",assistGoodDtos); map.put("mouldDtos",mouldDtos); return BasicResult.success(map); } @Override public List<SysSteel> steelType() { return weighMapper.steelType(); } @Override public BasicResult materialWarehouseRecordList(Map<String, Object> values) { Integer pageSize = Integer.valueOf(values.get("pageSize").toString()); Integer pageNum = Integer.valueOf(values.get("pageNum").toString()); PageHelper.startPage(pageNum,pageSize); List<TSuMaterialWarehouseRecord> records = weighMapper.materialWarehouseRecordList(values); PageInfo<TSuMaterialWarehouseRecord> recordPageInfo = new PageInfo<>(records); return BasicResult.success(recordPageInfo); } @Override public BasicResult materialWarehouseRecordInsert(Map<String, Object> values) { values.put("id",""); weighMapper.materialWarehouseRecordInsert(values); return BasicResult.success(); } @Override public BasicResult materialWarehouseRecordUpdate(Map<String, Object> values) { weighMapper.materialWarehouseRecordUpdate(values); return BasicResult.success(); } @Override public BasicResult materialWarehouseRecordDel(String id) { weighMapper.materialWarehouseRecordDel(id); return BasicResult.success(); } } hd/pipe/materialsManage/src/main/resources/mapping/WeighMapper.xml
@@ -711,4 +711,316 @@ types=2 where weighbridge_id=#{weighbridgeId} </update> <select id="materialStockInventory" resultType="com.thhy.materials.modules.biz.weigh.entity.dto.MaterialStockRecordDto"> SELECT s.dict_name AS materialName, t.material_value AS materialValue FROM t_material_stock t LEFT JOIN sys_dict s ON t.material_name = s.dict_id </select> <select id="steelInventory" resultType="com.thhy.materials.modules.biz.weigh.entity.dto.SteelDto"> select steel_name as steelName, steel_model as steelModel, stock as stock from sys_steel </select> <select id="assistGoodInventory" resultType="com.thhy.materials.modules.biz.weigh.entity.dto.AssistGoodDto"> select s.assist_name as s.assistName, d.dict_name as assistType, s.stock as stock from sys_assist_good s left join sys_dict d on s.assist_type=d.dict_id </select> <select id="mouldInventory" resultType="com.thhy.materials.modules.biz.weigh.entity.dto.MouldDto"> select mould_num as mouldNum, free as free, current_cycle_time as currentCycleTime from sys_mould </select> <select id="steelType" resultType="com.thhy.materials.modules.biz.concret.entity.SysSteel"> select steel_id as steelId, steel_name as steelName, steel_model as steelModel, stock as stock from sys_steel </select> <insert id="steelRecordIn" > insert into sys_steel_record <trim prefix="(" suffix=")" suffixOverrides=","> <if test="id != null"> id, </if> <if test="steelId != null"> steel_id, </if> <if test="stockType != null"> stock_type, </if> <if test="createTime != null"> create_time, </if> <if test="changeStock != null"> change_stock, </if> <if test="supplierId != null"> supplier_id, </if> <if test="factoryName != null"> factory_name, </if> <if test="brand != null"> brand, </if> <if test="lineCode != null"> line_code, </if> <if test="proId != null"> pro_id, </if> <if test="createUser != null"> create_user, </if> <if test="companyId != null"> company_id, </if> <if test="carName != null"> car_name, </if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="id != null"> #{id,jdbcType=VARCHAR}, </if> <if test="steelId != null"> #{steelId,jdbcType=VARCHAR}, </if> <if test="stockType != null"> #{stockType,jdbcType=INTEGER}, </if> <if test="createTime != null"> #{createTime,jdbcType=TIMESTAMP}, </if> <if test="changeStock != null"> #{changeStock,jdbcType=DOUBLE}, </if> <if test="supplierId != null"> #{supplierId,jdbcType=VARCHAR}, </if> <if test="factoryName != null"> #{factoryName,jdbcType=VARCHAR}, </if> <if test="brand != null"> #{brand,jdbcType=VARCHAR}, </if> <if test="lineCode != null"> #{lineCode,jdbcType=VARCHAR}, </if> <if test="proId != null"> #{proId,jdbcType=VARCHAR}, </if> <if test="createUser != null"> #{createUser,jdbcType=VARCHAR}, </if> <if test="companyId != null"> #{companyId,jdbcType=VARCHAR}, </if> <if test="carName != null"> #{carName,jdbcType=VARCHAR}, </if> </trim> </insert> <update id="steelUp" > update sys_steel set stock=#{doubleValue} where steel_id=#{steelId} </update> <select id="materialWarehouseRecordList" resultType="com.thhy.materials.modules.biz.weigh.entity.TSuMaterialWarehouseRecord"> select id, table_num as tableNum, name_of_origin as nameOfOrigin, material_name as materialName, incoming_quantity as incomingQuantity, in_time as inTime, status as status, inspection_date as inspectionDate, report_number as reportNumber, create_time as createTime, `type` from t_su_material_warehouse_record where 1=1 <if test="tableNum!=null and tableNum!='' "> and table_num=#{tableNum} </if> <if test="type!=null and type!='' "> and `type`=#{type} </if> <if test="strTime!=null and strTime!='' and endTime!=null and endTime!='' "> and create_time between #{strTime} and #{endTime} </if> order by create_time desc </select> <insert id="materialWarehouseRecordInsert" > insert into t_su_material_warehouse_record <trim prefix="(" suffix=")" suffixOverrides=","> <if test="id != null"> id, </if> <if test="tableNum != null"> table_num, </if> <if test="nameOfOrigin != null"> name_of_origin, </if> <if test="materialName != null"> material_name, </if> <if test="incomingQuantity != null"> incoming_quantity, </if> <if test="inTime != null"> in_time, </if> <if test="status != null"> status, </if> <if test="inspectionDate != null"> inspection_date, </if> <if test="reportNumber != null"> report_number, </if> <if test="createTime != null"> create_time, </if> <if test="createUser != null"> create_user, </if> <if test="updateTime != null"> update_time, </if> <if test="updateUser != null"> update_user, </if> <if test="isUse != null"> is_use, </if> <if test="companyId != null"> company_id, </if> <if test="type != null"> type, </if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="id != null"> #{id,jdbcType=VARCHAR}, </if> <if test="tableNum != null"> #{tableNum,jdbcType=INTEGER}, </if> <if test="nameOfOrigin != null"> #{nameOfOrigin,jdbcType=VARCHAR}, </if> <if test="materialName != null"> #{materialName,jdbcType=VARCHAR}, </if> <if test="incomingQuantity != null"> #{incomingQuantity,jdbcType=DOUBLE}, </if> <if test="inTime != null"> #{inTime,jdbcType=TIMESTAMP}, </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="createTime != null"> #{createTime,jdbcType=TIMESTAMP}, </if> <if test="createUser != null"> #{createUser,jdbcType=VARCHAR}, </if> <if test="updateTime != null"> #{updateTime,jdbcType=TIMESTAMP}, </if> <if test="updateUser != null"> #{updateUser,jdbcType=VARCHAR}, </if> <if test="isUse != null"> #{isUse,jdbcType=INTEGER}, </if> <if test="companyId != null"> #{companyId,jdbcType=VARCHAR}, </if> <if test="type != null"> #{type,jdbcType=INTEGER}, </if> </trim> </insert> <update id="materialWarehouseRecordUpdate" > update t_su_material_warehouse_record <set> <if test="tableNum != null"> table_num = #{tableNum,jdbcType=INTEGER}, </if> <if test="nameOfOrigin != null"> name_of_origin = #{nameOfOrigin,jdbcType=VARCHAR}, </if> <if test="materialName != null"> material_name = #{materialName,jdbcType=VARCHAR}, </if> <if test="incomingQuantity != null"> incoming_quantity = #{incomingQuantity,jdbcType=DOUBLE}, </if> <if test="inTime != null"> in_time = #{inTime,jdbcType=TIMESTAMP}, </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="createTime != null"> create_time = #{createTime,jdbcType=TIMESTAMP}, </if> <if test="createUser != null"> create_user = #{createUser,jdbcType=VARCHAR}, </if> <if test="updateTime != null"> update_time = #{updateTime,jdbcType=TIMESTAMP}, </if> <if test="updateUser != null"> update_user = #{updateUser,jdbcType=VARCHAR}, </if> <if test="isUse != null"> is_use = #{isUse,jdbcType=INTEGER}, </if> <if test="companyId != null"> company_id = #{companyId,jdbcType=VARCHAR}, </if> <if test="type != null"> type = #{type,jdbcType=INTEGER}, </if> </set> where id = #{id,jdbcType=VARCHAR} </update> <delete id="materialWarehouseRecordDel" parameterType="java.lang.String"> delete from t_su_material_warehouse_record where id=#{id} </delete> </mapper>