From 7e603bde766e5f4fc7f95c785b1083c42f61955e Mon Sep 17 00:00:00 2001 From: 李旭东 <woaiguo66@sina.com> Date: 星期五, 24 十一月 2023 13:42:57 +0800 Subject: [PATCH] Merge branch 'master' of http://111.30.93.211:10101/r/supipe --- hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/concret/controller/MixingPlantNewScheduled.java | 45 ++ hd/pipe/screen/src/main/java/com/thhy/screen/modules/biz/agv/controller/NettyServerHandler.java | 1 hd/pipe/screen/src/main/java/com/thhy/screen/utils/HttpUtils.java | 148 +++++++ hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/weigh/service/impl/WeighServiceImpl.java | 14 hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/hiddenDanger/entity/HiddenDangerEntity.java | 4 hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/weigh/service/WeighService.java | 3 hd/pipe/mobile/src/main/java/com/thhy/mobile/modules/biz/pipeinfo/service/impl/PipeInfoServiceImpl.java | 125 ++++++ hd/pipe/screen/src/main/java/com/thhy/screen/modules/biz/audio/service/impl/AudioServiceImpl.java | 31 + hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/weigh/controller/WeighController.java | 11 hd/pipe/screen/src/main/java/com/thhy/screen/config/StartListener.java | 34 + web/src/views/MixingInfo/messageInfo.vue | 4 hd/pipe/screen/src/main/java/com/thhy/screen/modules/biz/audio/service/AudioService.java | 13 hd/pipe/screen/src/main/java/com/thhy/screen/utils/AudioUtils.java | 41 ++ hd/pipe/common/src/main/java/com/thhy/general/common/BasicStatus.java | 2 hd/pipe/mobile/src/main/java/com/thhy/mobile/modules/biz/pipeinfo/service/PipeInfoService.java | 5 web/src/api/modules/materials.js | 2 web/src/views/GoodManage/WeightRecord.vue | 159 +++++++ hd/pipe/screen/src/main/java/com/thhy/screen/modules/biz/audio/controller/AudioController.java | 32 + hd/pipe/screen/src/main/java/com/thhy/screen/modules/biz/bigscreen/mapper/BigScreenMapper.java | 5 hd/pipe/mobile/src/main/java/com/thhy/mobile/modules/biz/pipeinfo/mapper/PipeInfoMapper.java | 18 hd/pipe/mobile/src/main/java/com/thhy/mobile/modules/biz/cultivated/entity/PipeCultivated.java | 4 hd/pipe/materialsManage/src/main/resources/mapping/WeighMapper.xml | 131 ++++++ hd/pipe/mobile/src/main/java/com/thhy/mobile/modules/biz/pipeinfo/entity/PipeDateDto.java | 32 + hd/pipe/screen/src/main/java/com/thhy/screen/modules/biz/audio/entity/AudioGroup.java | 20 + hd/pipe/mobile/src/main/java/com/thhy/mobile/modules/biz/pipeinfo/entity/PipeInfo.java | 6 hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/weigh/mapper/WeighMapper.java | 11 hd/pipe/screen/src/main/java/com/thhy/screen/modules/biz/audio/entity/AudioDto.java | 11 hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/weigh/entity/TWeighbridge.java | 137 ++++++ hd/pipe/screen/src/main/resources/mapping/BigScreenMapper.xml | 30 + hd/pipe/mobile/src/main/resources/mapping/PipeInfoMapper.xml | 82 ++++ hd/pipe/mobile/src/main/java/com/thhy/mobile/modules/biz/pipeinfo/controller/PipeInfoController.java | 13 31 files changed, 1,166 insertions(+), 8 deletions(-) diff --git a/hd/pipe/common/src/main/java/com/thhy/general/common/BasicStatus.java b/hd/pipe/common/src/main/java/com/thhy/general/common/BasicStatus.java index 97f89ef..787511c 100644 --- a/hd/pipe/common/src/main/java/com/thhy/general/common/BasicStatus.java +++ b/hd/pipe/common/src/main/java/com/thhy/general/common/BasicStatus.java @@ -127,6 +127,8 @@ RING_NUM_IS_REPEAT("09934","环号已存在"), RING_NOT_DIS("09935","环号必须为整数,最多5位"), + + RING_NOT_COMPLETE("09936","尚未成环"), ; diff --git a/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/concret/controller/MixingPlantNewScheduled.java b/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/concret/controller/MixingPlantNewScheduled.java index bcd04d3..c70f37a 100644 --- a/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/concret/controller/MixingPlantNewScheduled.java +++ b/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/concret/controller/MixingPlantNewScheduled.java @@ -4,6 +4,7 @@ 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.entity.TWeighbridge; import com.thhy.materials.modules.biz.weigh.mapper.WeighMapper; import com.thhy.materials.modules.biz.weigh.service.WeighService; import org.redisson.api.RLock; @@ -192,6 +193,50 @@ } + //苏州项目------- 地磅入库 记录,及库存修改 + @Scheduled(fixedRate = 2000000) // 每隔3秒执行一次任务 + public void weighbridge() { + //查询搅拌 所有类型 + List<DicetName> dictList = weighService.dictList(); + List<TWeighbridge> tWeighbridges = weighMapper.weighbridgeListType(); + for (DicetName dicetName : dictList){ + for (TWeighbridge weighbridge :tWeighbridges){ + if(dicetName.getDictName().equals(weighbridge.getMatname())){ + //开始的库存 + Double materialValue = weighMapper.materialStockValue(dicetName.getDictId()); + //净重 + String jweight = weighbridge.getJweight(); + HashMap<String, Object> hashMap = new HashMap<>(); + hashMap.put("id",""); + hashMap.put("type",1); + hashMap.put("opType",1); + hashMap.put("materialName",dicetName.getDictId()); + hashMap.put("materialValue",Double.valueOf(jweight)); + hashMap.put("beforeStock",materialValue); + BigDecimal b1 = new BigDecimal(jweight); + BigDecimal b2 = new BigDecimal(materialValue); + double v1 = b1.add(b2).doubleValue(); + hashMap.put("afterStock",v1); + hashMap.put("companyId","031e3dd577e8ed28e96aa69b"); + RLock lock = redissonclient.getLock("materlock"); + if(!lock.isLocked()) { + lock.lock(10, TimeUnit.SECONDS); + //插入记录表//苏州项目(入库计入增加) + weighMapper.materialStockRecordIns(hashMap); + //更改记录值 + weighMapper.materialStockRecordUp(dicetName.getDictId(),b1.add(b2).doubleValue()); + lock.unlock(); + } + + weighMapper.weighbridgeUpdateType(weighbridge.getWeighbridgeId()); + } + } + + + } + + + } } diff --git a/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/weigh/controller/WeighController.java b/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/weigh/controller/WeighController.java index a6d58b0..c782925 100644 --- a/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/weigh/controller/WeighController.java +++ b/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/weigh/controller/WeighController.java @@ -6,11 +6,14 @@ import com.thhy.materials.modules.biz.weigh.dto.QueryWeighDto; import com.thhy.materials.modules.biz.weigh.entity.WeighVo; 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 java.util.Map; /** * @Author QiuYuHao @@ -31,4 +34,12 @@ PageInfo<WeighVo> weighVoPageInfo = new PageInfo<>(weighService.findAll(queryWeighDto)); return BasicResult.success(weighVoPageInfo); } + + @PostMapping("/weighbridgeList") + public BasicResult weighbridgeList(@RequestBody Map<String,Object> values){ + return weighService.weighbridgeList(values); + } + + + } diff --git a/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/weigh/entity/TWeighbridge.java b/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/weigh/entity/TWeighbridge.java new file mode 100644 index 0000000..928d851 --- /dev/null +++ b/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/weigh/entity/TWeighbridge.java @@ -0,0 +1,137 @@ +package com.thhy.materials.modules.biz.weigh.entity; + +import lombok.Data; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; + +import java.io.Serializable; + +@Data +@Getter +@Setter +@ToString +public class TWeighbridge implements Serializable { + /** + * + */ + private Integer weighbridgeId; + + /** + * 数据id + */ + private String id; + + /** + * 过磅编号 + */ + private String code; + + /** + * 业务所属机构 + */ + private String orgname; + + /** + * 供应单位名称 + */ + private String supplyorgname; + + /** + * 运输车牌号 + */ + private String carnumber; + + /** + * 运输司机 + */ + private String drivername; + + /** + * 原料名称 + */ + private String matname; + + /** + * 原材料型号 + */ + private String matmodel; + + /** + * 过毛时间 + */ + private String mpoundtime; + + /** + * 过磅毛重 千克 kg + */ + private String mpoundweight; + + /** + * 过毛人 + */ + private String mpoundname; + + /** + * 皮重时间 + */ + private String ppoundtime; + + /** + * 皮重 + */ + private String ppoundweight; + + /** + * 过皮人 + */ + private String ppoundname; + + /** + * 过磅净重 + */ + private String jpoundweight; + + /** + * 扣重 + */ + private String buckleweight; + + /** + * 毛重 + */ + private String mweight; + + /** + * 皮重 + */ + private String pweight; + + /** + * 净重 + */ + private String jweight; + + /** + * 入库仓名称 + */ + private String warename; + + /** + * 过磅图片,最多会有四张图片路径,逗号隔开 + */ + private String fileimage; + + /** + * 1未同步2已同步 + */ + private Integer types; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table t_weighbridge + * + * @mbg.generated Fri Nov 24 11:06:42 CST 2023 + */ + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/weigh/mapper/WeighMapper.java b/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/weigh/mapper/WeighMapper.java index 32fd32d..9b87258 100644 --- a/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/weigh/mapper/WeighMapper.java +++ b/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/weigh/mapper/WeighMapper.java @@ -6,6 +6,7 @@ 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.TWeighbridge; import com.thhy.materials.modules.biz.weigh.entity.WeighVo; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -70,4 +71,14 @@ Integer netWeighNew(Integer byId); void netWeighUpdateNew(@Param("byId") Integer byId,@Param("netWeight") double netWeight); + + List<TWeighbridge> weighbridgeList(Map<String, Object> values); + + List<TWeighbridge> weighbridgeListType(); + + Double materialStockValue(String dictId); + + void materialStockRecordIns(HashMap<String, Object> hashMap); + + void weighbridgeUpdateType(Integer weighbridgeId); } diff --git a/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/weigh/service/WeighService.java b/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/weigh/service/WeighService.java index 98d3b2e..895dc22 100644 --- a/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/weigh/service/WeighService.java +++ b/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/weigh/service/WeighService.java @@ -37,4 +37,7 @@ List<WeighDto> findAlltaskNew(Integer byId, String dictName); List<WeighDto> findAlltaskAllNew(String dictName); + + BasicResult weighbridgeList(Map<String, Object> values); + } diff --git a/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/weigh/service/impl/WeighServiceImpl.java b/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/weigh/service/impl/WeighServiceImpl.java index c45000c..3e1f773 100644 --- a/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/weigh/service/impl/WeighServiceImpl.java +++ b/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/weigh/service/impl/WeighServiceImpl.java @@ -1,9 +1,13 @@ package com.thhy.materials.modules.biz.weigh.service.impl; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.thhy.general.common.BasicResult; 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.TWeighbridge; import com.thhy.materials.modules.biz.weigh.entity.WeighVo; import com.thhy.materials.modules.biz.weigh.mapper.WeighMapper; import com.thhy.materials.modules.biz.weigh.service.WeighService; @@ -81,4 +85,14 @@ List<WeighDto> WeighVo= weighMapper.findAlltaskAllNew(dictName); return WeighVo; } + + @Override + public BasicResult weighbridgeList(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<TWeighbridge> weighbridges = weighMapper.weighbridgeList(values); + PageInfo<TWeighbridge> tWeighbridgePageInfo = new PageInfo<>(weighbridges); + return BasicResult.success(tWeighbridgePageInfo); + } } diff --git a/hd/pipe/materialsManage/src/main/resources/mapping/WeighMapper.xml b/hd/pipe/materialsManage/src/main/resources/mapping/WeighMapper.xml index 2523497..55cbeb7 100644 --- a/hd/pipe/materialsManage/src/main/resources/mapping/WeighMapper.xml +++ b/hd/pipe/materialsManage/src/main/resources/mapping/WeighMapper.xml @@ -579,5 +579,136 @@ where by_id=#{byId} </update> + <select id="weighbridgeList" resultType="com.thhy.materials.modules.biz.weigh.entity.TWeighbridge"> + select + weighbridge_id as weighbridgeId, + id, + code, + orgName, + supplyOrgName, + carNumber, + driverName, + matName, + matModel, + mPoundTime, + mPoundWeight, + mPoundName, + pPoundTime, + pPoundWeight, + pPoundName, + jPoundWeight, + buckleWeight, + mWeight, + pWeight, + jWeight, + wareName, + fileImage, + types + from t_weighbridge where + 1=1 + <if test="carNumber!=null and carNumber!='' "> + and carNumber like concat('%',#{carNumber},'%') + </if> + <if test="matName!=null and matName!='' "> + and matName like concat('%',#{matName},'%') + </if> + order by weighbridge_id desc + </select> + <select id="weighbridgeListType" resultType="com.thhy.materials.modules.biz.weigh.entity.TWeighbridge"> + select + weighbridge_id as weighbridgeId, + id, + code, + orgName, + supplyOrgName, + carNumber, + driverName, + matName, + matModel, + mPoundTime, + mPoundWeight, + mPoundName, + pPoundTime, + pPoundWeight, + pPoundName, + jPoundWeight, + buckleWeight, + mWeight, + pWeight, + jWeight, + wareName, + fileImage, + types + from t_weighbridge where + types=1 + </select> + <select id="materialStockValue" resultType="java.lang.Double"> + select material_value as materialValue + from t_material_stock where material_name=#{dictId} + </select> + + + <insert id="materialStockRecordIns" > + insert into t_material_stock_record + <trim prefix="(" suffix=")" suffixOverrides=","> + id, + <if test="createDate != null"> + create_date, + </if> + <if test="type != null"> + type, + </if> + <if test="opType != null"> + op_type, + </if> + <if test="materialName != null"> + material_name, + </if> + <if test="materialValue != null"> + material_value, + </if> + <if test="beforeStock != null"> + before_stock, + </if> + <if test="afterStock != null"> + after_stock, + </if> + <if test="companyId != null"> + company_id, + </if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides=","> + REPLACE(UUID(),'-',''), + <if test="createDate != null"> + #{createDate,jdbcType=TIMESTAMP}, + </if> + <if test="type != null"> + #{type,jdbcType=INTEGER}, + </if> + <if test="opType != null"> + #{opType,jdbcType=INTEGER}, + </if> + <if test="materialName != null"> + #{materialName,jdbcType=VARCHAR}, + </if> + <if test="materialValue != null"> + #{materialValue,jdbcType=DOUBLE}, + </if> + <if test="beforeStock != null"> + #{beforeStock,jdbcType=DOUBLE}, + </if> + <if test="afterStock != null"> + #{afterStock,jdbcType=DOUBLE}, + </if> + <if test="companyId != null"> + #{companyId}, + </if> + </trim> + </insert> + <update id="weighbridgeUpdateType" > + update t_weighbridge set + types=2 + where weighbridge_id=#{weighbridgeId} + </update> </mapper> \ No newline at end of file diff --git a/hd/pipe/mobile/src/main/java/com/thhy/mobile/modules/biz/cultivated/entity/PipeCultivated.java b/hd/pipe/mobile/src/main/java/com/thhy/mobile/modules/biz/cultivated/entity/PipeCultivated.java index 7bcce79..d0a16a3 100644 --- a/hd/pipe/mobile/src/main/java/com/thhy/mobile/modules/biz/cultivated/entity/PipeCultivated.java +++ b/hd/pipe/mobile/src/main/java/com/thhy/mobile/modules/biz/cultivated/entity/PipeCultivated.java @@ -60,4 +60,8 @@ private String waterCultivatedId; private String companyId; + + private Integer outWater; + + private Date outTime; } diff --git a/hd/pipe/mobile/src/main/java/com/thhy/mobile/modules/biz/pipeinfo/controller/PipeInfoController.java b/hd/pipe/mobile/src/main/java/com/thhy/mobile/modules/biz/pipeinfo/controller/PipeInfoController.java index debe517..1d490f4 100644 --- a/hd/pipe/mobile/src/main/java/com/thhy/mobile/modules/biz/pipeinfo/controller/PipeInfoController.java +++ b/hd/pipe/mobile/src/main/java/com/thhy/mobile/modules/biz/pipeinfo/controller/PipeInfoController.java @@ -24,6 +24,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.List; +import java.util.Map; /** * @author zhang_xiao_bo @@ -126,4 +127,16 @@ return BasicResult.success(); } + @RequestMapping("updateDateInfo") + public BasicResult updateDateInfo(@RequestBody PipeInfo pipeInfo){ + Map<String, Object> map = pipeInfoService.updateDateInfo(pipeInfo); + return BasicResult.success(map); + } + + @RequestMapping("updatePipeDate") + public BasicResult updatePipeDate(@RequestBody PipeDateDto pipeDateDto){ + pipeInfoService.updatePipeDate(pipeDateDto); + return BasicResult.success(); + } + } diff --git a/hd/pipe/mobile/src/main/java/com/thhy/mobile/modules/biz/pipeinfo/entity/PipeDateDto.java b/hd/pipe/mobile/src/main/java/com/thhy/mobile/modules/biz/pipeinfo/entity/PipeDateDto.java new file mode 100644 index 0000000..54fcaff --- /dev/null +++ b/hd/pipe/mobile/src/main/java/com/thhy/mobile/modules/biz/pipeinfo/entity/PipeDateDto.java @@ -0,0 +1,32 @@ +package com.thhy.mobile.modules.biz.pipeinfo.entity; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +@Data +public class PipeDateDto implements Serializable { + + private String pipeNum; + + private String ringNum; + + private Date inModTime; + + private Date outModTime; + + private Date pouringTime; + + private Date placingInTime; + + private Date placingOutTime; + + private Date checkTime; + + private Date inWaterTime; + + private Date outWaterTime; + + private Date inRepoTime; +} diff --git a/hd/pipe/mobile/src/main/java/com/thhy/mobile/modules/biz/pipeinfo/entity/PipeInfo.java b/hd/pipe/mobile/src/main/java/com/thhy/mobile/modules/biz/pipeinfo/entity/PipeInfo.java index bfaa2ec..e06687b 100644 --- a/hd/pipe/mobile/src/main/java/com/thhy/mobile/modules/biz/pipeinfo/entity/PipeInfo.java +++ b/hd/pipe/mobile/src/main/java/com/thhy/mobile/modules/biz/pipeinfo/entity/PipeInfo.java @@ -124,6 +124,12 @@ private Integer createFlag; + private Date outModTime; + + private Date placingInTime; + + private Date placingOutTime; + public PipeInfo() {} public PipeInfo(Mould mould, SteelProduce steelProduce) { diff --git a/hd/pipe/mobile/src/main/java/com/thhy/mobile/modules/biz/pipeinfo/mapper/PipeInfoMapper.java b/hd/pipe/mobile/src/main/java/com/thhy/mobile/modules/biz/pipeinfo/mapper/PipeInfoMapper.java index ba122b6..ff68acb 100644 --- a/hd/pipe/mobile/src/main/java/com/thhy/mobile/modules/biz/pipeinfo/mapper/PipeInfoMapper.java +++ b/hd/pipe/mobile/src/main/java/com/thhy/mobile/modules/biz/pipeinfo/mapper/PipeInfoMapper.java @@ -1,12 +1,14 @@ package com.thhy.mobile.modules.biz.pipeinfo.mapper; import com.thhy.mobile.modules.biz.checkhistory.entity.*; +import com.thhy.mobile.modules.biz.cultivated.entity.PipeCultivated; import com.thhy.mobile.modules.biz.cultivated.entity.PipeIntoListVo; import com.thhy.mobile.modules.biz.mouldcheck.entity.Mould; import com.thhy.mobile.modules.biz.mouldcheck.entity.MouldFree; import com.thhy.mobile.modules.biz.mouldcheck.entity.RingCompleteCheck; import com.thhy.mobile.modules.biz.pipecheckrecord.entity.MaterialStockRecord; import com.thhy.mobile.modules.biz.pipeinfo.entity.*; +import com.thhy.mobile.modules.biz.repo.entity.RepoRecord; import com.thhy.mobile.modules.biz.steelproduce.entity.ProduceDto; import com.thhy.mobile.modules.biz.steelproduce.entity.ProduceMonthVo; import com.thhy.mobile.modules.biz.temdevice.entity.DeviceInfo; @@ -151,4 +153,20 @@ int queryMaxNumBySteelProduce(); int countByRingNum(String ringNum); + + Boolean compelteByRingNumAndPro(@Param("ringNum")String ringNum,@Param("proId")String proId); + + List<PipeIntoListVo> queryByRingNumAndPro(@Param("ringNum") String ringNum,@Param("proId") String proId); + + PipeCultivated queryWaterTimeByPipeNum(String pipeNum); + + RepoRecord queryRepoDate(String pipeNum); + + void updatePipeDateByNum(PipeDateDto pipeDateDto); + + void updateInWaterTime(PipeCultivated pipeCultivated); + + void updateOutWaterTime(PipeCultivated pipeCultivated); + + void updateInRepoTime(RepoRecord repoRecord); } diff --git a/hd/pipe/mobile/src/main/java/com/thhy/mobile/modules/biz/pipeinfo/service/PipeInfoService.java b/hd/pipe/mobile/src/main/java/com/thhy/mobile/modules/biz/pipeinfo/service/PipeInfoService.java index a435a25..9cc442a 100644 --- a/hd/pipe/mobile/src/main/java/com/thhy/mobile/modules/biz/pipeinfo/service/PipeInfoService.java +++ b/hd/pipe/mobile/src/main/java/com/thhy/mobile/modules/biz/pipeinfo/service/PipeInfoService.java @@ -7,6 +7,7 @@ import java.io.Serializable; import java.util.HashMap; import java.util.List; +import java.util.Map; /** * 服务类 @@ -54,4 +55,8 @@ List<MaterialInfo> materialTotalStock(String companyId); void updateRingNum(PipeInfo pipeInfo); + + Map<String,Object> updateDateInfo(PipeInfo pipeInfo); + + void updatePipeDate(PipeDateDto pipeDateDto); } diff --git a/hd/pipe/mobile/src/main/java/com/thhy/mobile/modules/biz/pipeinfo/service/impl/PipeInfoServiceImpl.java b/hd/pipe/mobile/src/main/java/com/thhy/mobile/modules/biz/pipeinfo/service/impl/PipeInfoServiceImpl.java index caaa054..19d0ea5 100644 --- a/hd/pipe/mobile/src/main/java/com/thhy/mobile/modules/biz/pipeinfo/service/impl/PipeInfoServiceImpl.java +++ b/hd/pipe/mobile/src/main/java/com/thhy/mobile/modules/biz/pipeinfo/service/impl/PipeInfoServiceImpl.java @@ -4,12 +4,16 @@ import com.thhy.general.common.BasicStatus; import com.thhy.general.config.SysUserInfo; import com.thhy.general.exception.BasicException; +import com.thhy.general.utils.DeepCopyUtils; import com.thhy.general.utils.UserInfoUtils; +import com.thhy.mobile.modules.biz.cultivated.entity.PipeCultivated; +import com.thhy.mobile.modules.biz.cultivated.entity.PipeIntoListVo; import com.thhy.mobile.modules.biz.pipecheckrecord.entity.PipeCheckRecord; import com.thhy.mobile.modules.biz.pipecheckrecord.mapper.PipeCheckRecordMapper; import com.thhy.mobile.modules.biz.pipeinfo.entity.*; import com.thhy.mobile.modules.biz.pipeinfo.mapper.PipeInfoMapper; import com.thhy.mobile.modules.biz.pipeinfo.service.PipeInfoService; +import com.thhy.mobile.modules.biz.repo.entity.RepoRecord; import com.thhy.mobile.modules.biz.steelproduce.entity.ProduceDto; import com.thhy.mobile.modules.biz.steelproduce.entity.ProduceMonthVo; import org.springframework.beans.factory.annotation.Autowired; @@ -20,9 +24,7 @@ import java.math.BigDecimal; import java.text.ParseException; import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.HashMap; -import java.util.List; +import java.util.*; /** * 服务实现类 @@ -226,4 +228,121 @@ PipeInfo pipeInfo1 = pipeInfoMapper.queryByPipeNum(pipeInfo.getPipeNum()); pipeInfoMapper.updateRingNum(pipeInfo1.getRingNum(), pipeInfo.getRingNum()); } + + @Override + public Map<String, Object> updateDateInfo(PipeInfo pipeInfo) { + Map<String, Object> map = new HashMap<>(); + PipeInfo pinfos = pipeInfoMapper.queryByPipeNum(pipeInfo.getPipeNum()); + + Boolean result = pipeInfoMapper.compelteByRingNumAndPro(pinfos.getRingNum(), pinfos.getProId()); + if(result==null||!result){ + throw new BasicException(BasicStatus.RING_NOT_COMPLETE); + } + List<PipeIntoListVo> intoListVos = pipeInfoMapper.queryByRingNumAndPro(pinfos.getRingNum(),pinfos.getProId()); + + PipeInfo pinfo = pipeInfoMapper.queryByPipeNum(intoListVos.get(0).getPipeNum()); + if(pinfo.getCheckResult().equals(0)){ + //水养 + //PipeCultivated pipeCultivated = pipeInfoMapper.queryWaterTimeByPipeNum(pipeInfo.getPipeNum()); + + } + + map.put("inModTime",pinfo.getIntoModTime()); + map.put("outModTime",pinfo.getOutModTime()); + map.put("placingInTime",pinfo.getPlacingInTime()); + map.put("placingOutTime",pinfo.getPlacingOutTime()); + map.put("pouringTime",pinfo.getPouringTime()); + + map.put("checkTime",pinfo.getCheckTime()); + + PipeCultivated pipeCultivated = pipeInfoMapper.queryWaterTimeByPipeNum(pipeInfo.getPipeNum()); + map.put("inWaterFlag",false); + map.put("OutWaterFlag",false); + map.put("inRepoFlag",false); + if(pipeCultivated!=null){ + map.put("inWaterFlag",true); + map.put("inWaterTime",pipeCultivated.getCreateTime()); + + if(pipeCultivated.getOutWater()==2){ + map.put("OutWaterFlag",true); + map.put("OutWaterTime",pipeCultivated.getOutTime()); + RepoRecord repoRecord = pipeInfoMapper.queryRepoDate(pipeInfo.getPipeNum()); + if(repoRecord!=null){ + map.put("inRepoFlag",true); + map.put("inRepoTime",repoRecord.getCreateTime()); + } + return map; + }else{ + return map; + } + }else{ + return map; + } + } + + @Transactional + @Override + public void updatePipeDate(PipeDateDto pipeDateDto) { + PipeInfo pinfo = pipeInfoMapper.queryByPipeNum(pipeDateDto.getPipeNum()); + + Boolean result = pipeInfoMapper.compelteByRingNumAndPro(pinfo.getRingNum(), pinfo.getProId()); + if(result==null||!result){ + throw new BasicException(BasicStatus.RING_NOT_COMPLETE); + } + List<PipeIntoListVo> intoListVos = pipeInfoMapper.queryByRingNumAndPro(pinfo.getRingNum(),pinfo.getProId()); + + for(int i=0;i<intoListVos.size();i++){ + PipeDateDto pd = createNewDate(pipeDateDto,i); + pd.setPipeNum(intoListVos.get(i).getPipeNum()); + pipeInfoMapper.updatePipeDateByNum(pd); + //入模 + } + PipeCultivated pipeCultivated = pipeInfoMapper.queryWaterTimeByPipeNum(pipeDateDto.getPipeNum()); + if (pipeCultivated!=null) { + pipeCultivated.setCreateTime(pipeDateDto.getInWaterTime()); + pipeInfoMapper.updateInWaterTime(pipeCultivated); + if(pipeCultivated.getOutWater()==2){ + pipeCultivated.setOutTime(pipeDateDto.getOutWaterTime()); + pipeInfoMapper.updateOutWaterTime(pipeCultivated); + } + } + + RepoRecord repoRecord = pipeInfoMapper.queryRepoDate(pipeDateDto.getPipeNum()); + + if (repoRecord!=null) { + repoRecord.setCreateTime(pipeDateDto.getInRepoTime()); + pipeInfoMapper.updateInRepoTime(repoRecord); + } + } + + public PipeDateDto createNewDate(PipeDateDto pipeDateDto,int index){ + PipeDateDto pd = new PipeDateDto(); + if(index==0){ + DeepCopyUtils.copy(pipeDateDto,pd); + }else{ + pd.setInModTime(addMiu(pipeDateDto.getInModTime(),5*index)); + pd.setOutModTime(addMiu(pipeDateDto.getOutModTime(),5*index)); + pd.setPouringTime(addMiu(pipeDateDto.getPouringTime(),5*index)); + pd.setCheckTime(addMiu(pipeDateDto.getCheckTime(),5*index)); + pd.setPlacingInTime(addMiu(pipeDateDto.getPlacingInTime(),5*index)); + pd.setPlacingOutTime(addMiu(pipeDateDto.getPlacingOutTime(),5*index)); + if (pipeDateDto.getInRepoTime()!=null) { + pd.setInRepoTime(addMiu(pipeDateDto.getInRepoTime(),5*index)); + } + if (pipeDateDto.getInWaterTime()!=null) { + pd.setInWaterTime(addMiu(pipeDateDto.getInWaterTime(),5*index)); + } + if (pipeDateDto.getOutWaterTime()!=null) { + pd.setOutWaterTime(addMiu(pipeDateDto.getOutWaterTime(),5*index)); + } + } + return pd; + } + + public Date addMiu(Date oldTime,int amount){ + Calendar calendar = Calendar.getInstance(); + calendar.setTime(oldTime); + calendar.add(Calendar.MINUTE,amount); + return calendar.getTime(); + } } diff --git a/hd/pipe/mobile/src/main/resources/mapping/PipeInfoMapper.xml b/hd/pipe/mobile/src/main/resources/mapping/PipeInfoMapper.xml index ead721b..442cde4 100644 --- a/hd/pipe/mobile/src/main/resources/mapping/PipeInfoMapper.xml +++ b/hd/pipe/mobile/src/main/resources/mapping/PipeInfoMapper.xml @@ -840,4 +840,86 @@ <select id="countByRingNum" resultType="int"> select count(pipe_id) from t_pipe_info where ring_num = #{ringNum} </select> + + <select id="compelteByRingNumAndPro" resultType="boolean"> + select (a.pipeBlock=b.proBlock) as result from + ( + select GROUP_CONCAT(block_num order by sd.dict_value) as pipeBlock,tpi.pro_id + from t_pipe_info tpi + left join sys_dict sd on sd.dict_id = tpi.block_num + where tpi.ring_num = #{ringNum} and tpi.pro_id = #{proId} and tpi.check_result = 1 + group by tpi.ring_num,tpi.pro_id + ) a + left join + ( + select GROUP_CONCAT(block_num order by sd1.dict_value) as proBlock,spb.pro_id + from sys_pro_blok spb + left join sys_dict sd1 on sd1.dict_id = spb.block_num + where spb.pro_id = #{proId} + group by spb.pro_id + ) b on a.pro_id = b.pro_id + </select> + + <select id="queryByRingNumAndPro" resultType="com.thhy.mobile.modules.biz.cultivated.entity.PipeIntoListVo"> + select t.ring_num as ringNum,t.pipe_num as pipeNum,t.check_time as checkTime,sd.dict_name as blockNum,sp.pro_name as proName + from t_pipe_info t + left join sys_dict sd on sd.dict_id = t.block_num + left join sys_project sp on sp.pro_id = t.pro_id + where t.ring_num = #{ringNum} and t.pro_id = #{proId} + order by t.pipe_num + </select> + + <select id="queryWaterTimeByPipeNum" resultType="com.thhy.mobile.modules.biz.cultivated.entity.PipeCultivated"> + select pc.id,pc.ring_num as ringNum,pc.create_time as createTime,pc.out_time as outTime,pc.out_water as outWater + from t_pipe_cultivated_pi pcp + left join t_pipe_cultivated pc on pcp.cultivated_id = pc.id + where pipe_num = #{pipeNum} + </select> + + <select id="queryRepoDate" resultType="com.thhy.mobile.modules.biz.repo.entity.RepoRecord"> + select rr.create_time as createTime,rr.record_id as recordId,rrp.out_repo as outRepo,rrp.out_repo_time as outRepoTime + from t_repo_record_pipe rrp + left join t_repo_record rr on rrp.record_id = rr.record_id + where rrp.pipe_num = #{pipeNum} + </select> + + <update id="updatePipeDateByNum"> + update t_pipe_info + <set> + <if test="checkTime != null"> + check_time=#{checkTime}, + </if> + <if test="inModTime != null"> + into_mod_time=#{inModTime}, + </if> + <if test="outModTime != null"> + out_mod_time=#{outModTime}, + </if> + <if test="pouringTime != null"> + pouring_time=#{pouringTime}, + </if> + <if test="placingInTime != null"> + placing_in_time=#{placingInTime}, + </if> + <if test="placingOutTime != null"> + placing_out_time=#{placingOutTime}, + </if> + <if test="inRepoTime != null"> + in_repo_time = #{inRepoTime}, + </if> + </set> + where pipe_num=#{pipeNum} + </update> + + <update id="updateInWaterTime"> + update t_pipe_cultivated set create_time = #{createTime} where id =#{id} + </update> + + <update id="updateOutWaterTime"> + update t_pipe_cultivated set out_time = #{outTime} where id =#{id} + </update> + + <update id="updateInRepoTime"> + update t_repo_record set create_time = #{createTime} where record_id =#{recordId} + </update> </mapper> diff --git a/hd/pipe/screen/src/main/java/com/thhy/screen/config/StartListener.java b/hd/pipe/screen/src/main/java/com/thhy/screen/config/StartListener.java new file mode 100644 index 0000000..bea7377 --- /dev/null +++ b/hd/pipe/screen/src/main/java/com/thhy/screen/config/StartListener.java @@ -0,0 +1,34 @@ +package com.thhy.screen.config; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.alibaba.nacos.api.utils.StringUtils; +import com.thhy.screen.modules.biz.audio.entity.AudioGroup; +import com.thhy.screen.modules.biz.bigscreen.mapper.BigScreenMapper; +import com.thhy.screen.utils.AudioUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.ApplicationArguments; +import org.springframework.boot.ApplicationRunner; +import org.springframework.context.annotation.Configuration; + +import java.util.List; + +@Configuration +public class StartListener implements ApplicationRunner { + + @Autowired + private BigScreenMapper screenMapper; + + @Override + public void run(ApplicationArguments args) throws Exception { + String result = AudioUtils.getGroups(); + if(StringUtils.isEmpty(result)){ + return; + } + JSONObject groupJSON = JSON.parseObject(result); + List<AudioGroup> groupList = JSON.parseArray(groupJSON.getString("Groups"),AudioGroup.class); + for(AudioGroup ag : groupList){ + screenMapper.insertAudioGroup(ag); + } + } +} diff --git a/hd/pipe/screen/src/main/java/com/thhy/screen/modules/biz/agv/controller/NettyServerHandler.java b/hd/pipe/screen/src/main/java/com/thhy/screen/modules/biz/agv/controller/NettyServerHandler.java index 41a590d..d209502 100644 --- a/hd/pipe/screen/src/main/java/com/thhy/screen/modules/biz/agv/controller/NettyServerHandler.java +++ b/hd/pipe/screen/src/main/java/com/thhy/screen/modules/biz/agv/controller/NettyServerHandler.java @@ -52,6 +52,7 @@ if(mess.contains("{")){ mess = mess.substring(mess.indexOf("{"),mess.indexOf("}")+1); } + logger.info("服务器处理消息: {}", mess); AgvStateHistory agvStateHistory = JSON.parseObject(mess, AgvStateHistory.class); historyMapper.insert(agvStateHistory); diff --git a/hd/pipe/screen/src/main/java/com/thhy/screen/modules/biz/audio/controller/AudioController.java b/hd/pipe/screen/src/main/java/com/thhy/screen/modules/biz/audio/controller/AudioController.java new file mode 100644 index 0000000..86bbbf0 --- /dev/null +++ b/hd/pipe/screen/src/main/java/com/thhy/screen/modules/biz/audio/controller/AudioController.java @@ -0,0 +1,32 @@ +package com.thhy.screen.modules.biz.audio.controller; + +import com.thhy.general.common.BasicResult; +import com.thhy.screen.modules.biz.audio.entity.AudioDto; +import com.thhy.screen.modules.biz.audio.entity.AudioGroup; +import com.thhy.screen.modules.biz.audio.service.AudioService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +@RestController +@RequestMapping("audio") +public class AudioController { + + @Autowired + private AudioService audioService; + + @RequestMapping("groups") + public BasicResult groups(){ + List<AudioGroup> groupList = audioService.queryGroups(); + return BasicResult.success(groupList); + } + + @RequestMapping("playMusic") + public BasicResult playMusic(@RequestBody AudioDto AudioDto){ + audioService.playMusic(AudioDto); + return BasicResult.success(); + } +} diff --git a/hd/pipe/screen/src/main/java/com/thhy/screen/modules/biz/audio/entity/AudioDto.java b/hd/pipe/screen/src/main/java/com/thhy/screen/modules/biz/audio/entity/AudioDto.java new file mode 100644 index 0000000..2209ef9 --- /dev/null +++ b/hd/pipe/screen/src/main/java/com/thhy/screen/modules/biz/audio/entity/AudioDto.java @@ -0,0 +1,11 @@ +package com.thhy.screen.modules.biz.audio.entity; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class AudioDto implements Serializable { + + private String groupIds; +} diff --git a/hd/pipe/screen/src/main/java/com/thhy/screen/modules/biz/audio/entity/AudioGroup.java b/hd/pipe/screen/src/main/java/com/thhy/screen/modules/biz/audio/entity/AudioGroup.java new file mode 100644 index 0000000..c921e8b --- /dev/null +++ b/hd/pipe/screen/src/main/java/com/thhy/screen/modules/biz/audio/entity/AudioGroup.java @@ -0,0 +1,20 @@ +package com.thhy.screen.modules.biz.audio.entity; + +import com.alibaba.fastjson.annotation.JSONField; +import com.thhy.general.annotations.Idkey; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class AudioGroup implements Serializable { + + @Idkey + private String id; + + @JSONField(name = "ID") + private String groupId; + + @JSONField(name = "Name") + private String groupName; +} diff --git a/hd/pipe/screen/src/main/java/com/thhy/screen/modules/biz/audio/service/AudioService.java b/hd/pipe/screen/src/main/java/com/thhy/screen/modules/biz/audio/service/AudioService.java new file mode 100644 index 0000000..7b14600 --- /dev/null +++ b/hd/pipe/screen/src/main/java/com/thhy/screen/modules/biz/audio/service/AudioService.java @@ -0,0 +1,13 @@ +package com.thhy.screen.modules.biz.audio.service; + +import com.thhy.screen.modules.biz.audio.entity.AudioDto; +import com.thhy.screen.modules.biz.audio.entity.AudioGroup; + +import java.util.List; + +public interface AudioService { + + List<AudioGroup> queryGroups(); + + void playMusic(AudioDto audioDto); +} diff --git a/hd/pipe/screen/src/main/java/com/thhy/screen/modules/biz/audio/service/impl/AudioServiceImpl.java b/hd/pipe/screen/src/main/java/com/thhy/screen/modules/biz/audio/service/impl/AudioServiceImpl.java new file mode 100644 index 0000000..e25d27e --- /dev/null +++ b/hd/pipe/screen/src/main/java/com/thhy/screen/modules/biz/audio/service/impl/AudioServiceImpl.java @@ -0,0 +1,31 @@ +package com.thhy.screen.modules.biz.audio.service.impl; + +import com.thhy.screen.modules.biz.audio.entity.AudioDto; +import com.thhy.screen.modules.biz.audio.entity.AudioGroup; +import com.thhy.screen.modules.biz.audio.service.AudioService; +import com.thhy.screen.modules.biz.bigscreen.mapper.BigScreenMapper; +import com.thhy.screen.utils.AudioUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class AudioServiceImpl implements AudioService { + + @Autowired + private BigScreenMapper screenMapper; + + @Override + public List<AudioGroup> queryGroups() { + return screenMapper.queryGroups(); + } + + @Override + public void playMusic(AudioDto audioDto) { + String groupIds = audioDto.getGroupIds(); + String[] groupIdArray = new String[]{groupIds}; + AudioUtils.playMusic(groupIdArray); + return; + } +} diff --git a/hd/pipe/screen/src/main/java/com/thhy/screen/modules/biz/bigscreen/mapper/BigScreenMapper.java b/hd/pipe/screen/src/main/java/com/thhy/screen/modules/biz/bigscreen/mapper/BigScreenMapper.java index 2bb0d6f..0a88200 100644 --- a/hd/pipe/screen/src/main/java/com/thhy/screen/modules/biz/bigscreen/mapper/BigScreenMapper.java +++ b/hd/pipe/screen/src/main/java/com/thhy/screen/modules/biz/bigscreen/mapper/BigScreenMapper.java @@ -1,5 +1,6 @@ package com.thhy.screen.modules.biz.bigscreen.mapper; +import com.thhy.screen.modules.biz.audio.entity.AudioGroup; import com.thhy.screen.modules.biz.bigscreen.entity.*; import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Component; @@ -29,4 +30,8 @@ HashMap<String,Object> displayText(); List<HashMap<String,Object>> monthRingNumByPro(@Param("companyId") String companyId,@Param("proId") String proId); + + void insertAudioGroup(AudioGroup audioGroup); + + List<AudioGroup> queryGroups(); } diff --git a/hd/pipe/screen/src/main/java/com/thhy/screen/utils/AudioUtils.java b/hd/pipe/screen/src/main/java/com/thhy/screen/utils/AudioUtils.java new file mode 100644 index 0000000..9d5d23a --- /dev/null +++ b/hd/pipe/screen/src/main/java/com/thhy/screen/utils/AudioUtils.java @@ -0,0 +1,41 @@ +package com.thhy.screen.utils; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.thhy.screen.modules.biz.audio.entity.AudioGroup; + +import java.util.List; + +public class AudioUtils { + + public static void main(String[] args) { + //getGroups(); + + } + + public static void login(){ + + } + + public static String getGroups(){ + String result = HttpUtils.post("GetGroups",new JSONObject()); + System.out.println(result); + return result; + } + + public static String playMusic(String[] groupIds){ + JSONObject jsonObject = new JSONObject(); + String[] ms = new String[]{"https://szpipe.thhy-tj.com/jingbao.mp3"}; + int[] groupIdArray = new int[groupIds.length]; + for(int i =0;i<groupIds.length;i++){ + groupIdArray[i] = Integer.parseInt(groupIds[i]); + } + jsonObject.put("Files",ms); + jsonObject.put("TextCode",1); + jsonObject.put("GroupIds",groupIdArray); + String result = HttpUtils.post("playMp3",jsonObject); + System.out.println(result); + return result; + } +} diff --git a/hd/pipe/screen/src/main/java/com/thhy/screen/utils/HttpUtils.java b/hd/pipe/screen/src/main/java/com/thhy/screen/utils/HttpUtils.java new file mode 100644 index 0000000..3534bcb --- /dev/null +++ b/hd/pipe/screen/src/main/java/com/thhy/screen/utils/HttpUtils.java @@ -0,0 +1,148 @@ +package com.thhy.screen.utils; + +import com.alibaba.fastjson.JSONObject; +import com.github.pagehelper.PageInfo; +import com.thhy.general.common.BasicMessage; +import com.thhy.general.exception.BasicException; + +import java.io.*; +import java.net.HttpURLConnection; +import java.net.URL; +import java.util.Map; + +public class HttpUtils { + + private static String BaseHost = "http://150.158.37.69:8080/api/"; + + private static String token = ""; + + public static String post(String apiPath, JSONObject paramJson, PageInfo pageInfo){ + HttpURLConnection connection=null; + try { + URL url = new URL(BaseHost+apiPath); + connection = (HttpURLConnection) url.openConnection(); + connection.setConnectTimeout(3000); + connection.setReadTimeout(3000); + connection.setRequestMethod("POST"); + connection.setDoInput(true); + connection.setDoOutput(false); + connection.setRequestProperty("content-type","application/json;charset=UTF-8"); + if(!apiPath.equals("/api/getToken")){ + connection.setRequestProperty("userToken",""); + } + /*if(pageInfo.isPage()){ + connection.setRequestProperty("pageNum",pageInfo.getPageNo()+""); + connection.setRequestProperty("pageSize",pageInfo.getPageSize()+""); + }*/ + connection.connect(); + + DataOutputStream dos=new DataOutputStream(connection.getOutputStream()); + dos.write(paramJson.toJSONString().getBytes("UTF-8")); + //dos.writeBytes(paramJson.toJSONString()); + int responseCode = connection.getResponseCode(); + if (responseCode != HttpURLConnection.HTTP_OK) { + throw new BasicException(new BasicMessage("19901","网络连接失败")); + } + String result = getStringByStream(connection.getInputStream()); + if (result == null) { + throw new BasicException(new BasicMessage("19901","网络连接失败")); + }else{ + return result; + } + } catch (Exception e) { + e.printStackTrace(); + throw new BasicException(new BasicMessage("19901","网络连接失败")); + } + } + + public static String post(String apiPath, JSONObject paramJson){ + HttpURLConnection connection=null; + try { + URL url = new URL(BaseHost+apiPath); + connection = (HttpURLConnection) url.openConnection(); + connection.setConnectTimeout(3000); + connection.setReadTimeout(3000); + connection.setRequestMethod("POST"); + connection.setDoInput(true); + connection.setDoOutput(true); + connection.setRequestProperty("content-type","application/json;charset=UTF-8"); + if(!apiPath.equals("/api/getToken")){ + connection.setRequestProperty("userToken",""); + } + connection.connect(); + + DataOutputStream dos=new DataOutputStream(connection.getOutputStream()); + dos.write(paramJson.toJSONString().getBytes("UTF-8")); + //dos.writeBytes(paramJson.toJSONString()); + int responseCode = connection.getResponseCode(); + if (responseCode != HttpURLConnection.HTTP_OK) { + throw new BasicException(new BasicMessage("19901","网络连接失败")); + } + String result = getStringByStream(connection.getInputStream()); + if (result == null) { + throw new BasicException(new BasicMessage("19901","网络连接失败")); + }else{ + return result; + } + } catch (Exception e) { + e.printStackTrace(); + throw new BasicException(new BasicMessage("19901","网络连接失败")); + } + } + + private static String getStringByStream(InputStream inputStream){ + Reader reader; + try { + reader=new InputStreamReader(inputStream,"UTF-8"); + char[] rawBuffer=new char[512]; + StringBuffer buffer=new StringBuffer(); + int length; + while ((length=reader.read(rawBuffer))!=-1){ + buffer.append(rawBuffer,0,length); + } + return buffer.toString(); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + return null; + } + + + + public static String get(String api, Map<String,Object> map){ + HttpURLConnection connection = null; + try { + + StringBuilder urlParam = new StringBuilder(); + for(String key : map.keySet()){ + urlParam.append(key+"="+map.get(key).toString()+"&"); + } + String param = urlParam.toString(); + if(param.contains("&")){ + param = param.substring(0,param.length()-1); + } + URL url = new URL(BaseHost+api+"?"+param); + connection = (HttpURLConnection) url.openConnection(); + connection.setConnectTimeout(3000); + connection.setReadTimeout(3000); + connection.setRequestMethod("GET"); + if(!api.equals("/api/getToken")){ + connection.setRequestProperty("authorization",""); + } + + //dos.writeBytes(paramJson.toJSONString()); + int responseCode = connection.getResponseCode(); + if (responseCode != HttpURLConnection.HTTP_OK) { + return null; + } + String result = getStringByStream(connection.getInputStream()); + return result; + } catch (Exception e) { + e.printStackTrace(); + return null; + } + } + +} diff --git a/hd/pipe/screen/src/main/resources/mapping/BigScreenMapper.xml b/hd/pipe/screen/src/main/resources/mapping/BigScreenMapper.xml index a874634..f5a063c 100644 --- a/hd/pipe/screen/src/main/resources/mapping/BigScreenMapper.xml +++ b/hd/pipe/screen/src/main/resources/mapping/BigScreenMapper.xml @@ -207,5 +207,35 @@ ) x on x.`month` = DATE_FORMAT(m.`month`,'%Y-%m') </select> + <insert id="insertAudioGroup"> + INSERT INTO + <trim suffix=")" prefix="(" suffixOverrides=","> + <if test="id != null and id !=null"> + id, + </if> + <if test="groupId != null"> + group_id, + </if> + <if test="groupName != null and groupName !=null"> + group_name, + </if> + </trim> + <trim suffix=")" prefix=" values(" suffixOverrides=","> + <if test="id != null and id !=null"> + #{id}, + </if> + <if test="groupId != null"> + #{groupId}, + </if> + <if test="groupName != null and groupName !=null"> + #{groupName}, + </if> + </trim> + </insert> + + <select id="queryGroups" resultType="com.thhy.screen.modules.biz.audio.entity.AudioGroup"> + select id,group_id as groupId,group_name as groupName from t_audio_groups + </select> + </mapper> \ No newline at end of file diff --git a/hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/hiddenDanger/entity/HiddenDangerEntity.java b/hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/hiddenDanger/entity/HiddenDangerEntity.java index c01ed06..286940c 100644 --- a/hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/hiddenDanger/entity/HiddenDangerEntity.java +++ b/hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/hiddenDanger/entity/HiddenDangerEntity.java @@ -52,7 +52,7 @@ if (auditStatus != null){ switch (auditStatus){ case 0: - name = "未审核"; + name = "待审核"; break; case 1: name = "已审核"; @@ -102,7 +102,7 @@ public String getLevelName() { String name = ""; if (level != null){ - switch (level){ + switch (level){ case 1: name = "一般隐患"; break; diff --git a/web/src/api/modules/materials.js b/web/src/api/modules/materials.js index a8bb76d..fcf8f95 100644 --- a/web/src/api/modules/materials.js +++ b/web/src/api/modules/materials.js @@ -41,7 +41,7 @@ */ //查询列表接口 searchWeighRecordsList: (params) => - axios.post('/materials/weigh/queryAllWeigh', params), + axios.post('/materials/weigh/weighbridgeList', params), /** diff --git a/web/src/views/GoodManage/WeightRecord.vue b/web/src/views/GoodManage/WeightRecord.vue new file mode 100644 index 0000000..62e2aae --- /dev/null +++ b/web/src/views/GoodManage/WeightRecord.vue @@ -0,0 +1,159 @@ +<template> + <div class="main"> + <div class="main_header"> + <div class="header_item"> + <span class="header_label">车牌号:</span> + <el-input v-model="search.carNumber" :size="size" clearable placeholder="请输入车牌号"></el-input> + </div> + <div class="header_item"> + <span class="header_label">原材料名称:</span> + <el-input v-model="search.matName" :size="size" clearable placeholder="请输入原材料名称"></el-input> + </div> + <div class="header_item"> + <span class="header_label">时间范围:</span> + <el-date-picker + v-model="search.time" + type="daterange" + :default-time="['00:00:00','23:59:59']" + clearable + value-format="yyyy-MM-dd HH:mm:ss" + range-separator="-" + start-placeholder="起始时间" + end-placeholder="结束时间"> + </el-date-picker> + </div> + <div class="header_item"> + <el-button icon="el-icon-search" v-if="showButton('search')" @click="searchButtonInfo(true)">查询</el-button> + </div> + </div> + <div class="main_content"> + <el-table + v-loading="loading" + :data="dataList" + height="100%"> + <el-table-column align="center" label="序号" width="60"> + <template #default="scope"> + <span>{{(pageNum - 1) * pageSize + scope.$index + 1}}</span> + </template> + </el-table-column> + <el-table-column prop="code" label="过磅编号" align="center" width="120"></el-table-column> + <el-table-column prop="orgname" label="业务所属机构" align="center" width="200"></el-table-column> + <el-table-column prop="supplyorgname" label="供应单位名称" align="center" width="200"></el-table-column> + <el-table-column prop="carnumber" label="车牌号" align="center"></el-table-column> + <el-table-column prop="drivername" label="运输司机" align="center" ></el-table-column> + <el-table-column prop="matname" label="原料名称" align="center"></el-table-column> + <el-table-column prop="matmodel" label="原材料型号" align="center" width="150"></el-table-column> + <el-table-column prop="mpoundtime" label="过毛时间" align="center"></el-table-column> + <el-table-column prop="mpoundweight" label="毛重" align="center"></el-table-column> + <el-table-column prop="mpoundname" label="过毛人" align="center"></el-table-column> + <el-table-column prop="ppoundtime" label="皮重时间" align="center"></el-table-column> + <el-table-column prop="ppoundname" label="过皮人" align="center"></el-table-column> + <el-table-column prop="jpoundweight" label="过磅净重" align="center"></el-table-column> + <el-table-column prop="buckleweight" label="扣重" align="center"></el-table-column> + <el-table-column prop="mweight" label="毛重" align="center"></el-table-column> + <el-table-column prop="pweight" label="皮重" align="center"></el-table-column> + <el-table-column prop="jweight" label="净重" align="center"></el-table-column> + <el-table-column prop="warename" label="入库仓名称" align="center" width="100"></el-table-column> + <el-table-column prop="types" label="同步状态" align="center" width="100"> + <template #default="{row}"> + <div>{{row.types===1?'未同步':row.types===2?'已同步':''}}</div> + </template> + </el-table-column> + </el-table> + </div> + <div class="main_footer"> + <el-pagination + background + @current-change="changePageNum" + @size-change="changePageSize" + :current-page="pageNum" + :page-sizes="[10, 20, 50, 100]" + :page-size="pageSize" + layout="total, sizes, prev, pager, next, jumper" + :total="total"> + </el-pagination> + </div> + </div> +</template> + +<script> +import { buttonPinia } from '../../pinia/index'; +import { changeSize } from '../../plugins/public'; // 导入节流、动态切换组件尺寸方法 + export default { + data() { + return { + size: changeSize(), // 组件尺寸 + pageNum: 1, + pageSize: 10, + search:{},//查询条件 + total: 0, + loading: false, + dataList: [], //进场称重列表 + } + }, + watch: { + asyncVisible(bol) { + if(!bol) { + this.ruleForm = {}; + this.$refs.ruleForm.resetFields(); + } + } + }, + mounted() { + const that = this; + // 根据窗口大小动态修改组件尺寸 + window.onresize = () => { + that.size = changeSize(); + } + that.searchButtonInfo(true); + }, + methods: { + // 查询按钮列表信息 + searchButtonInfo(bol) { + if(bol) { + this.pageNum = 1; + } + let params = Object.assign({},this.search,{ + pageNum: this.pageNum, + pageSize: this.pageSize + }) + params.startTime = this.search.time&&this.search.time[0] + params.endTime = this.search.time&&this.search.time[1] + delete params.time + this.loading = true; + this.$api.Materials.searchWeighRecordsList(params).then((res) => { + if(res.statusMsg === 'ok') { + this.total = res.data.total; + this.dataList = res.data.list; + } + this.loading = false; + }) + }, + // 判断按钮权限信息 + showButton(str) { + const pinia = buttonPinia(); + return pinia.$state.buttonInfo.includes(str); + }, + // 切换页数 + changePageNum(page) { + this.pageNum = page; + this.searchButtonInfo(); + }, + // 切换每页条数 + changePageSize(size) { + this.pageSize = size; + this.searchButtonInfo(); + } + } + } +</script> + +<style lang="scss" scoped> +@import '../../style/layout-main.scss'; +/deep/.el-color-picker__trigger{ + border-color:#1C4390; +} +/deep/.el-color-picker__color{ + border-color:#1C4390; +} +</style> \ No newline at end of file diff --git a/web/src/views/MixingInfo/messageInfo.vue b/web/src/views/MixingInfo/messageInfo.vue index cf87556..922db19 100644 --- a/web/src/views/MixingInfo/messageInfo.vue +++ b/web/src/views/MixingInfo/messageInfo.vue @@ -25,7 +25,7 @@ </div> <div class="mixing_rows"> <div class="mixing_rows_titles">检验状态:</div> - <div class="mixing_rows_datas" :class="{'standardStyle':mixingList.status===1,'notStandardStyle':mixingList.status!==1}">{{mixingList&&mixingList.status===1?'合格':'待检'}}</div> + <div class="mixing_rows_datas" :class="{'standardStyle':mixingList.status===1,'notStandardStyle':mixingList.status!==1}">{{mixingList&&mixingList.status===1?'合格':mixingList&&mixingList.status===2?'待检':''}}</div> </div> <div class="mixing_rows"> <div class="mixing_rows_titles">报告编号:</div> @@ -65,7 +65,7 @@ } this.$api.Infos.showHmixings(params).then(res=>{ if(res.statusMsg==='ok'){ - this.mixingList = res.data + this.mixingList = res.data===null?[]:res.data }else{ this.$message.warning('请检查网络或联系管理员!!!') } -- Gitblit v1.9.3