Merge branch 'master' of http://111.30.93.211:10101/r/supipe
# Conflicts:
# web/src/views/Basics/MouldIndex.vue
对比新文件 |
| | |
| | | package com.thhy.staff.config; |
| | | |
| | | import com.thhy.staff.modules.biz.face.controller.GetUserTask; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.boot.ApplicationArguments; |
| | | import org.springframework.boot.ApplicationRunner; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | import java.util.Timer; |
| | | |
| | | @Configuration |
| | | public class StartListener implements ApplicationRunner { |
| | | |
| | | |
| | | @Value("${file.vfprefix}") |
| | | private String vfPrefix; |
| | | |
| | | @Override |
| | | public void run(ApplicationArguments args) throws Exception { |
| | | GetUserTask gutask = new GetUserTask(vfPrefix); |
| | | Timer timer = new Timer(); |
| | | timer.schedule(gutask,1000,300000); |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | @RequestMapping("/allPerson") |
| | | public JSONObject allPerson(@RequestBody String mess){ |
| | | faceServer.allPerson(mess); |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("code",0); |
| | | jsonObject.put("msg","OK"); |
| | | jsonObject.put("success",true); |
| | | return jsonObject; |
| | | } |
| | | |
| | | |
| | | } |
对比新文件 |
| | |
| | | package com.thhy.staff.modules.biz.face.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.thhy.general.utils.SpringContextUtils; |
| | | import com.thhy.staff.config.EmqxConfig; |
| | | import com.thhy.staff.modules.biz.face.mapper.FaceDeviceMapper; |
| | | import com.thhy.staff.utils.MqUtils; |
| | | import java.util.List; |
| | | import java.util.TimerTask; |
| | | |
| | | public class GetUserTask extends TimerTask { |
| | | |
| | | private String prefix; |
| | | |
| | | private FaceDeviceMapper faceDeviceMapper; |
| | | |
| | | public FaceDeviceMapper getFaceDeviceMapper() { |
| | | return SpringContextUtils.getBean(FaceDeviceMapper.class); |
| | | } |
| | | |
| | | private EmqxConfig emqxConfig; |
| | | |
| | | public EmqxConfig getEmqxConfig() { |
| | | return SpringContextUtils.getBean(EmqxConfig.class); |
| | | } |
| | | |
| | | public GetUserTask(String urlPrefix) { |
| | | this.prefix = urlPrefix; |
| | | } |
| | | |
| | | @Override |
| | | public void run() { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("method","get_person_all"); |
| | | |
| | | JSONObject dataJson = new JSONObject(); |
| | | dataJson.put("path",prefix+"allPerson"); |
| | | jsonObject.put("data",dataJson); |
| | | jsonObject.put("params",new JSONObject()); |
| | | EmqxConfig emqxConfig = getEmqxConfig(); |
| | | FaceDeviceMapper faceDeviceMapper = getFaceDeviceMapper(); |
| | | List<String> sns = faceDeviceMapper.queryDevSn(); |
| | | MqUtils.createClient(emqxConfig,sns,jsonObject.toJSONString()); |
| | | } |
| | | } |
| | |
| | | void removeNotify(String mess); |
| | | |
| | | String queryOriStrById(String id); |
| | | |
| | | void allPerson(String mess); |
| | | } |
| | |
| | | import com.thhy.staff.modules.biz.face.mapper.FaceDeviceMapper; |
| | | import com.thhy.staff.modules.biz.face.service.FaceServer; |
| | | import com.thhy.staff.modules.biz.platuser.entity.DoorLis; |
| | | import com.thhy.staff.modules.biz.platuser.entity.PlatUser; |
| | | import com.thhy.staff.modules.biz.platuser.mapper.PlatUserMapper; |
| | | import com.thhy.staff.utils.MqUtils; |
| | | import org.checkerframework.checker.units.qual.A; |
| | |
| | | return userMapper.queryOriStrById(id); |
| | | } |
| | | |
| | | @Override |
| | | public void allPerson(String mess) { |
| | | JSONObject jsonObject = JSONObject.parseObject(mess); |
| | | JSONArray jsonArray = jsonObject.getJSONArray("person_list"); |
| | | for(Object obj : jsonArray){ |
| | | JSONObject personJson = JSON.parseObject(obj.toString()); |
| | | String faceId = personJson.getString("person_id"); |
| | | int count = userMapper.countByFaceId(faceId); |
| | | if(count>0)continue; |
| | | PlatUser platUser = new PlatUser(); |
| | | platUser.setFaceId(faceId); |
| | | platUser.setIdNo(personJson.getString("id_card")); |
| | | platUser.setRealName(personJson.getString("name")); |
| | | userMapper.insertSamplePlatUser(platUser); |
| | | } |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("method","delete_person"); |
| | |
| | | private Integer isLogin; |
| | | |
| | | private String phone; |
| | | |
| | | private String faceId; |
| | | } |
| | |
| | | void syncFail(@Param("userId") String userId,@Param("syncFailReason")String syncFailReason); |
| | | |
| | | String queryOriStrById(String id); |
| | | |
| | | int countByFaceId(String faceId); |
| | | |
| | | void insertSamplePlatUser(PlatUser platUser); |
| | | } |
| | |
| | | update sys_plat_user set sync_success = 2,sync_fail_reason = #{syncFailReason} where user_id = #{userId} |
| | | </update> |
| | | |
| | | <select id="countByFaceId" resultType="int"> |
| | | select count(user_id) from sys_plat_user where face_id = #{faceId} |
| | | </select> |
| | | |
| | | <insert id="insertSamplePlatUser"> |
| | | insert into sys_plat_user |
| | | <trim prefix="(" suffixOverrides="," suffix=")"> |
| | | <if test="userId != null and userId != ''"> |
| | | user_id, |
| | | </if> |
| | | <if test="realName != null and realName != ''"> |
| | | real_name, |
| | | </if> |
| | | <if test="faceId != null and faceId != ''"> |
| | | face_id, |
| | | </if> |
| | | <if test="idNo != null and idNo != ''"> |
| | | id_no, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffixOverrides="," suffix=")"> |
| | | <if test="userId != null and userId != ''"> |
| | | #{userId}, |
| | | </if> |
| | | <if test="realName != null and realName != ''"> |
| | | #{realName}, |
| | | </if> |
| | | <if test="faceId != null and faceId != ''"> |
| | | #{faceId}, |
| | | </if> |
| | | <if test="idNo != null and idNo != ''"> |
| | | #{idNo}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | </mapper> |
| | |
| | | package com.thhy.usercore.modules.sys.sysmenu.controller; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.parser.JSONToken; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.thhy.general.utils.PagingUtils; |
| | | import com.thhy.general.common.BasicResult; |
| | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.Serializable; |
| | | import java.io.*; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | return BasicResult.success(sysMenusList); |
| | | } |
| | | |
| | | @RequestMapping("syncMenu") |
| | | public BasicResult syncMenu(){ |
| | | String value = ""; |
| | | try { |
| | | InputStream ins = new FileInputStream(new File("D:\\dd.txt")); |
| | | byte[] bytes = new byte[ins.available()]; |
| | | ins.read(bytes); |
| | | value = new String(bytes,"UTF-8"); |
| | | |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | |
| | | List<MenuTreeVo> sysMenusList = JSONArray.parseArray(value,MenuTreeVo.class); |
| | | sysMenusService.syncMenu(sysMenusList); |
| | | return BasicResult.success(sysMenusList); |
| | | } |
| | | |
| | | @RequestMapping("allRoleMenu") |
| | | public BasicResult allRoleMenu(@RequestBody MenuDto menuDto){ |
| | | menuDto.setParentId("0"); |
| | |
| | | |
| | | void insert(SysMenus sysmenus); |
| | | |
| | | void insertVo(MenuTreeVo menuTreeVo); |
| | | |
| | | void update(SysMenus sysmenus); |
| | | |
| | | int deletelogic(Serializable menuId); |
| | |
| | | package com.thhy.usercore.modules.sys.sysmenu.service; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.thhy.usercore.modules.sys.sysmenu.entity.*; |
| | | import com.thhy.usercore.modules.sys.sysmenubutton.entity.MenuButtonVo; |
| | | |
| | |
| | | |
| | | List<MenuTreeVo> findAllTree(MenuDto menuDto); |
| | | |
| | | void syncMenu(List<MenuTreeVo> sysMenusList); |
| | | |
| | | List<MenuButtonTreeVo> allRoleMenu(MenuDto menuDto); |
| | | |
| | | List<MenuButtonVo> MenuEnableButtons(MenuButtonDto menuButtonDto); |
| | |
| | | package com.thhy.usercore.modules.sys.sysmenu.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.thhy.general.utils.UserInfoUtils; |
| | | import com.thhy.general.common.BasicStatus; |
| | | import com.thhy.general.exception.BasicException; |
| | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void syncMenu(List<MenuTreeVo> sysMenusList) { |
| | | for(MenuTreeVo tree : sysMenusList){ |
| | | |
| | | sysMenusMapper.insertVo(tree); |
| | | if(tree.getChildrens().size()>0){ |
| | | |
| | | syncMenu(tree.getChildrens()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public List<MenuButtonTreeVo> allRoleMenu(MenuDto menuDto) { |
| | | List<MenuButtonTreeVo> sysMenusList = sysMenusMapper.menuRoleTree(menuDto); |
| | | for(MenuButtonTreeVo mv : sysMenusList){ |
| | |
| | | </trim> |
| | | </insert> |
| | | |
| | | <insert id="insertVo"> |
| | | insert into sys_menus |
| | | <trim prefix="(" suffix=")" suffixOverrides="," > |
| | | <if test="menuId != null"> |
| | | menu_id, |
| | | </if> |
| | | <if test="isUse != null"> |
| | | is_use, |
| | | </if> |
| | | <if test="path != null"> |
| | | path, |
| | | </if> |
| | | <if test="name != null"> |
| | | name, |
| | | </if> |
| | | <if test="hidden != null"> |
| | | hidden, |
| | | </if> |
| | | <if test="redirect != null"> |
| | | redirect, |
| | | </if> |
| | | <if test="parentId != null"> |
| | | parent_id, |
| | | </if> |
| | | <if test="title != null"> |
| | | title, |
| | | </if> |
| | | <if test="icon != null"> |
| | | icon, |
| | | </if> |
| | | <if test="component != null"> |
| | | component, |
| | | </if> |
| | | <if test="level != null"> |
| | | level, |
| | | </if> |
| | | <if test="isDefault != null"> |
| | | is_default, |
| | | </if> |
| | | </trim> |
| | | |
| | | <trim prefix="values (" suffix=")" suffixOverrides="," > |
| | | <if test="menuId != null"> |
| | | #{menuId}, |
| | | </if> |
| | | <if test="isUse != null"> |
| | | #{isUse}, |
| | | </if> |
| | | <if test="path != null"> |
| | | #{path}, |
| | | </if> |
| | | <if test="name != null"> |
| | | #{name}, |
| | | </if> |
| | | <if test="hidden != null"> |
| | | #{hidden}, |
| | | </if> |
| | | <if test="redirect != null"> |
| | | #{redirect}, |
| | | </if> |
| | | <if test="parentId != null"> |
| | | #{parentId}, |
| | | </if> |
| | | <if test="title != null"> |
| | | #{title}, |
| | | </if> |
| | | <if test="icon != null"> |
| | | #{icon}, |
| | | </if> |
| | | <if test="component != null"> |
| | | #{component}, |
| | | </if> |
| | | <if test="level != null"> |
| | | #{level}, |
| | | </if> |
| | | <if test="isDefault != null"> |
| | | #{isDefault}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <!--更新操作--> |
| | | <update id="update"> |
| | | update sys_menus |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取模具型号列表 |
| | | * 根据项目和模具编号获取模具型号列表 |
| | | * @return |
| | | */ |
| | | @GetMapping(value = "getMoldCode") |
| | | BasicResult getMoldCode(String proId){ |
| | | return moldQualityService.getMoldCode(proId); |
| | | @PostMapping(value = "getMoldCode") |
| | | BasicResult getMoldCode(@RequestBody Map<String,Object> map){ |
| | | return moldQualityService.getMoldCode(map); |
| | | } |
| | | |
| | | /** |
| | |
| | | package com.thhy.engineering.modules.biz.moldquality.mapper; |
| | | |
| | | import com.thhy.engineering.modules.biz.moldquality.entity.MoldQualityEntity; |
| | | import com.thhy.general.common.BasicResult; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | |
| | | |
| | | List<Map> getMoldNum(String proId); |
| | | |
| | | List<Map> getMoldCode(String proId); |
| | | List<Map> getMoldCode(Map<String, Object> map); |
| | | |
| | | Map getMoldByProIdAndModNumAndModCode(Map<String,Object> map); |
| | | } |
| | |
| | | /** |
| | | * 获取模具型号列表 |
| | | * @return |
| | | * @param map |
| | | */ |
| | | BasicResult getMoldCode(String proId); |
| | | BasicResult getMoldCode(Map<String,Object> map); |
| | | |
| | | |
| | | /** |
| | |
| | | import com.thhy.general.common.BasicResult; |
| | | import com.thhy.general.config.SysUserInfo; |
| | | import com.thhy.general.utils.UserInfoUtils; |
| | | import org.checkerframework.checker.units.qual.A; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public BasicResult insert(MoldQualityEntity moldQualityEntity) { |
| | | SysUserInfo sysUserInfo = UserInfoUtils.getInstance().getUserInfo(); |
| | | String companyId = sysUserInfo.getCompanyId(); |
| | | moldQualityEntity.setCompanyId(companyId); |
| | | moldQualityEntity.setCompanyId(sysUserInfo.getCompanyId()); |
| | | moldQualityEntity.setCreateUser(sysUserInfo.getRealName()); |
| | | mapper.insert(moldQualityEntity); |
| | | MoldQualityEntity newOne = mapper.findNewOne(); |
| | | moldQualityEntity.getMoldQualityFileEntities().forEach(modFile->{ |
| | |
| | | moldQualityFileMapper.delete(moldQualityEntity.getId()); |
| | | List<MoldQualityFileEntity> moldQualityFileEntities = moldQualityEntity.getMoldQualityFileEntities(); |
| | | moldQualityFileEntities.forEach(moldFile->{ |
| | | moldFile.setId(moldQualityEntity.getId()); |
| | | moldFile.setMoldQualityId(moldQualityEntity.getId()); |
| | | }); |
| | | moldQualityFileMapper.insertList(moldQualityFileEntities); |
| | | return BasicResult.success(); |
| | |
| | | map.put("companyId",companyId); |
| | | PageHelper.startPage((int)map.get("pageNum"),(int)map.get("pageSize")); |
| | | List<MoldQualityEntity> all = mapper.findAll(map); |
| | | all.forEach(moldQualityOne->{ |
| | | moldQualityOne.setMoldQualityFileEntities(moldQualityFileMapper.findFileList(moldQualityOne.getId())); |
| | | }); |
| | | PageInfo<MoldQualityEntity> moldQualityEntities = new PageInfo<>(all); |
| | | return BasicResult.success(moldQualityEntities); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public BasicResult getMoldCode(String proId) { |
| | | return BasicResult.success(mapper.getMoldCode(proId)); |
| | | public BasicResult getMoldCode(Map<String, Object> map) { |
| | | return BasicResult.success(mapper.getMoldCode(map)); |
| | | } |
| | | |
| | | @Override |
对比新文件 |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.thhy.engineering.modules.biz.moldquality.mapper.MoldQualityFileMapper"> |
| | | |
| | | |
| | | <!--查询列表--> |
| | | <select id="findFileList" resultType="com.thhy.engineering.modules.biz.moldquality.entity.MoldQualityFileEntity"> |
| | | SELECT |
| | | t.id, |
| | | t.moldQualityId, |
| | | t.fileName, |
| | | t.fileUrl, |
| | | t.createTime |
| | | from t_mold_quality_file t |
| | | where 1=1 |
| | | <if test="moldQualityId != null and moldQualityId !=''"> |
| | | and t.moldQualityId = #{moldQualityId} |
| | | </if> |
| | | </select> |
| | | |
| | | <!--插入操作--> |
| | | <insert id="insertList" parameterType="java.util.List"> |
| | | INSERT INTO t_mold_quality_file ( moldQualityId,fileName, fileUrl ) |
| | | VALUES |
| | | <foreach collection = "list" item = "item" separator=","> |
| | | ( #{item.moldQualityId},#{item.fileName},#{item.fileUrl} ) |
| | | </foreach> |
| | | </insert> |
| | | |
| | | |
| | | |
| | | <!--根据ID删除--> |
| | | <delete id="delete"> |
| | | delete from t_mold_quality_file |
| | | where moldQualityId=#{moldQualityId} |
| | | </delete> |
| | | |
| | | </mapper> |
对比新文件 |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.thhy.engineering.modules.biz.moldquality.mapper.MoldQualityMapper"> |
| | | |
| | | |
| | | <!--查询列表--> |
| | | <select id="findAll" parameterType="java.util.Map" resultType="com.thhy.engineering.modules.biz.moldquality.entity.MoldQualityEntity"> |
| | | SELECT |
| | | t.id, |
| | | t.mouldCode, |
| | | t.mouldNum, |
| | | t.blockNum, |
| | | t.size, |
| | | t.turn, |
| | | t.groutingHole, |
| | | t.content, |
| | | t.checkDate, |
| | | t.checkUnit, |
| | | t.createDate, |
| | | t.createUser, |
| | | t.companyId, |
| | | t.proId, |
| | | sp.pro_name proName |
| | | from t_mold_quality t |
| | | left join sys_project sp ON sp.pro_id = t.proId |
| | | where sp.company_id = #{companyId} |
| | | <if test="proId != null and proId !=''"> |
| | | and t.proId = #{proId} |
| | | </if> |
| | | <if test="mouldNum != null and mouldNum !=''"> |
| | | and t.mouldNum = #{mouldNum} |
| | | </if> |
| | | <if test="mouldCode != null and mouldCode !=''"> |
| | | and t.mouldCode = #{mouldCode} |
| | | </if> |
| | | order by t.createDate desc |
| | | </select> |
| | | |
| | | <select id="findNewOne" resultType="com.thhy.engineering.modules.biz.moldquality.entity.MoldQualityEntity"> |
| | | SELECT |
| | | t.id, |
| | | t.mouldCode, |
| | | t.mouldNum, |
| | | t.blockNum, |
| | | t.size, |
| | | t.turn, |
| | | t.groutingHole, |
| | | t.content, |
| | | t.checkDate, |
| | | t.checkUnit, |
| | | t.createDate, |
| | | t.createUser, |
| | | t.companyId, |
| | | t.proId |
| | | from t_mold_quality t |
| | | order by t.createDate desc |
| | | limit 1 |
| | | </select> |
| | | <!--插入操作--> |
| | | <insert id="insert"> |
| | | insert into t_mold_quality |
| | | <trim prefix="(" suffix=")" suffixOverrides="," > |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="mouldCode != null"> |
| | | mouldCode, |
| | | </if> |
| | | <if test="mouldNum != null"> |
| | | mouldNum, |
| | | </if> |
| | | <if test="blockNum != null"> |
| | | blockNum, |
| | | </if> |
| | | <if test="size != null"> |
| | | size, |
| | | </if> |
| | | <if test="turn != null"> |
| | | turn, |
| | | </if> |
| | | <if test="groutingHole != null"> |
| | | groutingHole, |
| | | </if> |
| | | <if test="content != null"> |
| | | content, |
| | | </if> |
| | | <if test="checkDate != null"> |
| | | checkDate, |
| | | </if> |
| | | <if test="checkUnit != null"> |
| | | checkUnit, |
| | | </if> |
| | | <if test="createDate != null"> |
| | | createDate, |
| | | </if> |
| | | <if test="createUser != null"> |
| | | createUser, |
| | | </if> |
| | | <if test="companyId != null"> |
| | | companyId, |
| | | </if> |
| | | <if test="proId != null"> |
| | | proId, |
| | | </if> |
| | | </trim> |
| | | |
| | | <trim prefix="values (" suffix=")" suffixOverrides="," > |
| | | <if test="id != null"> |
| | | #{id,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="mouldCode != null"> |
| | | #{mouldCode,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="mouldNum != null"> |
| | | #{mouldNum,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="blockNum != null"> |
| | | #{blockNum,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="size != null"> |
| | | #{size,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="turn != null"> |
| | | #{turn,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="groutingHole != null"> |
| | | #{groutingHole,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="content != null"> |
| | | #{content,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="checkDate != null"> |
| | | #{checkDate,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="checkUnit != null"> |
| | | #{checkUnit,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="createDate != null"> |
| | | #{createDate,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="createUser != null"> |
| | | #{createUser,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="companyId != null"> |
| | | #{companyId,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="proId != null"> |
| | | #{proId,jdbcType=VARCHAR}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | |
| | | <!--更新操作--> |
| | | <update id="update"> |
| | | update t_mold_quality |
| | | <set> |
| | | <if test="mouldCode != null"> |
| | | mouldCode = #{mouldCode,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="mouldNum != null"> |
| | | mouldNum = #{mouldNum,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="blockNum != null"> |
| | | blockNum = #{blockNum,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="size != null"> |
| | | size = #{size,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="turn != null"> |
| | | turn = #{turn,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="groutingHole != null"> |
| | | groutingHole = #{groutingHole,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="content != null"> |
| | | content = #{content,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="checkDate != null"> |
| | | checkDate = #{checkDate,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="checkUnit != null"> |
| | | checkUnit = #{checkUnit,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="createDate != null"> |
| | | createDate = #{createDate,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="createUser != null"> |
| | | createUser = #{createUser,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="companyId != null"> |
| | | companyId = #{companyId,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="proId != null"> |
| | | proId = #{proId,jdbcType=VARCHAR}, |
| | | </if> |
| | | </set> |
| | | where id=#{id,jdbcType=INTEGER} |
| | | </update> |
| | | |
| | | <!--根据ID删除--> |
| | | <delete id="delete"> |
| | | delete from t_mold_quality |
| | | where id=#{id} |
| | | </delete> |
| | | |
| | | <select id="findOneById" resultType="com.thhy.engineering.modules.biz.moldquality.entity.MoldQualityEntity"> |
| | | select |
| | | t.id, |
| | | t.mouldCode, |
| | | t.mouldNum, |
| | | t.blockNum, |
| | | t.size, |
| | | t.turn, |
| | | t.groutingHole, |
| | | t.content, |
| | | t.checkDate, |
| | | t.checkUnit, |
| | | t.createDate, |
| | | t.createUser, |
| | | t.companyId, |
| | | t.proId, |
| | | sp.pro_name proName |
| | | from t_mold_quality t |
| | | left join sys_project sp ON sp.pro_id = t.proId |
| | | where t.id=#{id} |
| | | </select> |
| | | |
| | | <select id="getMoldNum" resultType="java.util.Map"> |
| | | select |
| | | DISTINCT mould_num mouldNum |
| | | from sys_mould |
| | | where pro_id =#{proId,jdbcType=VARCHAR} |
| | | </select> |
| | | |
| | | <select id="getMoldCode" resultType="java.util.Map"> |
| | | select |
| | | DISTINCT mould_code mouldCode |
| | | from sys_mould |
| | | where 1=1 |
| | | <if test="proId != null and proId !=''"> |
| | | and pro_id = #{proId} |
| | | </if> |
| | | <if test="mouldNum != null and mouldNum !=''"> |
| | | and mould_num = #{mouldNum} |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | | <select id="getMoldByProIdAndModNumAndModCode" resultType="java.util.Map"> |
| | | select |
| | | sd1.dict_name as mouldTypeName, |
| | | sd2.dict_name as mouldSizeName, |
| | | sd3.dict_name as mouldTurnName, |
| | | sd4.dict_name as groutingHolesName |
| | | from sys_mould t |
| | | left join sys_dict sd1 on sd1.dict_id = t.mould_type |
| | | left join sys_dict sd2 on sd2.dict_id = t.mould_size |
| | | left join sys_dict sd3 on sd3.dict_id = t.mould_turn |
| | | left join sys_dict sd4 on sd4.dict_id = t.grouting_holes |
| | | WHERE t.is_use = 1 |
| | | <if test="mouldNum!=null and mouldNum!=''"> |
| | | and t.mould_num = #{mouldNum} |
| | | </if> |
| | | <if test="proId!=null and proId!=''"> |
| | | and t.pro_id = #{proId} |
| | | </if> |
| | | <if test="mouldCode!=null and mouldCode!=''"> |
| | | and t.mould_code = #{mouldCode} |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | |
| | | import com.thhy.materials.modules.biz.helmet.smoke.SmokeServer; |
| | | import org.mybatis.spring.annotation.MapperScan; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.boot.CommandLineRunner; |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | |
| | | @EnableScheduling |
| | | public class MaterialsApplication implements CommandLineRunner { |
| | | |
| | | @Value("${materialstcpport}") |
| | | private Integer tcpport; |
| | | |
| | | @Resource |
| | | private SmokeServer smokeServer; |
| | | |
| | |
| | | |
| | | @Override |
| | | public void run(String... args) throws Exception { |
| | | smokeServer.run(8973); |
| | | smokeServer.run(tcpport); |
| | | } |
| | | |
| | | } |
| | |
| | | /** |
| | | * 预埋件类型 字典 |
| | | */ |
| | | @Excel(sort = 3,title = "类型") |
| | | private String embedmentType; |
| | | @Excel(sort = 3,title = "类型") |
| | | private String dictName; |
| | | |
| | | /** |
| | |
| | | */ |
| | | private String createUser; |
| | | |
| | | @Excel(sort = 5,title = "备注") |
| | | private String remark; |
| | | |
| | | private String companyId; |
| | |
| | | * This field was generated by MyBatis Generator. |
| | | * This field corresponds to the database table sys_assist_good |
| | | * |
| | | * @mbg.generated Tue Apr 11 08:58:47 CST 2023 |
| | | * @mbg.generated Tue AembedmentInsetRecord/embedmentRecordListpr 11 08:58:47 CST 2023 |
| | | */ |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | |
| | | //预埋件名称 |
| | | private String embedmentName; |
| | | //预埋件规格 |
| | | @Excel(sort = 1,title = "规格型号") |
| | | private String embedmentModel; |
| | | |
| | | @Excel(sort = 1,title = "预埋件名称") |
| | | @Excel(sort = 0,title = "预埋件名称") |
| | | private String embedmentNameAndModel; |
| | | |
| | | public String getEmbedmentNameAndModel() { |
| | |
| | | /** |
| | | * 出库量/入库量 |
| | | */ |
| | | @Excel(sort = 2,title = "数量") |
| | | @Excel(sort = 2,title = "入库数量") |
| | | private Integer changeStock; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 入库时间 |
| | | */ |
| | | @Excel(sort = 6,title = "入库时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private String createTime; |
| | | |
| | |
| | | |
| | | import com.thhy.general.common.BasicResult; |
| | | import com.thhy.materials.modules.biz.helmet.service.HelmetService; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | public BasicResult helmetReportUser(@RequestBody Map<String,Object> values){ |
| | | return helmetService.helmetReportUser(values); |
| | | } |
| | | //烟尘数据 |
| | | @PostMapping("/dataSmockList") |
| | | public BasicResult dataSmockList(@RequestBody Map<String,Object> values){ |
| | | return helmetService.dataSmockList(values); |
| | | } |
| | | |
| | | //环境监测 |
| | | @PostMapping("/dataValuesList") |
| | | public BasicResult dataValuesList(@RequestBody Map<String,Object> values){ |
| | | return helmetService.dataValuesList(values); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | /** |
| | | * |
| | | */ |
| | | private String gatewayCyc; |
| | | private String time; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | private String fans; |
| | | private String i00; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | private String v1run; |
| | | private String i01; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | private String uv1run; |
| | | private String i02; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | private String fanrun; |
| | | private String i03; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | private String uv2run; |
| | | private String i04; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | private String ssvrun; |
| | | private String i05; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | private String dp; |
| | | private String i06; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | private String t; |
| | | private String i07; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | private String oc; |
| | | private String i10; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | private String gatew; |
| | | private String i11; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | private String nxrun; |
| | | private String q00; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | private String alarm; |
| | | private String q01; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | private String times; |
| | | private String q02; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | private String rtcVolt; |
| | | private String q03; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | private String v2run; |
| | | private String q04; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | private String dxqvrun; |
| | | private String q05; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | private String press; |
| | | private String vb0; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | private String dc; |
| | | private String vb10; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | private String vb11; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | private String vb12; |
| | | |
| | | /** |
| | | * This field was generated by MyBatis Generator. |
| | | * This field corresponds to the database table t_data_smock |
| | | * |
| | | * @mbg.generated Wed Oct 18 15:12:02 CST 2023 |
| | | * @mbg.generated Mon Oct 30 13:02:05 CST 2023 |
| | | */ |
| | | private static final long serialVersionUID = 1L; |
| | | } |
对比新文件 |
| | |
| | | package com.thhy.materials.modules.biz.helmet.entity; |
| | | |
| | | import lombok.Data; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | import lombok.ToString; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @Getter |
| | | @Setter |
| | | @ToString |
| | | public class TDataValue implements Serializable { |
| | | /** |
| | | * |
| | | */ |
| | | private Integer dataId; |
| | | |
| | | /** |
| | | * 设备编号 |
| | | */ |
| | | private Integer deviceId; |
| | | |
| | | /** |
| | | * 设备名称 |
| | | */ |
| | | private String deviceName; |
| | | |
| | | /** |
| | | * 账号 |
| | | */ |
| | | private String accountNumber; |
| | | |
| | | /** |
| | | * 上传时间 |
| | | */ |
| | | private String uploadTime; |
| | | |
| | | /** |
| | | * pm2.5 |
| | | */ |
| | | private String pm25; |
| | | |
| | | /** |
| | | * pm10 |
| | | */ |
| | | private String pm10; |
| | | |
| | | /** |
| | | * tsp |
| | | */ |
| | | private String tsp; |
| | | |
| | | /** |
| | | * 温度 |
| | | */ |
| | | private String temperature; |
| | | |
| | | /** |
| | | * 湿度 |
| | | */ |
| | | private String humidity; |
| | | |
| | | /** |
| | | * 数据6 |
| | | */ |
| | | private String data6; |
| | | |
| | | /** |
| | | * 风速 |
| | | */ |
| | | private String windSpeed; |
| | | |
| | | /** |
| | | * 风向 |
| | | */ |
| | | private String windDirection; |
| | | |
| | | /** |
| | | * tvoc |
| | | */ |
| | | private String tvoc; |
| | | |
| | | /** |
| | | * no2 |
| | | */ |
| | | private String no2; |
| | | |
| | | /** |
| | | * co |
| | | */ |
| | | private String co; |
| | | |
| | | /** |
| | | * so2 |
| | | */ |
| | | private String so2; |
| | | |
| | | /** |
| | | * o3 |
| | | */ |
| | | private String o3; |
| | | |
| | | |
| | | /** |
| | | * 噪音 |
| | | */ |
| | | private String noise; |
| | | |
| | | /** |
| | | * This field was generated by MyBatis Generator. |
| | | * This field corresponds to the database table t_data_value |
| | | * |
| | | * @mbg.generated Fri Oct 13 15:29:00 CST 2023 |
| | | */ |
| | | private static final long serialVersionUID = 1L; |
| | | } |
| | |
| | | |
| | | List<THelmetReport> helmetReportUser(Map<String, Object> values); |
| | | |
| | | void smockInsert(TDataSmock tDataSmock); |
| | | void smockIn(TDataSmock tDataSmock); |
| | | |
| | | List<TDataSmock> dataSmockList(Map<String, Object> values); |
| | | |
| | | List<TDataValue> dataValuesList(Map<String, Object> values); |
| | | } |
| | |
| | | |
| | | BasicResult helmetReportUser(Map<String, Object> values); |
| | | |
| | | void smockInsert(TDataSmock tDataSmock); |
| | | void smockIn(TDataSmock tDataSmock); |
| | | |
| | | BasicResult dataSmockList(Map<String, Object> values); |
| | | |
| | | BasicResult dataValuesList(Map<String, Object> values); |
| | | } |
| | |
| | | import com.thhy.materials.modules.biz.helmet.mapper.HelmetMapper; |
| | | import com.thhy.materials.modules.biz.helmet.service.HelmetService; |
| | | import org.springframework.stereotype.Service; |
| | | import sun.misc.Cache; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void smockInsert(TDataSmock tDataSmock) { |
| | | public void smockIn(TDataSmock tDataSmock) { |
| | | System.out.println("参数为---"+tDataSmock.toString()); |
| | | helmetMapper.smockInsert(tDataSmock); |
| | | helmetMapper.smockIn(tDataSmock); |
| | | } |
| | | |
| | | @Override |
| | | public BasicResult dataSmockList(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<TDataSmock> dataSmocks = helmetMapper.dataSmockList(values); |
| | | PageInfo<TDataSmock> tDataSmockPageInfo = new PageInfo<>(dataSmocks); |
| | | return BasicResult.success(tDataSmockPageInfo); |
| | | } |
| | | |
| | | @Override |
| | | public BasicResult dataValuesList(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<TDataValue> dataSmocks = helmetMapper.dataValuesList(values); |
| | | PageInfo<TDataValue> tDataValuePageInfo = new PageInfo<>(dataSmocks); |
| | | return BasicResult.success(tDataValuePageInfo); |
| | | } |
| | | } |
| | |
| | | package com.thhy.materials.modules.biz.helmet.smoke; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.thhy.materials.modules.biz.helmet.entity.TDataSmock; |
| | | import com.thhy.materials.modules.biz.helmet.mapper.HelmetMapper; |
| | | import com.thhy.materials.modules.biz.helmet.service.HelmetService; |
| | | import com.thhy.materials.modules.biz.utils.ApplicationContextUtil; |
| | | import io.netty.buffer.ByteBuf; |
| | |
| | | import io.netty.util.CharsetUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.ApplicationContext; |
| | | import org.springframework.context.ApplicationContextAware; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | @Component |
| | | public class SmokeMessage extends SimpleChannelInboundHandler<ByteBuf>{ |
| | |
| | | System.out.println("客户端接收到消息: " + in.toString(CharsetUtil.UTF_8)); |
| | | JSONObject jsonObject11 = JSONObject.parseObject(in.toString(CharsetUtil.UTF_8)); |
| | | System.out.println("客户端接收到消息: " + jsonObject11); |
| | | Object time = jsonObject11.get("time"); |
| | | String parems = jsonObject11.get("params").toString(); |
| | | JSONObject jsonObject = JSONObject.parseObject(parems); |
| | | System.out.println(time+"-------------"+jsonObject); |
| | | TDataSmock tDataSmock = new TDataSmock(); |
| | | tDataSmock.setGatewayCyc(jsonObject11.get("gateway_cyc").toString()); |
| | | tDataSmock.setFans(jsonObject11.get("FanS").toString()); |
| | | tDataSmock.setV1run(jsonObject11.get("V1Run").toString()); |
| | | tDataSmock.setUv1run(jsonObject11.get("UV1Run").toString()); |
| | | tDataSmock.setFanrun(jsonObject11.get("FanRun").toString()); |
| | | tDataSmock.setUv2run(jsonObject11.get("UV2Run").toString()); |
| | | tDataSmock.setSsvrun(jsonObject11.get("SSVRun").toString()); |
| | | tDataSmock.setDp(jsonObject11.get("DP").toString()); |
| | | tDataSmock.setT(jsonObject11.get("T").toString()); |
| | | tDataSmock.setOc(jsonObject11.get("OC").toString()); |
| | | tDataSmock.setGatew(jsonObject11.get("gatew").toString()); |
| | | tDataSmock.setNxrun(jsonObject11.get("NXRun").toString()); |
| | | tDataSmock.setTimes(jsonObject11.get("time").toString()); |
| | | tDataSmock.setRtcVolt(jsonObject11.get("RTC_VOLT").toString()); |
| | | tDataSmock.setV2run(jsonObject11.get("V2Run").toString()); |
| | | tDataSmock.setDxqvrun(jsonObject11.get("DXQVRun").toString()); |
| | | tDataSmock.setPress(jsonObject11.get("Press").toString()); |
| | | tDataSmock.setDc(jsonObject11.get("Dc").toString()); |
| | | System.out.println("-------"+tDataSmock); |
| | | getUserService().smockInsert(tDataSmock); |
| | | tDataSmock.setTime(time.toString()); |
| | | tDataSmock.setI00(jsonObject.get("I00").toString().equals("true")?"开启":"关闭"); |
| | | tDataSmock.setI01(jsonObject.get("I01").toString().equals("true")?"开启":"关闭"); |
| | | tDataSmock.setI02(jsonObject.get("I02").toString().equals("true")?"开启":"关闭"); |
| | | tDataSmock.setI03(jsonObject.get("I03").toString().equals("true")?"开启":"关闭"); |
| | | tDataSmock.setI04(jsonObject.get("I04").toString().equals("true")?"开启":"关闭"); |
| | | tDataSmock.setI05(jsonObject.get("I05").toString().equals("true")?"开启":"关闭"); |
| | | tDataSmock.setI06(jsonObject.get("I06").toString().equals("true")?"开启":"关闭"); |
| | | tDataSmock.setI07(jsonObject.get("I07").toString().equals("true")?"开启":"关闭"); |
| | | tDataSmock.setI10(jsonObject.get("I10").toString().equals("true")?"开启":"关闭"); |
| | | tDataSmock.setI11(jsonObject.get("I11").toString().equals("true")?"开启":"关闭"); |
| | | tDataSmock.setQ00(jsonObject.get("Q00").toString().equals("true")?"运行中":"停止状态"); |
| | | tDataSmock.setQ01(jsonObject.get("Q01").toString().equals("true")?"运行中":"停止状态"); |
| | | tDataSmock.setQ02(jsonObject.get("Q02").toString().equals("true")?"运行中":"停止状态"); |
| | | tDataSmock.setQ03(jsonObject.get("Q03").toString().equals("true")?"运行中":"停止状态"); |
| | | tDataSmock.setQ04(jsonObject.get("Q04").toString().equals("true")?"运行中":"停止状态"); |
| | | tDataSmock.setQ05(jsonObject.get("Q05").toString().equals("true")?"运行中":"停止状态"); |
| | | tDataSmock.setVb0(jsonObject.get("VB0").toString()); |
| | | tDataSmock.setVb10(jsonObject.get("VB10").toString()); |
| | | tDataSmock.setVb11(jsonObject.get("VB11").toString()); |
| | | tDataSmock.setVb12(jsonObject.get("VB12").toString()); |
| | | |
| | | // TDataSmock tDataSmock = new TDataSmock(); |
| | | // tDataSmock.setGatewayCyc(jsonObject11.get("gateway_cyc").toString()); |
| | | // tDataSmock.setFans(jsonObject11.get("FanS").toString()); |
| | | // tDataSmock.setV1run(jsonObject11.get("V1Run").toString()); |
| | | // tDataSmock.setUv1run(jsonObject11.get("UV1Run").toString()); |
| | | // tDataSmock.setFanrun(jsonObject11.get("FanRun").toString()); |
| | | // tDataSmock.setUv2run(jsonObject11.get("UV2Run").toString()); |
| | | // tDataSmock.setSsvrun(jsonObject11.get("SSVRun").toString()); |
| | | // tDataSmock.setDp(jsonObject11.get("DP").toString()); |
| | | // tDataSmock.setT(jsonObject11.get("T").toString()); |
| | | // tDataSmock.setOc(jsonObject11.get("OC").toString()); |
| | | // tDataSmock.setGatew(jsonObject11.get("gatew").toString()); |
| | | // tDataSmock.setNxrun(jsonObject11.get("NXRun").toString()); |
| | | // tDataSmock.setTimes(jsonObject11.get("time").toString()); |
| | | // tDataSmock.setRtcVolt(jsonObject11.get("RTC_VOLT").toString()); |
| | | // tDataSmock.setV2run(jsonObject11.get("V2Run").toString()); |
| | | // tDataSmock.setDxqvrun(jsonObject11.get("DXQVRun").toString()); |
| | | // tDataSmock.setPress(jsonObject11.get("Press").toString()); |
| | | // tDataSmock.setDc(jsonObject11.get("Dc").toString()); |
| | | // System.out.println("-------"+tDataSmock); |
| | | getUserService().smockIn(tDataSmock); |
| | | } |
| | | @Override |
| | | public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) { |
| | |
| | | order by sm_time desc |
| | | </select> |
| | | |
| | | <insert id="smockInsert" > |
| | | <insert id="smockIn" > |
| | | insert into t_data_smock |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="smokeId != null"> |
| | | smoke_id, |
| | | </if> |
| | | <if test="gatewayCyc != null"> |
| | | gateway_cyc, |
| | | <if test="time != null"> |
| | | time, |
| | | </if> |
| | | <if test="fans != null"> |
| | | FanS, |
| | | <if test="i00 != null"> |
| | | I00, |
| | | </if> |
| | | <if test="v1run != null"> |
| | | V1Run, |
| | | <if test="i01 != null"> |
| | | I01, |
| | | </if> |
| | | <if test="uv1run != null"> |
| | | UV1Run, |
| | | <if test="i02 != null"> |
| | | I02, |
| | | </if> |
| | | <if test="fanrun != null"> |
| | | FanRun, |
| | | <if test="i03 != null"> |
| | | I03, |
| | | </if> |
| | | <if test="uv2run != null"> |
| | | UV2Run, |
| | | <if test="i04 != null"> |
| | | I04, |
| | | </if> |
| | | <if test="ssvrun != null"> |
| | | SSVRun, |
| | | <if test="i05 != null"> |
| | | I05, |
| | | </if> |
| | | <if test="dp != null"> |
| | | DP, |
| | | <if test="i06 != null"> |
| | | I06, |
| | | </if> |
| | | <if test="t != null"> |
| | | T, |
| | | <if test="i07 != null"> |
| | | I07, |
| | | </if> |
| | | <if test="oc != null"> |
| | | OC, |
| | | <if test="i10 != null"> |
| | | I10, |
| | | </if> |
| | | <if test="gatew != null"> |
| | | gatew, |
| | | <if test="i11 != null"> |
| | | I11, |
| | | </if> |
| | | <if test="nxrun != null"> |
| | | NXRun, |
| | | <if test="q00 != null"> |
| | | Q00, |
| | | </if> |
| | | <if test="alarm != null"> |
| | | Alarm, |
| | | <if test="q01 != null"> |
| | | Q01, |
| | | </if> |
| | | <if test="times != null"> |
| | | times, |
| | | <if test="q02 != null"> |
| | | Q02, |
| | | </if> |
| | | <if test="rtcVolt != null"> |
| | | RTC_VOLT, |
| | | <if test="q03 != null"> |
| | | Q03, |
| | | </if> |
| | | <if test="v2run != null"> |
| | | V2Run, |
| | | <if test="q04 != null"> |
| | | Q04, |
| | | </if> |
| | | <if test="dxqvrun != null"> |
| | | DXQVRun, |
| | | <if test="q05 != null"> |
| | | Q05, |
| | | </if> |
| | | <if test="press != null"> |
| | | Press, |
| | | <if test="vb0 != null"> |
| | | VB0, |
| | | </if> |
| | | <if test="dc != null"> |
| | | Dc, |
| | | <if test="vb10 != null"> |
| | | VB10, |
| | | </if> |
| | | <if test="vb11 != null"> |
| | | VB11, |
| | | </if> |
| | | <if test="vb12 != null"> |
| | | VB12, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="smokeId != null"> |
| | | #{smokeId,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="gatewayCyc != null"> |
| | | #{gatewayCyc,jdbcType=VARCHAR}, |
| | | <if test="time != null"> |
| | | #{time,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="fans != null"> |
| | | #{fans,jdbcType=VARCHAR}, |
| | | <if test="i00 != null"> |
| | | #{i00,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="v1run != null"> |
| | | #{v1run,jdbcType=VARCHAR}, |
| | | <if test="i01 != null"> |
| | | #{i01,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="uv1run != null"> |
| | | #{uv1run,jdbcType=VARCHAR}, |
| | | <if test="i02 != null"> |
| | | #{i02,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="fanrun != null"> |
| | | #{fanrun,jdbcType=VARCHAR}, |
| | | <if test="i03 != null"> |
| | | #{i03,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="uv2run != null"> |
| | | #{uv2run,jdbcType=VARCHAR}, |
| | | <if test="i04 != null"> |
| | | #{i04,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="ssvrun != null"> |
| | | #{ssvrun,jdbcType=VARCHAR}, |
| | | <if test="i05 != null"> |
| | | #{i05,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="dp != null"> |
| | | #{dp,jdbcType=VARCHAR}, |
| | | <if test="i06 != null"> |
| | | #{i06,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="t != null"> |
| | | #{t,jdbcType=VARCHAR}, |
| | | <if test="i07 != null"> |
| | | #{i07,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="oc != null"> |
| | | #{oc,jdbcType=VARCHAR}, |
| | | <if test="i10 != null"> |
| | | #{i10,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="gatew != null"> |
| | | #{gatew,jdbcType=VARCHAR}, |
| | | <if test="i11 != null"> |
| | | #{i11,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="nxrun != null"> |
| | | #{nxrun,jdbcType=VARCHAR}, |
| | | <if test="q00 != null"> |
| | | #{q00,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="alarm != null"> |
| | | #{alarm,jdbcType=VARCHAR}, |
| | | <if test="q01 != null"> |
| | | #{q01,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="times != null"> |
| | | #{times,jdbcType=VARCHAR}, |
| | | <if test="q02 != null"> |
| | | #{q02,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="rtcVolt != null"> |
| | | #{rtcVolt,jdbcType=VARCHAR}, |
| | | <if test="q03 != null"> |
| | | #{q03,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="v2run != null"> |
| | | #{v2run,jdbcType=VARCHAR}, |
| | | <if test="q04 != null"> |
| | | #{q04,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="dxqvrun != null"> |
| | | #{dxqvrun,jdbcType=VARCHAR}, |
| | | <if test="q05 != null"> |
| | | #{q05,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="press != null"> |
| | | #{press,jdbcType=VARCHAR}, |
| | | <if test="vb0 != null"> |
| | | #{vb0,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="dc != null"> |
| | | #{dc,jdbcType=VARCHAR}, |
| | | <if test="vb10 != null"> |
| | | #{vb10,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="vb11 != null"> |
| | | #{vb11,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="vb12 != null"> |
| | | #{vb12,jdbcType=VARCHAR}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <select id="dataSmockList" resultType="com.thhy.materials.modules.biz.helmet.entity.TDataSmock"> |
| | | select |
| | | smoke_id as smokeId, |
| | | gateway_cyc as gatewayCyc, |
| | | FanS as fans, |
| | | V1Run as v1run, |
| | | UV1Run as uv1run, |
| | | FanRun as fanrun, |
| | | UV2Run as uv2run, |
| | | SSVRun as ssvrun, |
| | | DP as dp, |
| | | T as t, |
| | | OC as oc, |
| | | gatew as gatew, |
| | | NXRun as nxrun, |
| | | Alarm as alarm, |
| | | times as times, |
| | | RTC_VOLT as rtcVolt, |
| | | V2Run as v2run, |
| | | DXQVRun as dxqvrun, |
| | | Press as press, |
| | | Dc as dc |
| | | from t_data_smock |
| | | where 1=1 |
| | | <if test="strTime!=null and endTime!=null and strTime!='' and endTime!='' "> |
| | | and times between #{strTime} and #{endTime} |
| | | </if> |
| | | order by times desc |
| | | </select> |
| | | <select id="dataValuesList" resultType="com.thhy.materials.modules.biz.helmet.entity.TDataValue"> |
| | | select |
| | | data_id as dataId, |
| | | device_id as deviceId, |
| | | device_name as deviceName, |
| | | account_number as accountNumber, |
| | | upload_time as uploadTime, |
| | | pm25 as pm25, |
| | | pm10 as pm10, |
| | | tsp as tsp, |
| | | temperature as temperature, |
| | | humidity as humidity, |
| | | data6 as data6, |
| | | wind_speed as windSpeed, |
| | | wind_direction as windDirection, |
| | | tvoc as tvoc, |
| | | no2 as no2, |
| | | co as co, |
| | | so2 as so2, |
| | | o3 as o3, |
| | | noise as noise |
| | | from t_data_value |
| | | where 1=1 |
| | | <if test="strTime!=null and strTime!='' and endTime!=null and endTime!='' "> |
| | | and upload_time between #{strTime} and #{endTime} |
| | | </if> |
| | | order by upload_time desc |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | import cistern from './module/cistern.js'; // 管片入池 |
| | | import putbank from './module/putbank.js'; // 管片入库 |
| | | import exit from './module/exit.js'; // 管片出库 |
| | | import spot from './module/spot.js'; // 点检 |
| | | |
| | | export default { |
| | | system, |
| | |
| | | ductpiece, |
| | | cistern, |
| | | putbank, |
| | | exit |
| | | exit, |
| | | spot |
| | | }; |
| | |
| | | function Request() {} |
| | | // export const basrUrl = 'https://pipe.thhy-tj.com/api'; |
| | | // export const basrUrl = 'http://192.168.0.170:8880'; |
| | | export const basrUrl = 'http://111.30.93.212:8880'; |
| | | export const basrUrl = 'http://111.30.93.212:8089/suapi'; |
| | | Request.prototype = { |
| | | post: function(url, params) { |
| | | return new Promise(function(resolve, reject) { |
对比新文件 |
| | |
| | | import axios from '../http.js'; |
| | | |
| | | export default { |
| | | /** |
| | | * 点检接口 |
| | | */ |
| | | |
| | | // 查询字典信息 |
| | | searchDictionary: params => { |
| | | return axios({ |
| | | url: '/engineering/dict/dictList', |
| | | method: 'post', |
| | | ...params, |
| | | header: { |
| | | pageNum: params.pageNum, |
| | | pageSize: params.pageSize |
| | | } |
| | | }) |
| | | }, |
| | | // 查询设备点检列表信息 |
| | | searchSpotCheckList: (params) => |
| | | axios({ |
| | | method: 'post', |
| | | url: '/m/checkDevice/findList', |
| | | ...params, |
| | | header: { |
| | | pageNum: params.pageNum, |
| | | pageSize: params.pageSize |
| | | } |
| | | }), |
| | | // 添加设备点检信息 |
| | | insertSpotCheckInfo: (params) => |
| | | axios.post('m/checkDevice/addCheckDevice', params), |
| | | // 修改设备点检信息 |
| | | updateSpotCheckInfo: (params) => |
| | | axios.post('m/checkDevice/addCheckDevice', params), |
| | | //删除设备点检信息 |
| | | deleteSpotCheckInfo: (params) => |
| | | axios.post('/m/checkDevice/delete', params), |
| | | // 获取点检详情 |
| | | getSpotCheckDetail: (params) => |
| | | axios.post('m/checkDevice/checkDeviceInfo', params), |
| | | // 获取全部设备信息 |
| | | getAllDeviceData: () => |
| | | axios.post('/m/checkDevice/deviceList'), |
| | | } |
| | |
| | | */ |
| | | // 登录 |
| | | userLogin: params => |
| | | axios.post(`/m/login`, params), |
| | | axios.post(`/usercore/login`, params), |
| | | // 退出登录 |
| | | logingOut: params => |
| | | axios.post('/usercore/login/logout', params), |
| | |
| | | { |
| | | "name" : "智慧管片", |
| | | "appid" : "__UNI__EBC4C2D", |
| | | "appid" : "__UNI__D1E1AF0", |
| | | "description" : "", |
| | | "versionName" : "1.1.1", |
| | | "versionCode" : 111, |
| | |
| | | "navigationBarTextStyle": "white", |
| | | "navigationBarTitleText": "管片出库" |
| | | } |
| | | },{ |
| | | "path": "pages/spotCheck/index", |
| | | "style": { |
| | | "navigationStyle": "custom", |
| | | "navigationBarTextStyle": "white" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/spotCheck/spotDetail", |
| | | "style": { |
| | | "navigationBarBackgroundColor": "#1976FF", |
| | | "navigationBarTextStyle": "white", |
| | | "navigationBarTitleText": "点检详情" |
| | | } |
| | | },{ |
| | | "path": "pages/spotCheck/deviceSpot", |
| | | "style": { |
| | | "navigationBarBackgroundColor": "#1976FF", |
| | | "navigationBarTextStyle": "white", |
| | | "navigationBarTitleText": "设备点检" |
| | | } |
| | | } |
| | | ], |
| | | "globalStyle": { |
对比新文件 |
| | |
| | | <template> |
| | | <view class="device_spot"> |
| | | <view class="header_semicircle"></view> |
| | | <view class="device_spot_content"> |
| | | <view class="device_item"> |
| | | <view class="device_item_title"> |
| | | <span>HSHS-001</span> |
| | | </view> |
| | | <view class="device_item_value"> |
| | | <span class="label">设备名称:</span> |
| | | <span>混凝土搅拌机</span> |
| | | </view> |
| | | <view class="device_item_value"> |
| | | <span class="label">型号规格:</span> |
| | | <span>混凝土搅拌机</span> |
| | | </view> |
| | | <view class="device_item_value"> |
| | | <span class="label">设备类型:</span> |
| | | <span>混凝土搅拌机</span> |
| | | </view> |
| | | </view> |
| | | <view class="device_form"> |
| | | <u-form |
| | | ref="form" |
| | | labelWidth="auto" |
| | | :model="formSpot" |
| | | :rules="rulesSpot"> |
| | | <u-form-item |
| | | labelPosition="left" |
| | | label="点检时间" |
| | | prop="checkTime" |
| | | borderBottom |
| | | @click="ckickTime()"> |
| | | <u-input |
| | | v-model="formSpot.checkTime" |
| | | border="none" |
| | | placeholder="请选择点检时间" |
| | | disabled |
| | | disabledColor="#FFFFFF" |
| | | inputAlign="right"> |
| | | </u-input> |
| | | <u-icon |
| | | slot="right" |
| | | name="calendar" |
| | | ></u-icon> |
| | | </u-form-item> |
| | | <u-form-item |
| | | labelPosition="left" |
| | | label="点检类型" |
| | | prop="checkTypeName" |
| | | borderBottom |
| | | @click="clickCheckType()"> |
| | | <u-input |
| | | v-model="formSpot.checkTypeName" |
| | | border="none" |
| | | placeholder="请选择点检类型" |
| | | disabled |
| | | disabledColor="#FFFFFF" |
| | | inputAlign="right"> |
| | | </u-input> |
| | | <u-icon |
| | | slot="right" |
| | | name="arrow-right" |
| | | ></u-icon> |
| | | </u-form-item> |
| | | <u-form-item label="点检内容及结果" labelPosition="top" prop="checkContent"> |
| | | <view style="margin: 5px 0; width: 100%;"> |
| | | <u-textarea |
| | | v-model="formSpot.checkContent" |
| | | height="100" |
| | | border="surround" |
| | | placeholder="请输入点检内容及结果"> |
| | | </u-textarea> |
| | | </view> |
| | | </u-form-item> |
| | | <u-form-item label="上传照片" labelPosition="top" prop="checkContent"> |
| | | <view style="margin: 5px 0; width: 100%;"> |
| | | <u-upload |
| | | :fileList="fileList" |
| | | name="1" |
| | | accept="image" |
| | | uploadIcon="plus" |
| | | @afterRead="afterRead" |
| | | @delete="deleteImage" |
| | | ></u-upload> |
| | | </view> |
| | | </u-form-item> |
| | | <view class="login_content_button"> |
| | | <u-button |
| | | type="primary" |
| | | :color="colorStyle" |
| | | @click="submitForm()">提交</u-button> |
| | | </view> |
| | | </u-form> |
| | | </view> |
| | | </view> |
| | | <u-datetime-picker |
| | | :show="showTime" |
| | | v-model="defaultTime" |
| | | mode="datetime" |
| | | @cancel="cancelTime" |
| | | @confirm="confirmTime"> |
| | | </u-datetime-picker> |
| | | <u-picker |
| | | :show="showCheckType" |
| | | :columns="checkTypeData" |
| | | keyName="dictName" |
| | | closeOnClickOverlay |
| | | @cancel="cancelCheckType()" |
| | | @confirm="confirmCheckType()" |
| | | @close="showCheckType = false" |
| | | ></u-picker> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | import baseUrl from '../../api/http.js'; |
| | | import { changeTime, throttle } from '../../plugins/public.js'; |
| | | export default { |
| | | data() { |
| | | return { |
| | | formSpot: { |
| | | checkTime: '', |
| | | checkTypeName: '', |
| | | }, |
| | | rulesSpot: { |
| | | checkTime: [{ |
| | | required: true, |
| | | message: '请选择点检时间', |
| | | trigger: 'blur', |
| | | }], |
| | | checkTypeName: [{ |
| | | required: true, |
| | | message: '请选择点检类型', |
| | | trigger: 'blur', |
| | | }], |
| | | checkContent: [{ |
| | | required: true, |
| | | message: '请输入点检内容及结果', |
| | | trigger: 'blur', |
| | | }] |
| | | }, |
| | | fileList: [], |
| | | colorStyle: 'linear-gradient(to right, rgb(79, 142, 244), rgb(85, 109, 254))', |
| | | showTime: false, |
| | | defaultTime: Number(new Date()), |
| | | deviceId: '' |
| | | } |
| | | }, |
| | | onReady() { |
| | | this.$refs.form.setRules(this.rulesSpot); |
| | | }, |
| | | onLoad(option) { |
| | | this.deviceId = option.deviceId; |
| | | this.getChackAllTypes(); |
| | | }, |
| | | methods: { |
| | | // 获取点检类型 |
| | | async getChackAllTypes(){ |
| | | const { data } = await this.$api.spot.searchDictionary({ |
| | | pageNum: 1, |
| | | pageSize: 100000000, |
| | | dictType: 'check_type' |
| | | }); |
| | | this.checkTypeData = data.list; |
| | | }, |
| | | // 读取图片后 |
| | | afterRead(event) { |
| | | console.log(event); |
| | | this.fileList.push({ |
| | | status: 'loading', |
| | | message: '上传中', |
| | | }) |
| | | uni.uploadFile({ |
| | | url: `${baseUrl}/file/file/upload`, |
| | | fileType: 'image', |
| | | filePath: event.file.url, |
| | | name: 'file', |
| | | success: (res) => { |
| | | const data = JSON.parse(res.data); |
| | | this.$set(this.fileList, this.fileList.length - 1, { |
| | | id: this.fileList.length + 1, |
| | | status: 'success', |
| | | message: '', |
| | | data: data.data, |
| | | url: `http://filemanage.thhy-tj.com:8888/${data.data}` |
| | | }) |
| | | }, |
| | | fail: (error) => { |
| | | uni.$u.toast('上传失败!'); |
| | | } |
| | | }) |
| | | }, |
| | | // 删除图片 |
| | | deleteImage(event) { |
| | | this.fileList.splice(event.index, 1); |
| | | }, |
| | | // 选择时间 |
| | | ckickTime() { |
| | | this.showTime = true; |
| | | this.$set(this.formSpot, 'checkTime', ''); |
| | | }, |
| | | // 点击取消选择时间 |
| | | cancelTime() { |
| | | this.showTime = false; |
| | | this.$set(this.formSpot, 'checkTime', ''); |
| | | }, |
| | | // 点击选择时间 |
| | | confirmTime({ value }) { |
| | | this.$set(this.formSpot, 'checkTime', changeTime(value)); |
| | | this.showTime = false; |
| | | }, |
| | | // 选择点检类型 |
| | | clickCheckType() { |
| | | this.showCheckType = true; |
| | | this.$set(this.formSpot, 'checkTypeName', ''); |
| | | this.$set(this.formSpot, 'checkType', ''); |
| | | }, |
| | | // 点击取消选择时间 |
| | | cancelCheckType() { |
| | | this.showCheckType = false; |
| | | this.$set(this.formSpot, 'checkTypeName', ''); |
| | | this.$set(this.formSpot, 'checkType', ''); |
| | | }, |
| | | // 点击选择点检类型 |
| | | confirmCheckType({ value }) { |
| | | this.showCheckType = false; |
| | | this.$set(this.formSpot, 'checkTypeName', value[0].checkTypeName); |
| | | this.$set(this.formSpot, 'checkType', value[0].checkType); |
| | | }, |
| | | // 提交点检信息 |
| | | submitForm: throttle(function() { |
| | | this.$refs.form.validate().then((valid) => { |
| | | if(valid) { |
| | | const params = Object.assign({}, this.formSpot); |
| | | delete params.checkTypeName; |
| | | params.deviceId = this.deviceId; |
| | | if(this.fileList.length > 0) { |
| | | params.fileList = this.fileList.map(item => { |
| | | return { |
| | | file: item.data |
| | | } |
| | | }) |
| | | } |
| | | this.$api.spot.insertSpotCheckInfo(params).then(res => { |
| | | if(res.success) { |
| | | uni.$u.toast('添加成功!'); |
| | | setTimeout(() => { |
| | | uni.navigateBack(); |
| | | }, 1500) |
| | | } else { |
| | | uni.$u.toast(res.statusMsg); |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | }, 3000), |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .device_spot { |
| | | position: relative; |
| | | width: 100%; |
| | | height: 100vh; |
| | | background: rgba(246, 246, 246, 1); |
| | | |
| | | .header_semicircle { |
| | | width: 100%; |
| | | height: 100px; |
| | | background: #1977FF; |
| | | border-radius: 0 0 50% 50%; |
| | | } |
| | | |
| | | .device_spot_content { |
| | | position: absolute; |
| | | top: 10px; |
| | | left: 50%; |
| | | transform: translateX(-50%); |
| | | display: flex; |
| | | flex-direction: column; |
| | | padding: 15px; |
| | | width: calc(100% - 60px); |
| | | height: calc(100% - 40px); |
| | | background: #FFFFFF; |
| | | border-radius: 6px; |
| | | overflow-y: auto; |
| | | box-shadow: 0px 0px 6px 0px rgba(0,0,0,0.04); |
| | | |
| | | .device_item { |
| | | display: flex; |
| | | flex-direction: column; |
| | | justify-content: space-around; |
| | | padding: 10px 15px; |
| | | // height: 280px; |
| | | background: #F6FAFF; |
| | | border-radius: 4px; |
| | | border-top: 3px solid rgba(25, 119, 255, 1); |
| | | |
| | | .device_item_title { |
| | | position: relative; |
| | | padding: 0 10px; |
| | | margin: 5px 0; |
| | | color: rgba(25, 119, 255, 1); |
| | | font-size: 18px; |
| | | |
| | | &:before { |
| | | content: ""; |
| | | position: absolute; |
| | | top: 50%; |
| | | left: 0%; |
| | | transform: translateY(-50%); |
| | | width: 3px; |
| | | height: 80%; |
| | | background-color: rgba(25, 119, 255, 1); |
| | | } |
| | | } |
| | | |
| | | .device_item_value { |
| | | margin: 5px 0; |
| | | } |
| | | |
| | | .label { |
| | | display: inline-block; |
| | | color: #999999; |
| | | white-space: nowrap; |
| | | } |
| | | |
| | | .value { |
| | | color: #1977FF; |
| | | } |
| | | } |
| | | |
| | | .device_form { |
| | | // margin-top: 20px; |
| | | } |
| | | } |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <view class="spot_index"> |
| | | <u-navbar |
| | | title="点检列表" |
| | | bgColor="#1977FF" |
| | | :autoBack="true" |
| | | :placeholder="true" |
| | | leftIconColor="#FFFFFF" |
| | | :titleStyle="{ |
| | | color: '#FFFFFF' |
| | | }"> |
| | | <view slot="right"> |
| | | <span @click="scanDevice()">点检</span> |
| | | </view> |
| | | </u-navbar> |
| | | <view class="header_semicircle"></view> |
| | | <scroll-view class="spot_content" :scroll-top="scrollTop" refresher-enabled="true" scroll-y="true" refresher-background="#EAEAEA" |
| | | @scrolltolower="scrolltoLower" :refresher-triggered="triggered" @refresherrefresh="refresherrefresh"> |
| | | <view |
| | | class="spot_item" |
| | | v-for="item in spotList" |
| | | :key="item.id" |
| | | @click="navgetToDetail(item)"> |
| | | <view class="spot_item_title"> |
| | | <span>设备编号:{{item.bigNumber}}</span> |
| | | <span>详情</span> |
| | | </view> |
| | | <view class="spot_item_content"> |
| | | <view class=""> |
| | | <span class="label">设备名称:</span> |
| | | <span>{{item.bigDeviceName}}</span> |
| | | </view> |
| | | <view class=""> |
| | | <span class="label">型号规格:</span> |
| | | <span>{{item.bigDeviceModel}}</span> |
| | | </view> |
| | | <view class=""> |
| | | <span class="label">设备类型:</span> |
| | | <span>{{item.bigTypeStr}}</span> |
| | | </view> |
| | | <view class=""> |
| | | <span class="label">点检时间:</span> |
| | | <span class="value">{{item.checkTime}}</span> |
| | | </view> |
| | | <view class=""> |
| | | <span class="label">责任人:</span> |
| | | <span>{{item.adminUserName}}</span> |
| | | </view> |
| | | <view class=""> |
| | | <span class="label">责任人电话:</span> |
| | | <span>{{item.adminUserPhone}}</span> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <u-loadmore :status="status" :icon-type="iconType" :load-text="loadText" /> |
| | | </scroll-view> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | import { throttle } from '../../plugins/public'; |
| | | export default { |
| | | data() { |
| | | return { |
| | | scrollTop: 0, |
| | | triggered: true, |
| | | status: 'loading', |
| | | iconType: 'flower', |
| | | loadText: { |
| | | loading: '努力加载中', |
| | | nomore: '没有更多数据了' |
| | | }, |
| | | showState: false, |
| | | columnData: [[{ |
| | | label: '未匹配', |
| | | id: 1 |
| | | },{ |
| | | label: '匹配成功入模', |
| | | id: 2 |
| | | },{ |
| | | label: '匹配失败无法入模', |
| | | id: 3 |
| | | }]], |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | loadPage: '', |
| | | spotList: [{id: 1}, {id: 2}, {id: 3}], |
| | | } |
| | | }, |
| | | onShow() { |
| | | this.searchData(); |
| | | }, |
| | | methods: { |
| | | // 查询模具质检列表 |
| | | async searchSpotCheckList() { |
| | | const { data } = await this.$api.spot.searchSpotCheckList({ |
| | | pageNum: this.pageNum, |
| | | pageSize: this.pageSize |
| | | }) |
| | | return data; |
| | | }, |
| | | // 查询信息 |
| | | searchData() { |
| | | this.triggered = true; |
| | | this.spotList = []; |
| | | this.searchSpotCheckList().then(data => { |
| | | this.spotList = data.list; |
| | | this.loadPage = data.pages; |
| | | this.triggered = false; |
| | | this.status = 'nomore'; |
| | | }).catch(() => { |
| | | this.triggered = false; |
| | | this.status = 'nomore'; |
| | | uni.$u.toast('没有更数据了'); |
| | | }) |
| | | }, |
| | | //自定义下拉刷新 |
| | | refresherrefresh: throttle(function() { |
| | | this.status = 'loading'; |
| | | this.pageNum = 1; |
| | | this.searchData(); |
| | | uni.$u.toast('刷新成功'); |
| | | }, 500), |
| | | //触底刷新 |
| | | scrolltoLower: throttle(function() { |
| | | this.status = 'loading'; |
| | | if(this.pageNum >= this.loadPage) { |
| | | setTimeout(() => { |
| | | this.status = 'nomore' |
| | | uni.$u.toast('没有更多数据了'); |
| | | },1000) |
| | | return |
| | | } else { |
| | | this.pageNum += 1; |
| | | this.searchSpotCheckList().then((data) => { |
| | | this.loadPage = data.pages; |
| | | this.spotList.push(...data.list); |
| | | this.status = 'nomore'; |
| | | }) |
| | | } |
| | | }, 3000), |
| | | // 点检 |
| | | scanDevice() { |
| | | const that = this; |
| | | uni.$off('scancodedate'); |
| | | uni.$on('scancodedate', function(data) { |
| | | console.log(data.code); |
| | | if(data.code) { |
| | | uni.navigateTo({ |
| | | url: './deviceSpot' |
| | | }) |
| | | } |
| | | // that.$api.spot.scanCheckMould({ |
| | | // mouldNum: data.code |
| | | // }).then((res) => { |
| | | // if(res.success) { |
| | | // uni.$u.toast('扫描完成!'); |
| | | // console.log(res,'==='); |
| | | // } else { |
| | | // uni.$u.toast(res.statusMsg); |
| | | // } |
| | | // }) |
| | | uni.$off('scancodedate'); |
| | | }) |
| | | }, |
| | | // 跳转详情 |
| | | navgetToDetail(item) { |
| | | uni.navigateTo({ |
| | | url: './spotDetail?id=' + item.id |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .spot_index { |
| | | position: relative; |
| | | width: 100%; |
| | | height: 100vh; |
| | | background: rgba(246, 246, 246, 1); |
| | | |
| | | .header_semicircle { |
| | | width: 100%; |
| | | height: 100px; |
| | | background: #1977FF; |
| | | border-radius: 0 0 50% 50%; |
| | | } |
| | | |
| | | .spot_content { |
| | | position: absolute; |
| | | top: 70px; |
| | | left: 50%; |
| | | transform: translateX(-50%); |
| | | display: flex; |
| | | flex-direction: column; |
| | | width: calc(100% - 30px); |
| | | height: calc(100% - 70px); |
| | | |
| | | .spot_item { |
| | | padding: 10px; |
| | | margin: 12px 0; |
| | | // width: 100%; |
| | | height: 250px; |
| | | background: #FFFFFF; |
| | | border-radius: 6px; |
| | | box-shadow: 0px 0px 6px 0px rgba(0,0,0,0.04); |
| | | |
| | | &:first-child { |
| | | margin-top: 0; |
| | | } |
| | | |
| | | .spot_item_title { |
| | | position: relative; |
| | | padding: 0 10px; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | color: rgba(25, 119, 255, 1); |
| | | font-size: 16px; |
| | | |
| | | &:before { |
| | | content: ''; |
| | | position: absolute; |
| | | top: 50%; |
| | | left: 0; |
| | | transform: translateY(-50%); |
| | | width: 3px; |
| | | height: 80%; |
| | | background-color: rgba(25, 119, 255, 1); |
| | | } |
| | | } |
| | | |
| | | .spot_item_content { |
| | | display: flex; |
| | | flex-direction: column; |
| | | justify-content: space-around; |
| | | padding: 10px; |
| | | margin-top: 10px; |
| | | height: calc(90% - 30px); |
| | | background: rgba(25,119,255,0.04); |
| | | |
| | | .label { |
| | | display: inline-block; |
| | | width: 100px; |
| | | color: #999999; |
| | | } |
| | | |
| | | .value { |
| | | color: #1977FF; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <view class="spot_detail"> |
| | | <u-form |
| | | ref="form" |
| | | labelWidth="auto" |
| | | :model="formData" |
| | | :labelStyle="{ |
| | | color: '#999999' |
| | | }"> |
| | | <u-form-item labelPosition="left" label="设备编号" borderBottom> |
| | | <u-input |
| | | v-model="formData.bigDeviceModel" |
| | | border="none" |
| | | disabled |
| | | disabledColor="#FFFFFF" |
| | | inputAlign="right"> |
| | | </u-input> |
| | | </u-form-item> |
| | | <u-form-item labelPosition="left" label="设备名称" borderBottom> |
| | | <u-input |
| | | v-model="formData.bigDeviceName" |
| | | border="none" |
| | | disabled |
| | | disabledColor="#FFFFFF" |
| | | inputAlign="right"> |
| | | </u-input> |
| | | </u-form-item> |
| | | <u-form-item labelPosition="left" label="型号规格" borderBottom> |
| | | <u-input |
| | | v-model="formData.bigDeviceModel" |
| | | border="none" |
| | | disabled |
| | | disabledColor="#FFFFFF" |
| | | inputAlign="right"> |
| | | </u-input> |
| | | </u-form-item> |
| | | <u-form-item labelPosition="left" label="设备类型" borderBottom> |
| | | <u-input |
| | | v-model="formData.bigTypeStr" |
| | | border="none" |
| | | disabled |
| | | disabledColor="#FFFFFF" |
| | | inputAlign="right"> |
| | | </u-input> |
| | | </u-form-item> |
| | | <u-form-item labelPosition="left" label="点检时间" borderBottom> |
| | | <u-input |
| | | v-model="formData.checkTime" |
| | | border="none" |
| | | disabled |
| | | disabledColor="#FFFFFF" |
| | | inputAlign="right"> |
| | | </u-input> |
| | | </u-form-item> |
| | | <u-form-item labelPosition="left" label="责任人" borderBottom> |
| | | <u-input |
| | | v-model="formData.adminUserName" |
| | | border="none" |
| | | disabled |
| | | disabledColor="#FFFFFF" |
| | | inputAlign="right"> |
| | | </u-input> |
| | | </u-form-item> |
| | | <u-form-item labelPosition="left" label="责任人电话" borderBottom> |
| | | <u-input |
| | | v-model="formData.adminUserPhone" |
| | | border="none" |
| | | disabled |
| | | disabledColor="#FFFFFF" |
| | | inputAlign="right"> |
| | | </u-input> |
| | | </u-form-item> |
| | | <u-form-item labelPosition="left" label="点检类型" borderBottom> |
| | | <u-input |
| | | v-model="formData.checkType" |
| | | border="none" |
| | | disabled |
| | | disabledColor="#FFFFFF" |
| | | inputAlign="right"> |
| | | </u-input> |
| | | </u-form-item> |
| | | <u-form-item labelPosition="top" label="点检内容及结果" borderBottom> |
| | | <u-input |
| | | v-model="formData.checkContent" |
| | | border="none" |
| | | disabled |
| | | disabledColor="#FFFFFF" |
| | | inputAlign="left"> |
| | | </u-input> |
| | | </u-form-item> |
| | | <u-form-item labelPosition="top" label="上传照片" borderBottom> |
| | | <view style="margin: 5px 0; width: 100%; display: flex;"> |
| | | <u-image |
| | | v-for="item in formData.fileList" |
| | | :key="item.id" |
| | | :src="`http://filemanage.thhy-tj.com:8888${item.file}`" |
| | | width="100px" |
| | | height="100px" |
| | | radius="4"> |
| | | </u-image> |
| | | </view> |
| | | </u-form-item> |
| | | </u-form> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | formData: {}, |
| | | } |
| | | }, |
| | | onLoad(option) { |
| | | console.log(option,'=='); |
| | | this.$api.spot.getSpotCheckDetail({ |
| | | id: option.id |
| | | }).then((res) => { |
| | | this.formData = res.success ? res.data : {}; |
| | | }) |
| | | }, |
| | | methods: { |
| | | |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .spot_detail { |
| | | padding: 15px; |
| | | } |
| | | </style> |
| | |
| | | # VUE_APP_BASE_URL = 'https://logadd.com:8443/pipe' |
| | | # VUE_APP_BASE_URL = 'https://ssfp.thhy-tj.com/api' |
| | | VUE_APP_BASE_URL = 'http://111.30.93.212:8089/suapi' |
| | | # VUE_APP_BASE_URL = 'http://192.168.0.247:8880' |
| | | # VUE_APP_BASE_URL = 'http://111.30.93.212:8089/pipesu' |
| | |
| | | # VUE_APP_BASE_URL = 'https://pipe.thhy-tj.com:8880' |
| | | |
| | | VUE_APP_BASE_URL = 'http://111.30.93.212:10100' |
| | | VUE_APP_BASE_URL = 'http://111.30.93.212:8089/suapi' |
| | | # VUE_APP_BASE_URL = 'http://111.30.93.247:8880' |
| | |
| | | import Analyse from './modules/analyse'; // 数据分析模块 |
| | | import Safety from './modules/safety'; // 安全管理模块 |
| | | import Scan from './modules/scan'; // 扫码跳转到对应页面 |
| | | import Green from './modules/green'; // 扫码跳转到对应页面 |
| | | import Quality from './modules/quality'; // 质量管理界面 |
| | | |
| | | export default { |
| | |
| | | Analyse, |
| | | Safety, |
| | | Scan, |
| | | Green, |
| | | Quality |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | * 绿色施工 |
| | | */ |
| | | import axios from '../request'; |
| | | |
| | | export default { |
| | | // 查询环境监测 |
| | | searchEnvironMonitorList: (params) => |
| | | axios.post('/materials/helmet/dataValuesList ', params), |
| | | // 查询焊接烟尘信息 |
| | | searchSmokeList: params => |
| | | axios.post('/materials/helmet/dataSmockList', params), |
| | | |
| | | } |
| | |
| | | bigNumber: this.bigNumber, |
| | | pageNum: this.pageNum, |
| | | pageSize: this.pageSize, |
| | | startTime: this.timeData ? this.timeData[0] : '', |
| | | endTime: this.timeData ? this.timeData[1] : '' |
| | | startTime: this.timeData ? this.timeData[0] + ' 00:00:00' : '', |
| | | endTime: this.timeData ? this.timeData[1] + ' 23:59:59' : '' |
| | | }).then(res => { |
| | | if(res.success) { |
| | | this.total = res.data.total; |
| | |
| | | <template> |
| | | <div>环境监测</div> |
| | | <div class="main"> |
| | | <div class="main_header"> |
| | | <div class="header_item"> |
| | | <span class="header_label">时间范围:</span> |
| | | <el-date-picker |
| | | v-model="dataTime" |
| | | type="daterange" |
| | | range-separator="至" |
| | | start-placeholder="开始日期" |
| | | end-placeholder="结束日期" |
| | | value-format="yyyy-MM-dd"> |
| | | </el-date-picker> |
| | | </div> |
| | | <div class="header_item"> |
| | | <el-button icon="el-icon-search" @click="searchEnvironMonitorList(true)">查询</el-button> |
| | | <!-- <el-button icon="el-icon-search" v-if="showButton('search')">查询</el-button> --> |
| | | </div> |
| | | </div> |
| | | <div class="main_content"> |
| | | <el-table |
| | | v-loading="loading" |
| | | :data="monitorList" |
| | | height="100%"> |
| | | <el-table-column label="序号" align="center" > |
| | | <template #default="scope"> |
| | | <div> |
| | | <span>{{(pageNum - 1) * pageSize + scope.$index + 1}}</span> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="uploadTime" label="采集时间" align="center" ></el-table-column> |
| | | <el-table-column prop="deviceName" label="设备" align="center"></el-table-column> |
| | | <el-table-column prop="pm25" label="PM2.5(微克/立方米)" width="200" align="center" ></el-table-column> |
| | | <el-table-column prop="pm10" label="PM10(微克/立方米)" width="200" align="center" ></el-table-column> |
| | | <el-table-column prop="tsp" label="TSP(微克/立方米)" width="200" align="center" ></el-table-column> |
| | | <el-table-column prop="temperature" label="温度(摄氏度)" align="center" ></el-table-column> |
| | | <el-table-column prop="humidity" label="湿度(%)" align="center" ></el-table-column> |
| | | <el-table-column prop="bigDeviceModel" label="大气压(千帕)" align="center" ></el-table-column> |
| | | <el-table-column prop="windSpeed" label="风速(米/秒)" align="center" ></el-table-column> |
| | | <el-table-column prop="windDirection" label="风向" align="center" ></el-table-column> |
| | | <el-table-column prop="noise" label="噪声(分贝)" align="center" ></el-table-column> |
| | | </el-table> |
| | | </div> |
| | | <div class="main_footer"> |
| | | |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { buttonPinia } from '../../pinia'; |
| | | export default { |
| | | data() { |
| | | return { |
| | | dataTime: '', |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | total: 0, |
| | | loading: false, |
| | | monitorList: [] |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.searchEnvironMonitorList(true); |
| | | }, |
| | | methods: { |
| | | // 查询环境监测 |
| | | searchEnvironMonitorList(bol) { |
| | | if(bol) { |
| | | this.pageNum = 1; |
| | | } |
| | | this.loading = true; |
| | | this.monitorList = []; |
| | | this.$api.Green.searchEnvironMonitorList({ |
| | | strTime: this.dataTime ? this.dataTime[0] : '', |
| | | endTime: this.dataTime ? this.dataTime[1] : '', |
| | | pageNum: this.pageNum, |
| | | pageSize: this.pageSize |
| | | }).then(res => { |
| | | if(res.success) { |
| | | this.total = res.data.total; |
| | | this.monitorList = res.data.list; |
| | | } |
| | | this.loading = false; |
| | | }).catch(() => { |
| | | this.loading = false; |
| | | }) |
| | | }, |
| | | // 判断按钮权限信息 |
| | | showButton(str) { |
| | | const pinia = buttonPinia(); |
| | | return pinia.$state.buttonInfo.includes(str); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | @import '@/style/layout-main.scss'; |
| | | </style> |
| | |
| | | <template> |
| | | <div>焊接烟尘</div> |
| | | <div class="main"> |
| | | <div class="main_header"> |
| | | <div class="header_item"> |
| | | <span class="header_label">时间范围:</span> |
| | | <el-date-picker |
| | | v-model="dataTime" |
| | | type="daterange" |
| | | range-separator="至" |
| | | start-placeholder="开始日期" |
| | | end-placeholder="结束日期" |
| | | value-format="yyyy-MM-dd"> |
| | | </el-date-picker> |
| | | </div> |
| | | <div class="header_item"> |
| | | <el-button icon="el-icon-search" @click="searchSmokeList(true)">查询</el-button> |
| | | <!-- <el-button icon="el-icon-search" v-if="showButton('search')">查询</el-button> --> |
| | | </div> |
| | | </div> |
| | | <div class="main_content"> |
| | | <el-table |
| | | v-loading="loading" |
| | | :data="smokeList" |
| | | height="100%"> |
| | | <el-table-column label="序号" align="center" > |
| | | <template #default="scope"> |
| | | <div> |
| | | <span>{{(pageNum - 1) * pageSize + scope.$index + 1}}</span> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="bigDeviceName" label="采集时间" align="center" ></el-table-column> |
| | | <el-table-column prop="bigNumber" label="设备" align="center"></el-table-column> |
| | | <el-table-column prop="dc" label="粉尘浓度(mg/m³)" align="center" ></el-table-column> |
| | | <el-table-column prop="t" label="温度(℃)" align="center" ></el-table-column> |
| | | <el-table-column prop="dp" label="压差(pa)" align="center" ></el-table-column> |
| | | <el-table-column prop="oc" label="氧气浓度(%)" align="center" ></el-table-column> |
| | | <el-table-column prop="fans" label="风速(m/s)" align="center" ></el-table-column> |
| | | <el-table-column prop="alarm" label="设备报警" align="center" ></el-table-column> |
| | | <el-table-column label="风机启动" align="center" > |
| | | <template #default="{ row }"> |
| | | <div> |
| | | {{row.fanrun ? row.fanrun == 1 ? '运行' : '未运行' : ''}} |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | <div class="main_footer"> |
| | | |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { buttonPinia } from '../../pinia'; |
| | | export default { |
| | | data() { |
| | | return { |
| | | dataTime: '', |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | total: 0, |
| | | loading: false, |
| | | smokeList: [] |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.searchSmokeList(true); |
| | | }, |
| | | methods: { |
| | | // 查询焊接烟尘信息 |
| | | searchSmokeList(bol) { |
| | | if(bol) { |
| | | this.pageNum = 1; |
| | | } |
| | | this.loading = true; |
| | | this.smokeList = []; |
| | | this.$api.Green.searchSmokeList({ |
| | | strTime: this.dataTime ? this.dataTime[0] : '', |
| | | endTime: this.dataTime ? this.dataTime[1] : '', |
| | | pageNum: this.pageNum, |
| | | pageSize: this.pageSize |
| | | }).then(res => { |
| | | if(res.success) { |
| | | this.total = res.data.total; |
| | | this.smokeList = res.data.list; |
| | | } |
| | | this.loading = false; |
| | | }).catch(() => { |
| | | this.loading = false; |
| | | }) |
| | | }, |
| | | // 判断按钮权限信息 |
| | | showButton(str) { |
| | | const pinia = buttonPinia(); |
| | | return pinia.$state.buttonInfo.includes(str); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | @import '@/style/layout-main.scss'; |
| | | </style> |