From ef1fe4aa7c40c329cd8800a06ca02fc8341775ee Mon Sep 17 00:00:00 2001 From: 叶松 <2217086471@qq.com> Date: 星期五, 24 十一月 2023 13:29:31 +0800 Subject: [PATCH] Merge branch 'master' of http://111.30.93.211:10101/r/supipe --- 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/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 ++ 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 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 | 35 ++ 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 | 3 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 26 files changed, 853 insertions(+), 3 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/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..cde8c15 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,6 @@ Integer netWeighNew(Integer byId); void netWeighUpdateNew(@Param("byId") Integer byId,@Param("netWeight") double netWeight); + + List<TWeighbridge> weighbridgeList(Map<String, Object> values); } 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..ddadc5f 100644 --- a/hd/pipe/materialsManage/src/main/resources/mapping/WeighMapper.xml +++ b/hd/pipe/materialsManage/src/main/resources/mapping/WeighMapper.xml @@ -579,5 +579,40 @@ 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> </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 -- Gitblit v1.9.3