Merge branch 'master' of http://111.30.93.211:10101/r/supipe
| | |
| | | RING_NUM_IS_REPEAT("09934","环号已存在"), |
| | | |
| | | RING_NOT_DIS("09935","环号必须为整数,最多5位"), |
| | | |
| | | RING_NOT_COMPLETE("09936","尚未成环"), |
| | | ; |
| | | |
| | | |
| | |
| | | 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 |
| | |
| | | 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); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
对比新文件 |
| | |
| | | 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; |
| | | } |
| | |
| | | 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; |
| | |
| | | Integer netWeighNew(Integer byId); |
| | | |
| | | void netWeighUpdateNew(@Param("byId") Integer byId,@Param("netWeight") double netWeight); |
| | | |
| | | List<TWeighbridge> weighbridgeList(Map<String, Object> values); |
| | | } |
| | |
| | | List<WeighDto> findAlltaskNew(Integer byId, String dictName); |
| | | |
| | | List<WeighDto> findAlltaskAllNew(String dictName); |
| | | |
| | | BasicResult weighbridgeList(Map<String, Object> values); |
| | | |
| | | } |
| | |
| | | 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; |
| | |
| | | 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); |
| | | } |
| | | } |
| | |
| | | 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> |
| | |
| | | private String waterCultivatedId; |
| | | |
| | | private String companyId; |
| | | |
| | | private Integer outWater; |
| | | |
| | | private Date outTime; |
| | | } |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author zhang_xiao_bo |
| | |
| | | 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(); |
| | | } |
| | | |
| | | } |
对比新文件 |
| | |
| | | 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; |
| | | } |
| | |
| | | |
| | | private Integer createFlag; |
| | | |
| | | private Date outModTime; |
| | | |
| | | private Date placingInTime; |
| | | |
| | | private Date placingOutTime; |
| | | |
| | | public PipeInfo() {} |
| | | |
| | | public PipeInfo(Mould mould, SteelProduce steelProduce) { |
| | |
| | | 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; |
| | |
| | | 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); |
| | | } |
| | |
| | | import java.io.Serializable; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 服务类 |
| | |
| | | List<MaterialInfo> materialTotalStock(String companyId); |
| | | |
| | | void updateRingNum(PipeInfo pipeInfo); |
| | | |
| | | Map<String,Object> updateDateInfo(PipeInfo pipeInfo); |
| | | |
| | | void updatePipeDate(PipeDateDto pipeDateDto); |
| | | } |
| | |
| | | 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; |
| | |
| | | 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.*; |
| | | |
| | | /** |
| | | * 服务实现类 |
| | |
| | | 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(); |
| | | } |
| | | } |
| | |
| | | <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> |
对比新文件 |
| | |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | |
| | | if(mess.contains("{")){ |
| | | mess = mess.substring(mess.indexOf("{"),mess.indexOf("}")+1); |
| | | } |
| | | logger.info("服务器处理消息: {}", mess); |
| | | AgvStateHistory agvStateHistory = JSON.parseObject(mess, AgvStateHistory.class); |
| | | historyMapper.insert(agvStateHistory); |
| | | |
对比新文件 |
| | |
| | | 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(); |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.thhy.screen.modules.biz.audio.entity; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | public class AudioDto implements Serializable { |
| | | |
| | | private String groupIds; |
| | | } |
对比新文件 |
| | |
| | | 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; |
| | | } |
对比新文件 |
| | |
| | | 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); |
| | | } |
对比新文件 |
| | |
| | | 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; |
| | | } |
| | | } |
| | |
| | | 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; |
| | |
| | | HashMap<String,Object> displayText(); |
| | | |
| | | List<HashMap<String,Object>> monthRingNumByPro(@Param("companyId") String companyId,@Param("proId") String proId); |
| | | |
| | | void insertAudioGroup(AudioGroup audioGroup); |
| | | |
| | | List<AudioGroup> queryGroups(); |
| | | } |
对比新文件 |
| | |
| | | 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; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | 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; |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | ) 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> |