| | |
| | | |
| | | //ç管éç¥å |
| | | public static final String NOTICE_IN_TYPE_20 = "20"; |
| | | |
| | | // åºå
¥åºç±»å-å
¥åº |
| | | public static final String TYPE_IN = "IN"; |
| | | |
| | | // åºå
¥åºç±»å-åºåº |
| | | public static final String TYPE_OUT = "OUT"; |
| | | |
| | | // æµç¨-å¼ä» |
| | | public static final String PROGRESS_HANDLE = "HANDLE"; |
| | | |
| | | // æµç¨-夿¡ï¼è¡¨ç¤ºæµç¨æ´ä½å®æå夿¡ï¼ |
| | | public static final String PROGRESS_RECORD = "RECORD"; |
| | | } |
| | |
| | | return this.listDept(null,user.getCompanyId(),null); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ ¹æ®ç¨æ·ç±»åè·å对åºåºåºå表信æ¯APP |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | | public List<Dept> getDeptByUserTypeApp(String userType,String deptId) { |
| | | |
| | | |
| | | if (Constant.USER_TYPE_10.equals(userType)) { |
| | | //çç®¡ç¨æ·ï¼ç´æ¥æ¥è¯¢ç»ç»ä¸ææåºåº |
| | | return this.listDept(null,userType,null); |
| | | } |
| | | if (Constant.USER_TYPE_20.equals(userType)) { |
| | | //é¶è¡ç¨æ·ï¼æ ¹æ®ååæ¥è¯¢é¶è¡ä¸ææåºåº |
| | | return this.getDeptByBank(userType); |
| | | } |
| | | if (Constant.USER_TYPE_30.equals(userType)) { |
| | | //åºåºç¨æ· |
| | | if(ContextUtil.isDepotUser(deptId)){ |
| | | //æ¥è¯¢ç¨æ·æå±åºåº |
| | | return this.listDept(deptId,null,null); |
| | | }else { |
| | | //æ¥è¯¢ç¨æ·æå±å
¬å¸ä¸ææåºåº |
| | | return this.listDept(null,null, deptId); |
| | | } |
| | | } |
| | | return this.listDept(null,ContextUtil.getCompanyId(),null); |
| | | } |
| | | /** |
| | | * æ ¹æ®é¶è¡idï¼å
³èåå表æ¥è¯¢åºåºå表 |
| | | * @param bankId é¶è¡å· |
| | |
| | | public String getMsg() { |
| | | return msg; |
| | | } |
| | | |
| | | public static String getMsg(String code) { |
| | | if(null == code) return null; |
| | | if(WorkBizType.TYPE_10.getCode().equals(code)) return WorkBizType.TYPE_10.getMsg(); |
| | | if(WorkBizType.TYPE_20.getCode().equals(code)) return WorkBizType.TYPE_20.getMsg(); |
| | | if(WorkBizType.TYPE_30.getCode().equals(code)) return WorkBizType.TYPE_30.getMsg(); |
| | | if(WorkBizType.TYPE_40.getCode().equals(code)) return WorkBizType.TYPE_40.getMsg(); |
| | | if(WorkBizType.TYPE_50.getCode().equals(code)) return WorkBizType.TYPE_50.getMsg(); |
| | | if(WorkBizType.TYPE_99.getCode().equals(code)) return WorkBizType.TYPE_99.getMsg(); |
| | | return code; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.constant; |
| | | |
| | | /** |
| | | * @Author: YYC |
| | | * @Description: |
| | | * @DateTime: 2026-1-12 15:11 |
| | | **/ |
| | | public class PhoneConstant { |
| | | |
| | | /** |
| | | *ç²®æ
ä»åºå表 |
| | | */ |
| | | public static final String PHONE_DEPOT_GRAIN="grain"; |
| | | public static final String PHONE_DEPOT_PEST="pest"; |
| | | public static final String PHONE_DEPOT_GAS="gas"; |
| | | |
| | | /** |
| | | * å¼ä»æäº¤ |
| | | */ |
| | | public static final String PHONE_INOUT_START="start"; |
| | | public static final String PHONE_INOUT_END="end"; |
| | | /** |
| | | * ç»å½ |
| | | */ |
| | | public static final String API_PHONE_5001 = "5001"; |
| | | /** |
| | | * è·ååºåºåè¡¨ä¿¡æ¯ |
| | | */ |
| | | public static final String API_PHONE_5002 = "5002"; |
| | | /** |
| | | * ç³»ç»è¦å |
| | | */ |
| | | public static final String API_PHONE_5003 = "5003"; |
| | | /** |
| | | * ç¨æ·ä¿¡æ¯æ´æ¹ |
| | | */ |
| | | public static final String API_PHONE_5004 = "5004"; |
| | | /** |
| | | * ç³»ç»è¦å |
| | | */ |
| | | public static final String API_PHONE_5005 = "5005"; |
| | | |
| | | /* ======= ç管管ç ====== */ |
| | | /** |
| | | * å·¥å管ç |
| | | */ |
| | | public static final String API_PHONE_5101 = "5101"; |
| | | public static final String API_PHONE_5102 = "5102"; |
| | | |
| | | /** |
| | | * è§é¢ç®¡ç |
| | | */ |
| | | public static final String API_PHONE_5103 = "5103"; |
| | | public static final String API_PHONE_5104 = "5104"; |
| | | |
| | | /** |
| | | * å·¡æ£ç管 |
| | | */ |
| | | public static final String API_PHONE_5105 = "5105"; |
| | | public static final String API_PHONE_5106 = "5106"; |
| | | public static final String API_PHONE_5107 = "5107"; |
| | | |
| | | /** |
| | | * ææç®¡ç |
| | | */ |
| | | public static final String API_PHONE_5108 = "5108"; |
| | | public static final String API_PHONE_5109 = "5109"; |
| | | /** |
| | | * AIäºä»¶ç®¡ç |
| | | */ |
| | | public static final String API_PHONE_5110 = "5110"; |
| | | public static final String API_PHONE_5111 = "5111"; |
| | | |
| | | /* ======= æºè½ä»å¨ ====== */ |
| | | /** |
| | | * ç²®æ
æ°æ®æ¥ç |
| | | */ |
| | | public static final String API_PHONE_5201 = "5201"; |
| | | public static final String API_PHONE_5202 = "5202"; |
| | | public static final String API_PHONE_5203 = "5203"; |
| | | public static final String API_PHONE_5204 = "5204"; |
| | | public static final String API_PHONE_5205 = "5205"; |
| | | /** |
| | | * æä½æ»è§ |
| | | */ |
| | | public static final String API_PHONE_5206 = "5206"; |
| | | |
| | | /** |
| | | * æ°éçæµ |
| | | */ |
| | | public static final String API_PHONE_5207 = "5207"; |
| | | public static final String API_PHONE_5208 = "5208"; |
| | | |
| | | |
| | | /* ======= å®é²ç®¡ç ====== */ |
| | | |
| | | public static final String API_PHONE_5301 = "5301"; |
| | | public static final String API_PHONE_5302 = "5302"; |
| | | |
| | | /* ======= ç²®é£è´é ====== */ |
| | | /** |
| | | * å
¥åºå¼ä» |
| | | */ |
| | | public static final String API_PHONE_5401 = "5401"; |
| | | public static final String API_PHONE_5402 = "5402"; |
| | | |
| | | /** |
| | | * 宿¶è®°å½ |
| | | */ |
| | | public static final String API_PHONE_5405 = "5405"; |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.fzzy.common.constant.RespCodeEnum; |
| | | import com.fzzy.igds.app.v1.data.AuthUser; |
| | | import com.fzzy.igds.app.v1.data.PhoneRequest; |
| | | import com.fzzy.igds.app.v1.data.PhoneResponse; |
| | | import com.fzzy.igds.app.v1.manager.PhoneManager; |
| | | import com.fzzy.igds.app.v1.util.PhoneRespUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.IOException; |
| | | |
| | | /** |
| | | * @Author: YYC |
| | | * @Description: |
| | | * @DateTime: 2026-1-14 11:45 |
| | | **/ |
| | | @Controller |
| | | @RequestMapping("api/phone/v1") |
| | | public class PhoneController { |
| | | |
| | | @Autowired |
| | | private PhoneManager phoneManager; |
| | | |
| | | /** |
| | | * ç»å½å
¥å£ |
| | | * |
| | | * @param req |
| | | * @return |
| | | */ |
| | | @SuppressWarnings("unchecked") |
| | | @ResponseBody |
| | | @RequestMapping("/login") |
| | | public PhoneResponse<Object> phoneLogin(@RequestBody PhoneRequest<JSONObject> req) { |
| | | |
| | | //夿忰 |
| | | if (null == req) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1007, RespCodeEnum.CODE_1007.getMsg()); |
| | | } |
| | | |
| | | PhoneResponse<Object> result = PhoneRespUtil.error(RespCodeEnum.CODE_1111, RespCodeEnum.CODE_1111.getMsg()); |
| | | |
| | | try { |
| | | //æ§è¡ä¸å¡æä½ |
| | | result = phoneManager.execute(req, null); |
| | | } catch (Exception e) { |
| | | result = PhoneRespUtil.error(RespCodeEnum.CODE_1111, |
| | | "å端å¼å¸¸ï¼" + e.getMessage()); |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * ä¸å¡ååå
¥å£ |
| | | * |
| | | * @param req |
| | | * @return |
| | | */ |
| | | @SuppressWarnings("unchecked") |
| | | @ResponseBody |
| | | @RequestMapping("/gateway") |
| | | public PhoneResponse<Object> phoneGateway(@RequestBody PhoneRequest<JSONObject> req) { |
| | | |
| | | //夿忰 |
| | | if (null == req) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1007, RespCodeEnum.CODE_1007.getMsg()); |
| | | } |
| | | |
| | | //夿æ¥å£ç¼ç |
| | | if (null == req.getInterfaceId()) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1007, RespCodeEnum.CODE_1007.getMsg()); |
| | | } |
| | | |
| | | //è·åç¨æ·ä¿¡æ¯ï¼å¦ææåæ´æ°ï¼å¦ææ²¡æåè·³åº |
| | | AuthUser phone35AuthUser = phoneManager.checkTokenAuth(req); |
| | | if (null == phone35AuthUser) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1006, "æ¨ç»å½å·²è¶
æ¶ï¼è¯·éæ°ç»å½ï¼"); |
| | | } |
| | | |
| | | PhoneResponse<Object> result = PhoneRespUtil.error(RespCodeEnum.CODE_1111, RespCodeEnum.CODE_1111.getMsg()); |
| | | |
| | | try { |
| | | |
| | | //æ§è¡ä¸å¡æä½ |
| | | result = phoneManager.execute(req, phone35AuthUser); |
| | | |
| | | } catch (Exception e) { |
| | | result = PhoneRespUtil.error(RespCodeEnum.CODE_1111, |
| | | "å端å¼å¸¸ï¼" + e.getMessage()); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * å¼ä»ä¸ä¼ |
| | | * |
| | | * @param files |
| | | * @param req |
| | | * @return |
| | | * @throws IOException |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping("/upload-img") |
| | | public PhoneResponse<Object> phoneUploadImg( |
| | | @RequestParam("uploadkey") MultipartFile[] files, |
| | | HttpServletRequest req) throws IOException { |
| | | |
| | | return phoneManager.phoneUploadImg(files[0], req); |
| | | } |
| | | /** |
| | | * å¼ä»ä¸ä¼ |
| | | * |
| | | * @param files |
| | | * @param req |
| | | * @return |
| | | * @throws IOException |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping("/patrol-img") |
| | | public PhoneResponse<Object> phonePatrolImg( |
| | | @RequestParam("uploadkey") MultipartFile[] files, |
| | | HttpServletRequest req) throws IOException { |
| | | |
| | | return phoneManager.phonePatrol(files[0], req); |
| | | } |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.data; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | /** |
| | | * ç»å½ååå
¥ç¼åçä¿¡æ¯ |
| | | * @author chen |
| | | */ |
| | | @Data |
| | | public class AuthUser { |
| | | private String companyId; |
| | | private String username; |
| | | private String cname; |
| | | private String mobile; |
| | | private String address; |
| | | private String email; |
| | | |
| | | private String deptId; |
| | | private String deptName; |
| | | private HttpServletRequest request; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.data; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author chen |
| | | */ |
| | | @Data |
| | | public class ParamCamera extends ParamCommon { |
| | | |
| | | private String cameraId; |
| | | |
| | | private String playType; |
| | | |
| | | //æå®äºå°æ§å¶ä½¿ç¨ |
| | | private String cameraSn; |
| | | |
| | | private String videoPlayUrl; |
| | | |
| | | private String command; |
| | | |
| | | private String speed; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.data; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * éç¨åæ°å°è£
|
| | | */ |
| | | @Data |
| | | public class ParamCommon { |
| | | |
| | | private int pageSize = 15; |
| | | |
| | | private int pageNo = 1; |
| | | |
| | | private String tokenAuth; |
| | | |
| | | private String type; |
| | | |
| | | private String companyId; |
| | | |
| | | private String deptId; |
| | | |
| | | private Date startTime; |
| | | |
| | | private Date endTime; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.data; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author: YYC |
| | | * @Description: |
| | | * @DateTime: 2026-2-5 14:27 |
| | | **/ |
| | | @Data |
| | | public class ParamDepot extends ParamCommon { |
| | | |
| | | private String depotId; |
| | | private String dateTime; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.data; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * å¼ä»å表ãå¼ä»æäº¤æ°æ®å°è£
|
| | | * @author chen |
| | | */ |
| | | @Data |
| | | public class ParamInoutHandle extends ParamCommon { |
| | | |
| | | private String id; |
| | | |
| | | private String intelCard; |
| | | |
| | | private String plateNum; |
| | | |
| | | private String progress; |
| | | |
| | | private Double deHandle; |
| | | |
| | | private String fileName1; |
| | | |
| | | private String fileName2; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.data; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * å
¥åºè®°å½ãåºåºè®°å½æ°æ®å°è£
|
| | | * |
| | | * @author chen |
| | | */ |
| | | @Data |
| | | public class ParamInoutRecord extends ParamCommon { |
| | | |
| | | |
| | | |
| | | private String intelCard; |
| | | |
| | | private String plateNum; |
| | | |
| | | private String progress; |
| | | |
| | | private Date date; |
| | | |
| | | private Date end; |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.data; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Author: YYC |
| | | * @Description: |
| | | * @DateTime: 2026-1-13 14:33 |
| | | **/ |
| | | @Data |
| | | public class ParamOrder extends ParamCommon{ |
| | | |
| | | private String id; |
| | | private String orderId; |
| | | |
| | | private String assigneeId; |
| | | |
| | | private String assigneeName; |
| | | |
| | | private String node; |
| | | |
| | | private String action; |
| | | |
| | | private Date createTime; |
| | | |
| | | private String remark; |
| | | |
| | | private String nodeName; |
| | | |
| | | private String status; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.data; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Author: YYC |
| | | * @Description: |
| | | * @DateTime: 2026-1-13 16:20 |
| | | **/ |
| | | @Data |
| | | public class ParamPatrol extends ParamCommon{ |
| | | |
| | | private String id; |
| | | private String longitude; |
| | | private String latitude; |
| | | private String imgName; |
| | | private Date createTime; |
| | | private String userName; |
| | | |
| | | |
| | | private Date dateTime; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.data; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * å®é²-çµåå·¡é»è®°å½ |
| | | * |
| | | * @author chen |
| | | */ |
| | | @Data |
| | | public class ParamPatrolRecord implements Serializable { |
| | | |
| | | /** |
| | | * æå¡æäº¤ä½¿ç¨ |
| | | */ |
| | | private String longitude; |
| | | |
| | | private String latitude; |
| | | |
| | | private String imgName; |
| | | |
| | | /** |
| | | * æå¡è®°å½æ¥è¯¢ä½¿ç¨ |
| | | */ |
| | | private String userName; |
| | | |
| | | private String companyId; |
| | | |
| | | private String deptId; |
| | | |
| | | private Date date; |
| | | |
| | | private Date end; |
| | | |
| | | private String id; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.data; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * ç»å½åä¿®æ¹ä¿¡æ¯å°è£
|
| | | * @author chen |
| | | */ |
| | | @Data |
| | | public class ParamUser { |
| | | |
| | | /*ç»å½ä¿¡æ¯*/ |
| | | |
| | | private String username; |
| | | private String password; |
| | | |
| | | /*ä¿®æ¹ç¨æ·ä¿¡æ¯*/ |
| | | |
| | | private String newPassword1; |
| | | private String newPassword2; |
| | | private String newMobile; |
| | | private String newCname; |
| | | |
| | | private String salt; |
| | | private String companyId; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.data; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author: YYC |
| | | * @Description: |
| | | * @DateTime: 2026-1-13 16:01 |
| | | **/ |
| | | @Data |
| | | public class ParamVideo extends ParamCommon { |
| | | private String id; |
| | | private String playType; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.data; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ææºAPPæå¡ç»ä¸è§èæ¥å£è¯·æ± |
| | | * |
| | | * @author chen |
| | | */ |
| | | @Data |
| | | public class PhoneRequest<T> implements Serializable { |
| | | |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * æ¥å£ç¼å· |
| | | */ |
| | | private String interfaceId; |
| | | |
| | | /** |
| | | * ç¾å |
| | | */ |
| | | private String sign; |
| | | |
| | | /** |
| | | * ç¨æ·èªå®ä¹å段 |
| | | */ |
| | | private String outId; |
| | | |
| | | /** |
| | | * è¯·æ±æ¶é´ |
| | | */ |
| | | private String reqDateTime; |
| | | |
| | | /** |
| | | * tokençkey |
| | | */ |
| | | private String tokenAuth; |
| | | |
| | | /** |
| | | * 请æ±ä¸å¡æ°æ® |
| | | */ |
| | | private T data; |
| | | /** |
| | | * æä½è®¾å¤çä¸å¡æ°æ® |
| | | */ |
| | | private List<T> data1; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.data; |
| | | |
| | | import lombok.Getter; |
| | | |
| | | /** |
| | | * ååºç å®ä¹ |
| | | * |
| | | * @author Andy |
| | | * |
| | | */ |
| | | @Getter |
| | | public enum PhoneRespCodeEnum { |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | CODE_0000("0000", "æå"), |
| | | CODE_1111("1111", "å端æå¡å¼å¸¸"), |
| | | CODE_1001("1001","æ°æ®æ ¼å¼æ ¡éªå¤±è´¥"), |
| | | CODE_1002("1002","该åºç¨æ æ¿æ´»ææ"), |
| | | CODE_1003("1003","该åºç¨å·²ç»æææå"), |
| | | CODE_1004("1004","设å¤é讯失败"), |
| | | CODE_1005("1005","该设å¤ä¸åå¨"), |
| | | CODE_1006("1006","å½åç»å½äººå·²æçº¿"), |
| | | CODE_1007("1007","请æ±åæ°å¼å¸¸"), |
| | | CODE_1008("1008","æµç¨ä¸æ£ç¡®"), |
| | | CODE_2000("2000","ååºæ°æ®ä¸ºç©º") |
| | | ; |
| | | |
| | | private String code; |
| | | private String msg; |
| | | |
| | | PhoneRespCodeEnum(String code, String msg) { |
| | | this.code = code; |
| | | this.msg = msg; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.data; |
| | | |
| | | import com.fzzy.common.constant.RespCodeEnum; |
| | | import lombok.Data; |
| | | import org.apache.commons.lang3.time.DateFormatUtils; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Author: YYC |
| | | * @Description: |
| | | * @DateTime: 2026-1-12 10:53 |
| | | **/ |
| | | @Data |
| | | public class PhoneResponse<T> implements Serializable { |
| | | |
| | | private String DATE_FORMAT_YMDHMS = "yyyy-MM-dd HH:mm:ss"; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * ååºç |
| | | */ |
| | | private String code; |
| | | /** |
| | | * ååºä¿¡æ¯ |
| | | */ |
| | | private String msg; |
| | | |
| | | /** |
| | | * åå¡«ç¨æ·èªå®ä¹ä¿¡æ¯ |
| | | */ |
| | | private String outId; |
| | | /** |
| | | * ååºæ¶é´ |
| | | */ |
| | | private String respDateTime; |
| | | |
| | | /** |
| | | * è¿åæ°æ® |
| | | */ |
| | | private T data; |
| | | |
| | | public PhoneResponse() { |
| | | super(); |
| | | } |
| | | |
| | | public PhoneResponse(String code, String msg, String outId) { |
| | | this.code = code; |
| | | this.msg = msg; |
| | | this.outId = outId; |
| | | } |
| | | |
| | | public PhoneResponse(String code, String msg, String outId, T data) { |
| | | this.code = code; |
| | | this.msg = msg; |
| | | this.outId = outId; |
| | | this.data = data; |
| | | this.respDateTime = DateFormatUtils.format(new Date(), DATE_FORMAT_YMDHMS); |
| | | } |
| | | |
| | | public PhoneResponse(String code, String msg, T data) { |
| | | this.code = code; |
| | | this.msg = msg; |
| | | this.data = data; |
| | | this.respDateTime = DateFormatUtils.format(new Date(), DATE_FORMAT_YMDHMS); |
| | | } |
| | | |
| | | public PhoneResponse(RespCodeEnum code, String outId, T data) { |
| | | this.code = code.getCode(); |
| | | this.outId = outId; |
| | | this.data = data; |
| | | this.respDateTime = DateFormatUtils.format(new Date(), DATE_FORMAT_YMDHMS); |
| | | } |
| | | public PhoneResponse(RespCodeEnum code, String outId, String msg) { |
| | | this.code = code.getCode(); |
| | | this.outId = outId; |
| | | this.msg = msg; |
| | | this.respDateTime = DateFormatUtils.format(new Date(), DATE_FORMAT_YMDHMS); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author: YYC |
| | | * @Description: |
| | | * @DateTime: 2026-2-5 14:38 |
| | | **/ |
| | | @Data |
| | | public class PDetailDto { |
| | | |
| | | private Double tempMin; |
| | | private Double tempMax; |
| | | private Double tempAve; |
| | | private int fz; |
| | | private String fzName; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.dto; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fzzy.igds.constant.WarnStatus; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import lombok.Data; |
| | | |
| | | import javax.persistence.Column; |
| | | import javax.persistence.Id; |
| | | import javax.persistence.Temporal; |
| | | import javax.persistence.TemporalType; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Author: YYC |
| | | * @Description: |
| | | * @DateTime: 2026-2-11 14:00 |
| | | **/ |
| | | @Data |
| | | public class PEventInfoDto { |
| | | |
| | | private String id; |
| | | |
| | | private String deptId; |
| | | private String deptName; |
| | | |
| | | private String depotId; |
| | | |
| | | private String serId; |
| | | private String name; |
| | | |
| | | private String bizType; |
| | | |
| | | private String type; |
| | | |
| | | private String level; |
| | | |
| | | private String status; |
| | | |
| | | private String info; |
| | | |
| | | private Date time; |
| | | |
| | | private String noticeResult; |
| | | |
| | | private String noticeUser; |
| | | |
| | | private String completeUser; |
| | | |
| | | private Date completeTime; |
| | | |
| | | private String tags ; |
| | | |
| | | private String remark; |
| | | |
| | | private String imgName; |
| | | |
| | | private String companyId; |
| | | |
| | | private String createBy; |
| | | |
| | | private Date createTime; |
| | | |
| | | private String updateBy; |
| | | |
| | | private Date updateTime; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fzzy.igds.constant.DepotType; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author: YYC |
| | | * @Description: |
| | | * @DateTime: 2026-2-5 14:36 |
| | | **/ |
| | | @Data |
| | | public class PGrainDto { |
| | | |
| | | private String depotId; |
| | | private String depotName; |
| | | private String depotType; |
| | | private String depotTypeName; |
| | | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") |
| | | private Date receiveDate; |
| | | private Double tempIn; |
| | | private Double humidityIn; |
| | | private Double tempOut; |
| | | private Double humidityOut; |
| | | private Double tempMax = 0.0; |
| | | private Double tempMin = 0.0; |
| | | private Double tempAve = 0.0; |
| | | private String cable; |
| | | private String cableCir; |
| | | |
| | | private List<PPointDto> points; |
| | | |
| | | private List<PDetailDto> details; |
| | | |
| | | public String getDepotTypeName() { |
| | | if (null != this.depotType) { |
| | | return DepotType.getMsg(this.depotType); |
| | | } |
| | | return null; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fzzy.igds.constant.FoodLevel; |
| | | import com.fzzy.igds.constant.FoodVariety; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Author: YYC |
| | | * @Description: |
| | | * @DateTime: 2026-2-5 9:42 |
| | | **/ |
| | | @Data |
| | | public class PInoutDto { |
| | | |
| | | private String id; |
| | | private String companyId; |
| | | private String intelCard; |
| | | private String plateNum; |
| | | private String type; |
| | | private String typeName; |
| | | private String depotId; |
| | | private String depotName; |
| | | private Double deHandle; |
| | | private String customerId; |
| | | private String customerName; |
| | | private String foodVariety; |
| | | private String foodVarietyName; |
| | | private Double recordWeight; |
| | | private String foodLevel; |
| | | private String foodLevelName; |
| | | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") |
| | | private Date handleStart; |
| | | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") |
| | | private Date handelEnd; |
| | | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") |
| | | private Date completeTime; |
| | | private String progress; |
| | | private String progressName; |
| | | |
| | | private String storeKeeper; |
| | | private String storeKeeperName; |
| | | |
| | | private String fileName1; |
| | | private String fileName2; |
| | | |
| | | private String base64Img1; |
| | | private String base64Img2; |
| | | |
| | | public String getFoodVarietyName() { |
| | | if (null != this.foodVariety) { |
| | | return FoodVariety.getMsg(this.foodVariety); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getFoodLevelName() { |
| | | if (null != this.foodLevel) { |
| | | return FoodLevel.getMsg(this.foodLevel); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * åºå
¥åºæ°æ®å°è£
-- ç¨äºåºå
¥åºè®°å½å宿¶ä¿¡æ¯ |
| | | * @author chen |
| | | */ |
| | | @Data |
| | | public class PInoutSum { |
| | | |
| | | /** |
| | | * åºå
¥åºæµæ°´ä¿¡æ¯ |
| | | */ |
| | | private List<PInoutDto> listInout; |
| | | |
| | | /** |
| | | * å
¥åºç»è®°æ° |
| | | */ |
| | | private Double inSumNum = 0.0; |
| | | /** |
| | | * å
¥åºå®ææ° |
| | | */ |
| | | private Double inCompleteNum = 0.0; |
| | | /** |
| | | * å
¥åºå®æç |
| | | */ |
| | | private Double perInComplete = 0.0; |
| | | /** |
| | | * åºåºç»è®°æ° |
| | | */ |
| | | private Double outSumNum = 0.0; |
| | | /** |
| | | * åºåºå®ææ° |
| | | */ |
| | | private Double outCompleteNum = 0.0; |
| | | /** |
| | | * åºåºå®æç |
| | | */ |
| | | private Double perOutComplete = 0.0; |
| | | |
| | | /** |
| | | * åºå
¥åºå计æ°(ç¨äºåºå
¥åºè®°å½) |
| | | */ |
| | | private Double sum = 0.0; |
| | | |
| | | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") |
| | | private Date time; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Author: YYC |
| | | * @Description: |
| | | * @DateTime: 2026-1-13 16:24 |
| | | **/ |
| | | @Data |
| | | public class PPatrolDto { |
| | | |
| | | private String id; |
| | | private String userName; |
| | | private String longitude; |
| | | private String latitude; |
| | | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createTime; |
| | | |
| | | private String base64Img; |
| | | private String imgName; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author: YYC |
| | | * @Description: |
| | | * @DateTime: 2026-2-5 14:38 |
| | | **/ |
| | | @Data |
| | | public class PPointDto { |
| | | |
| | | private int z; |
| | | private int x; |
| | | private int y; |
| | | private int fz; |
| | | private Double temp; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.dto; |
| | | |
| | | import com.fzzy.igds.domain.Quantity; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author: YYC |
| | | * @Description: |
| | | * @DateTime: 2026-2-6 10:16 |
| | | **/ |
| | | @Data |
| | | public class PQuantityDto extends Quantity { |
| | | |
| | | private String deptName; |
| | | private Double errorValue; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.dto; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import javax.persistence.Column; |
| | | import javax.persistence.Id; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Author: YYC |
| | | * @Description: |
| | | * @DateTime: 2026-2-11 10:49 |
| | | **/ |
| | | @Data |
| | | public class PSnapDto { |
| | | |
| | | private String id; |
| | | |
| | | private String deptId; |
| | | private String deptName; |
| | | |
| | | private String cameraId; |
| | | |
| | | private String result; |
| | | |
| | | private String tags ; |
| | | |
| | | private Date snapTime; |
| | | |
| | | private String imgName; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author: YYC |
| | | * @Description: |
| | | * @DateTime: 2026-2-10 10:03 |
| | | **/ |
| | | @Data |
| | | public class PUploadDto { |
| | | |
| | | private String status; |
| | | |
| | | private String msg; |
| | | |
| | | private String fileName; |
| | | |
| | | private String base64Img; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author: YYC |
| | | * @Description: ç»å½æååè¿åä¿¡æ¯å°è£
|
| | | * @DateTime: 2026-1-13 11:19 |
| | | **/ |
| | | @Data |
| | | public class PUserDto { |
| | | |
| | | private String tokenAuth; |
| | | |
| | | private String username; |
| | | |
| | | private String cname; |
| | | |
| | | private String companyId; |
| | | |
| | | private String deptId; |
| | | private String deptName; |
| | | |
| | | private String mobile; |
| | | |
| | | private String support; |
| | | |
| | | private String email; |
| | | |
| | | private String phone; |
| | | |
| | | private String website; |
| | | |
| | | private String address; |
| | | |
| | | private String type; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.dto; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import lombok.Data; |
| | | |
| | | import javax.persistence.Column; |
| | | import javax.persistence.Id; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Author: YYC |
| | | * @Description: |
| | | * @DateTime: 2026-1-13 13:56 |
| | | **/ |
| | | @Data |
| | | public class PWorkOrderDto { |
| | | /** |
| | | * |
| | | */ |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | //å·¥åç¼å· |
| | | private String id; |
| | | |
| | | //å·¥åæ é¢/é®é¢æè¦ |
| | | private String title; |
| | | |
| | | //é®é¢è¯¦ç»æè¿° |
| | | private String description; |
| | | |
| | | //ä¸å¡åç±» |
| | | private String bizType; |
| | | //ä¸å¡åç±» |
| | | private String bizTypeName; |
| | | |
| | | private String node; |
| | | private String nodeName; |
| | | |
| | | //å·¥ååç±» |
| | | private String category; |
| | | |
| | | //ç¶æ |
| | | private String status; |
| | | |
| | | //å¤ç人 |
| | | private String assigneeId; |
| | | |
| | | //å¤ç人 |
| | | private String assigneeName; |
| | | |
| | | //æ¥åæ¶é´ |
| | | private Date receiveTime; |
| | | |
| | | //å建人 |
| | | private String createBy; |
| | | |
| | | //ä¸å¡å
³èä¸»é® |
| | | private String businessId; |
| | | |
| | | //ä¸å¡åè½è·¯å¾ |
| | | private String businessUrl; |
| | | |
| | | //æå±åºåº |
| | | private String deptId; |
| | | private String deptName; |
| | | |
| | | //ç管é¶è¡ |
| | | private String bankId; |
| | | //å建æ¶é´ |
| | | private Date createTime; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.manager; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.fzzy.common.constant.RespCodeEnum; |
| | | import com.fzzy.igds.app.v1.data.AuthUser; |
| | | import com.fzzy.igds.app.v1.data.PhoneRequest; |
| | | import com.fzzy.igds.app.v1.data.PhoneResponse; |
| | | import com.fzzy.igds.app.v1.dto.PUploadDto; |
| | | import com.fzzy.igds.app.v1.service.PhoneService; |
| | | import com.fzzy.igds.app.v1.util.PhoneRespUtil; |
| | | import com.fzzy.igds.app.v1.util.PhoneUtil; |
| | | import com.fzzy.igds.data.PageResponse; |
| | | import com.fzzy.igds.service.FileService; |
| | | import com.fzzy.igds.utils.ContextUtil; |
| | | import com.fzzy.igds.utils.DateUtil; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.sun.jna.platform.mac.MacFileUtils; |
| | | import org.springframework.beans.BeansException; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.ApplicationContext; |
| | | import org.springframework.context.ApplicationContextAware; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.File; |
| | | import java.io.FileNotFoundException; |
| | | import java.io.FileOutputStream; |
| | | import java.io.IOException; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author: YYC |
| | | * @Description: |
| | | * @DateTime: 2026-1-14 11:47 |
| | | **/ |
| | | @Component(PhoneManager.BEAN_ID) |
| | | public class PhoneManager implements ApplicationContextAware { |
| | | public static final String BEAN_ID = "phone.phoneManager"; |
| | | private static Map<String, PhoneService> serviceMap; |
| | | @Autowired |
| | | private RedisCache redisUtil; |
| | | @Resource |
| | | private FileService fileService; |
| | | |
| | | |
| | | @Override |
| | | public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { |
| | | Map<String, PhoneService> map = applicationContext |
| | | .getBeansOfType(PhoneService.class); |
| | | serviceMap = new HashMap<>(); |
| | | for (String key : map.keySet()) { |
| | | serviceMap.put(map.get(key).getInterfaceId(), map.get(key)); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * ä¸å¡æ§è¡å
¥å£ |
| | | * |
| | | * @param req |
| | | * @param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @SuppressWarnings("unchecked") |
| | | public PhoneResponse<Object> execute(PhoneRequest<JSONObject> req, AuthUser authUser) throws Exception { |
| | | |
| | | PhoneService service = serviceMap.get(req.getInterfaceId()); |
| | | if (null == service) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, |
| | | "å½åæ¥å£æ²¡ææ¾å°å®ç°ç±»ï¼æ æ³æ§è¡å¤ç"); |
| | | } |
| | | |
| | | return service.execute(req, authUser); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®tokenAuthè·åç¼åä¸çtokenUser |
| | | * |
| | | * @param req |
| | | * @return |
| | | */ |
| | | public AuthUser checkTokenAuth(PhoneRequest<JSONObject> req) { |
| | | String tokenAuth = req.getTokenAuth(); |
| | | return redisUtil.getCacheObject(PhoneUtil.createKey(tokenAuth)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * å¼ä»å¾çä¸ä¼ |
| | | * |
| | | * @param file |
| | | * @param req |
| | | * @return |
| | | * @throws IOException |
| | | */ |
| | | @SuppressWarnings("unchecked") |
| | | public PhoneResponse<Object> phoneUploadImg(MultipartFile file, |
| | | HttpServletRequest req) throws IOException { |
| | | String plateNum = req.getParameter("plateNum"); |
| | | |
| | | PageResponse<String> result = upLoadInoutImg(file, plateNum); |
| | | |
| | | if (result.getCode().equals(RespCodeEnum.CODE_0000.getCode())) { |
| | | //ä¸ä¼ æå |
| | | PUploadDto dtoUpload = new PUploadDto(); |
| | | dtoUpload.setStatus("success"); |
| | | dtoUpload.setMsg("ä¸ä¼ æåï¼"); |
| | | dtoUpload.setFileName(result.getMsg()); |
| | | return PhoneRespUtil.success(dtoUpload); |
| | | } else { |
| | | //ä¸ä¼ 失败 |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "ä¸ä¼ 失败"); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * å¼ä»å¾çä¸ä¼ |
| | | * |
| | | * @param file |
| | | * @param req |
| | | * @return |
| | | * @throws IOException |
| | | */ |
| | | @SuppressWarnings("unchecked") |
| | | public PhoneResponse<Object> phonePatrol(MultipartFile file, |
| | | HttpServletRequest req) throws IOException { |
| | | |
| | | String deptId = req.getParameter("deptId"); |
| | | PageResponse<String> result = upLoadPatrolImg(file, deptId); |
| | | |
| | | if (result.getCode().equals(RespCodeEnum.CODE_0000.getCode())) { |
| | | //ä¸ä¼ æå |
| | | PUploadDto dtoUpload = new PUploadDto(); |
| | | dtoUpload.setStatus("success"); |
| | | dtoUpload.setMsg("ä¸ä¼ æåï¼"); |
| | | dtoUpload.setFileName(result.getMsg()); |
| | | return PhoneRespUtil.success(dtoUpload); |
| | | } else { |
| | | //ä¸ä¼ 失败 |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "ä¸ä¼ 失败"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * åºå
¥åºçé件䏿¬¡ï¼åæ°æ¯è½¦çå· |
| | | * |
| | | * @param file |
| | | * @return |
| | | * @throws IOException |
| | | */ |
| | | public PageResponse<String> upLoadInoutImg(MultipartFile file, String plateNum) |
| | | throws IOException { |
| | | |
| | | // è·åé»è®¤ç¼ç çåèæ°ç» |
| | | byte[] fileByte = file.getBytes(); |
| | | |
| | | // è·åæä»¶çæºæä»¶åç§° |
| | | String oldFileName = file.getOriginalFilename(); |
| | | |
| | | // è·åæä»¶ä¿åè·¯å¾ |
| | | String filePath = fileService.getInoutFilePath(); |
| | | |
| | | // è·åæ°çID |
| | | String newFileName = ContextUtil.UUID(); |
| | | |
| | | // æä»¶åç¼å |
| | | String suffixName = oldFileName.substring(oldFileName.lastIndexOf(".")); |
| | | |
| | | // åææ°çæä»¶å |
| | | if (StringUtils.isEmpty(plateNum)) { |
| | | newFileName = newFileName + suffixName; |
| | | } else { |
| | | newFileName = plateNum + "_" + newFileName + suffixName; |
| | | } |
| | | |
| | | // æä»¶ä¸ä¼ |
| | | boolean flag = uploadFile(fileByte, filePath, newFileName); |
| | | |
| | | // 夿æä»¶ä¸ä¼ æ¯å¦æå,æåè¿åæä»¶å |
| | | if (flag) { |
| | | return new PageResponse<String>(RespCodeEnum.CODE_0000.getCode(), |
| | | newFileName); |
| | | } else { |
| | | return new PageResponse<String>(RespCodeEnum.CODE_1111.getCode(), |
| | | "ä¸ä¼ 失败"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æå¡çé件䏿¬¡ï¼åæ°æ¯è½¦çå· |
| | | * |
| | | * @param file |
| | | * @return |
| | | * @throws IOException |
| | | */ |
| | | public PageResponse<String> upLoadPatrolImg(MultipartFile file, String deptId) |
| | | throws IOException { |
| | | |
| | | // è·åé»è®¤ç¼ç çåèæ°ç» |
| | | byte[] fileByte = file.getBytes(); |
| | | |
| | | // è·åæä»¶çæºæä»¶åç§° |
| | | String oldFileName = file.getOriginalFilename(); |
| | | |
| | | // è·åæä»¶ä¿åè·¯å¾ |
| | | String filePath = fileService.getPatrolFilePath(); |
| | | |
| | | // è·åæ°çID |
| | | String newFileName = DateUtils.dateTimeNow(); |
| | | |
| | | // æä»¶åç¼å |
| | | String suffixName = oldFileName.substring(oldFileName.lastIndexOf(".")); |
| | | |
| | | // åææ°çæä»¶å |
| | | if (StringUtils.isEmpty(deptId)) { |
| | | newFileName = newFileName + suffixName; |
| | | } else { |
| | | newFileName = deptId + "_" + newFileName + suffixName; |
| | | } |
| | | |
| | | // æä»¶ä¸ä¼ |
| | | boolean flag = uploadFile(fileByte, filePath, newFileName); |
| | | |
| | | // 夿æä»¶ä¸ä¼ æ¯å¦æå,æåè¿åæä»¶å |
| | | if (flag) { |
| | | return new PageResponse<String>(RespCodeEnum.CODE_0000.getCode(), |
| | | newFileName); |
| | | } else { |
| | | return new PageResponse<String>(RespCodeEnum.CODE_1111.getCode(), |
| | | "ä¸ä¼ 失败"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æä»¶æµä¸ä¼ æä»¶ |
| | | * |
| | | * @param file |
| | | * @param filePath |
| | | * @param fileName |
| | | * @return |
| | | */ |
| | | public static boolean uploadFile(byte[] file, String filePath, String fileName) throws IOException { |
| | | // é»è®¤æä»¶ä¸ä¼ æå |
| | | boolean flag = true; |
| | | // newä¸ä¸ªæä»¶å¯¹è±¡å®ä¾ |
| | | File targetFile = new File(filePath); |
| | | // 妿å½åæä»¶ç®å½ä¸åå¨å°±èªå¨å建该æä»¶æè
ç®å½ |
| | | if (!targetFile.exists()) { |
| | | targetFile.mkdirs(); |
| | | } |
| | | // å建æä»¶æµ |
| | | FileOutputStream fileOutputStream = new FileOutputStream(filePath + fileName); |
| | | try { |
| | | fileOutputStream.write(file); |
| | | } catch (FileNotFoundException e) { |
| | | flag = false; |
| | | } catch (IOException ioException) { |
| | | flag = false; |
| | | } finally { |
| | | fileOutputStream.flush(); |
| | | fileOutputStream.close(); |
| | | } |
| | | return flag; |
| | | } |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.mapper; |
| | | |
| | | import com.fzzy.igds.app.v1.data.ParamOrder; |
| | | import org.springframework.data.repository.query.Param; |
| | | |
| | | /** |
| | | * @Author: YYC |
| | | * @Description: |
| | | * @DateTime: 2026-1-13 9:54 |
| | | **/ |
| | | public interface PhoneMapper { |
| | | |
| | | /** |
| | | * å·¥åå®¡æ ¸ |
| | | * @param param |
| | | * @return |
| | | */ |
| | | int updateOrder(@Param("param") ParamOrder param); |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.service; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.fzzy.igds.app.v1.data.AuthUser; |
| | | import com.fzzy.igds.app.v1.data.PhoneRequest; |
| | | import com.fzzy.igds.app.v1.data.PhoneResponse; |
| | | |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | public interface PhoneService { |
| | | |
| | | public String getInterfaceId(); |
| | | |
| | | public PhoneResponse<Object> execute(PhoneRequest<JSONObject> req, AuthUser authUser) throws Exception; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.fzzy.common.constant.RespCodeEnum; |
| | | import com.fzzy.igds.app.v1.constant.PhoneConstant; |
| | | import com.fzzy.igds.app.v1.data.AuthUser; |
| | | import com.fzzy.igds.app.v1.data.ParamUser; |
| | | import com.fzzy.igds.app.v1.data.PhoneRequest; |
| | | import com.fzzy.igds.app.v1.data.PhoneResponse; |
| | | import com.fzzy.igds.app.v1.dto.PUserDto; |
| | | import com.fzzy.igds.app.v1.service.PhoneService; |
| | | |
| | | import com.fzzy.igds.app.v1.util.PhoneRespUtil; |
| | | import com.fzzy.igds.app.v1.util.PhoneUtil; |
| | | import com.fzzy.igds.service.SysDeptService; |
| | | import com.ruoyi.common.constant.Constants; |
| | | import com.ruoyi.common.constant.UserConstants; |
| | | import com.ruoyi.common.core.domain.entity.SysDept; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.common.enums.UserStatus; |
| | | import com.ruoyi.common.exception.user.*; |
| | | import com.ruoyi.common.utils.IpUtils; |
| | | import com.ruoyi.common.utils.MessageUtils; |
| | | import com.ruoyi.common.utils.ShiroUtils; |
| | | import com.ruoyi.framework.manager.AsyncManager; |
| | | import com.ruoyi.framework.manager.factory.AsyncFactory; |
| | | import com.ruoyi.framework.shiro.service.SysPasswordService; |
| | | import com.ruoyi.system.service.ISysConfigService; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.UUID; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | |
| | | /** |
| | | * ç»å½æ¥å£å®ç° |
| | | * |
| | | * @author chen |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class ServiceImpl5001 implements PhoneService { |
| | | |
| | | //RSA-ç§é¥ |
| | | private static final String PRIVATE_KEY = "MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAJo3SjBOwXnr97QrRjKcGsJnm8xuWw3bEGsqJseNTEwgYOm2+7L6wMVyIQjJfIG3UO27hubhf4r4iadfaocyCw1dNA82tRNlgGr/B9c68uSLcvFIBlKsd2z29FPC3yA+TKRpyoXC5iUS15PVzPji+d3qR8FgR2LoDmXVcah2UWhzAgMBAAECgYEAkyR8CfmrCyzFrMe5c+KUebcn5XfKMz84vDd8xtwf12bxcS4hnFU7B2ls8ZhlztLdSeeqwLKZ4jxgAy28VADAn2WKHI6z5PCezZpkcS4JbhqU4XhSeXw5UwNeBX0nnXzwO1kRgyMfMyNsUx0pDV6w42ZybufFeG3uEGt76J45j0ECQQDHhqq7LNg9nm6G0XnLERB2wz7YVfdXZKRVlwN38H/98wOIGVDhtgz/t4QGZgBBPEUbxXq1vcXhynRr7LP/W6ThAkEAxd2HbOLcWYG+h/c82/9N8BDZzZWVPzEfhq4MHGuNAvQ5R0SssfunQCQAhoAPnL++8Mz4FOKTExG+1DYAmDXj0wJAX91UKpphSznT4PLEkcyhHG6ywz6KmHLCgl0MTZQ/6sPX7ow7UDcoB7Ukue5IMQ/EJJO9YZTMfq/HQBN6aDagAQJBAMF0UpA3TlGE9RBivnIqL71j/E9wzLc4BCbdzKGM1hXpSodPsbli3qdri8f1NU6AeuNcw8FHtZyTYQyCsBohtlkCQB0Lv67uM0Wz628bfxQ1kCREoMMIuIEZPo6nRfTF4ASjnvERQehBhT2ZBWyGaDPKgG1YElOHAdI9jQvs22DtQ+4="; |
| | | @Autowired |
| | | private SysPasswordService passwordService; |
| | | @Autowired |
| | | private ISysUserService userService; |
| | | @Autowired |
| | | private ISysConfigService configService; |
| | | @Autowired |
| | | private SysDeptService deptService; |
| | | @Autowired |
| | | private RedisCache redisUtil; |
| | | @Override |
| | | public String getInterfaceId() { |
| | | return PhoneConstant.API_PHONE_5001; |
| | | } |
| | | |
| | | @SuppressWarnings("unchecked") |
| | | @Override |
| | | public PhoneResponse<Object> execute(PhoneRequest<JSONObject> req, AuthUser auth) |
| | | throws Exception { |
| | | ParamUser param = JSONObject.parseObject(req.getData().toString(), ParamUser.class); |
| | | |
| | | //éªè¯åæ° |
| | | if (null == param) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1007, "ç¨æ·ååå¯ç é误ï¼è¯·éæ°ç»å½ï¼"); |
| | | } |
| | | if (StringUtils.isEmpty(param.getUsername())) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1007, "ç¨æ·ååå¯ç é误ï¼è¯·éæ°ç»å½ï¼"); |
| | | } |
| | | if (StringUtils.isEmpty(param.getPassword())) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1007, "ç¨æ·ååå¯ç é误ï¼è¯·éæ°ç»å½ï¼"); |
| | | } |
| | | // ç¨æ·åæå¯ç 为空 é误 |
| | | if (StringUtils.isEmpty(param.getUsername()) || StringUtils.isEmpty(param.getPassword())) { |
| | | AsyncManager.me().execute(AsyncFactory.recordLogininfor(param.getUsername(), Constants.LOGIN_FAIL, MessageUtils.message("not.null"))); |
| | | throw new UserNotExistsException(); |
| | | } |
| | | // å¯ç 妿ä¸å¨æå®èå´å
é误 |
| | | if (param.getPassword().length() < UserConstants.PASSWORD_MIN_LENGTH |
| | | || param.getPassword().length() > UserConstants.PASSWORD_MAX_LENGTH) { |
| | | AsyncManager.me().execute(AsyncFactory.recordLogininfor(param.getUsername(), Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match"))); |
| | | throw new UserPasswordNotMatchException(); |
| | | } |
| | | // ç¨æ·åä¸å¨æå®èå´å
é误 |
| | | if (param.getUsername().length() < UserConstants.USERNAME_MIN_LENGTH |
| | | || param.getUsername().length() > UserConstants.USERNAME_MAX_LENGTH) { |
| | | AsyncManager.me().execute(AsyncFactory.recordLogininfor(param.getUsername(), Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match"))); |
| | | throw new UserPasswordNotMatchException(); |
| | | } |
| | | |
| | | // æ¥è¯¢ç¨æ·ä¿¡æ¯ |
| | | SysUser user = userService.selectUserByLoginName(param.getUsername()); |
| | | |
| | | // IPé»ååæ ¡éª |
| | | String blackStr = configService.selectConfigByKey("sys.login.blackIPList", user.getCompanyId()); |
| | | if (IpUtils.isMatchedIp(blackStr, ShiroUtils.getIp())) { |
| | | AsyncManager.me().execute(AsyncFactory.recordLogininfor(param.getUsername(), Constants.LOGIN_FAIL, MessageUtils.message("login.blocked"))); |
| | | throw new BlackListException(); |
| | | } |
| | | if (user == null) { |
| | | AsyncManager.me().execute(AsyncFactory.recordLogininfor(param.getUsername(), Constants.LOGIN_FAIL, MessageUtils.message("user.not.exists"))); |
| | | throw new UserNotExistsException(); |
| | | } |
| | | |
| | | if (UserStatus.DELETED.getCode().equals(user.getDelFlag())) { |
| | | AsyncManager.me().execute(AsyncFactory.recordLogininfor(param.getUsername(), Constants.LOGIN_FAIL, MessageUtils.message("user.password.delete"))); |
| | | throw new UserDeleteException(); |
| | | } |
| | | |
| | | if (UserStatus.DISABLE.getCode().equals(user.getStatus())) { |
| | | AsyncManager.me().execute(AsyncFactory.recordLogininfor(param.getUsername(), Constants.LOGIN_FAIL, MessageUtils.message("user.blocked"))); |
| | | throw new UserBlockedException(); |
| | | } |
| | | |
| | | passwordService.validate(user, param.getPassword()); |
| | | |
| | | AsyncManager.me().execute(AsyncFactory.recordLogininfor(param.getUsername(), Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success"))); |
| | | PUserDto phoneUserDto = new PUserDto(); |
| | | //è®¾ç½®ç¨æ·ä¿¡æ¯ |
| | | phoneUserDto.setCname(user.getUserName()); |
| | | phoneUserDto.setMobile(user.getPhonenumber()); |
| | | phoneUserDto.setUsername(user.getLoginName()); |
| | | phoneUserDto.setTokenAuth(UUID.randomUUID().toString().replaceAll("-", "")); |
| | | |
| | | //设置AuthUserä¿¡æ¯å°ç¼å |
| | | AuthUser authUser = new AuthUser(); |
| | | authUser.setCompanyId(user.getCompanyId()); |
| | | authUser.setUsername(user.getLoginName()); |
| | | authUser.setCname(user.getUserName()); |
| | | authUser.setEmail(user.getEmail()); |
| | | authUser.setMobile(user.getPhonenumber()); |
| | | //设置ç»å½ç¨æ·æå±ååºä¿¡æ¯ |
| | | SysDept dept = deptService.getCacheDept(user.getCompanyId(),user.getDeptId().toString()); |
| | | |
| | | phoneUserDto.setCompanyId(authUser.getCompanyId()); |
| | | phoneUserDto.setDeptId(dept.getDeptId().toString()); |
| | | phoneUserDto.setDeptName(dept.getDeptName()); |
| | | phoneUserDto.setType(dept.getType()); |
| | | |
| | | redisUtil.setCacheObject(PhoneUtil.createKey(phoneUserDto.getTokenAuth()), |
| | | authUser, 60 * 60 * 24, TimeUnit.SECONDS); |
| | | return PhoneRespUtil.success(phoneUserDto, req); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.fzzy.common.constant.RespCodeEnum; |
| | | import com.fzzy.igds.app.v1.constant.PhoneConstant; |
| | | import com.fzzy.igds.app.v1.data.AuthUser; |
| | | import com.fzzy.igds.app.v1.data.ParamCommon; |
| | | import com.fzzy.igds.app.v1.data.PhoneRequest; |
| | | import com.fzzy.igds.app.v1.data.PhoneResponse; |
| | | import com.fzzy.igds.app.v1.service.PhoneService; |
| | | import com.fzzy.igds.app.v1.util.PhoneRespUtil; |
| | | import com.fzzy.igds.domain.Dept; |
| | | import com.fzzy.igds.service.CoreDeptService; |
| | | import com.fzzy.igds.service.SysDeptService; |
| | | import com.ruoyi.common.core.domain.entity.SysDept; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * è·ååºåºåè¡¨ä¿¡æ¯ |
| | | * |
| | | * @author chen |
| | | */ |
| | | @Service |
| | | public class ServiceImpl5002 implements PhoneService { |
| | | |
| | | @Autowired |
| | | private CoreDeptService deptService; |
| | | |
| | | @Override |
| | | public String getInterfaceId() { |
| | | return PhoneConstant.API_PHONE_5002; |
| | | } |
| | | |
| | | @SuppressWarnings("unchecked") |
| | | @Override |
| | | public PhoneResponse<Object> execute(PhoneRequest<JSONObject> req, AuthUser authUser) |
| | | throws Exception { |
| | | |
| | | //转å为对象 |
| | | ParamCommon param = JSONObject.parseObject(req.getData().toString(), ParamCommon.class); |
| | | |
| | | if (null == param || StringUtils.isEmpty(param.getCompanyId())) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "åæ°æè¯¯ï¼è¯·æ ¸æ¥ï¼"); |
| | | } |
| | | |
| | | |
| | | List<Dept> deptList = deptService.getDeptByUserTypeApp(null,authUser.getDeptId()); |
| | | |
| | | |
| | | if (null == deptList || deptList.isEmpty()) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_2000, "æªè·åå°åºåºå表信æ¯ï¼"); |
| | | } |
| | | |
| | | return PhoneRespUtil.success(deptList, req); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.fzzy.common.constant.RespCodeEnum; |
| | | import com.fzzy.igds.app.v1.constant.PhoneConstant; |
| | | import com.fzzy.igds.app.v1.data.AuthUser; |
| | | import com.fzzy.igds.app.v1.data.ParamOrder; |
| | | import com.fzzy.igds.app.v1.data.PhoneRequest; |
| | | import com.fzzy.igds.app.v1.data.PhoneResponse; |
| | | import com.fzzy.igds.app.v1.dto.PWorkOrderDto; |
| | | import com.fzzy.igds.app.v1.service.PhoneService; |
| | | import com.fzzy.igds.app.v1.util.PhoneRespUtil; |
| | | import com.fzzy.igds.constant.Constant; |
| | | import com.fzzy.igds.service.SysDeptService; |
| | | import com.fzzy.igds.service.SysUserService; |
| | | import com.fzzy.igds.utils.ContextUtil; |
| | | import com.fzzy.work.data.WorkBizType; |
| | | import com.fzzy.work.data.WorkNode; |
| | | import com.fzzy.work.data.WorkOrderParam; |
| | | import com.fzzy.work.data.WorkStatus; |
| | | import com.fzzy.work.domain.WorkOrder; |
| | | import com.fzzy.work.mapper.WorkOrderMapper; |
| | | import com.fzzy.work.service.WorkOrderService; |
| | | import com.ruoyi.common.core.domain.entity.SysDept; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author: YYC |
| | | * @Description: å·¥å管ç-æ¥è¯¢å·¥åå表 |
| | | * @DateTime: 2026-1-12 14:43 |
| | | **/ |
| | | @Service |
| | | public class ServiceImpl5101 implements PhoneService { |
| | | @Resource |
| | | private WorkOrderMapper workOrderMapper; |
| | | @Autowired |
| | | private SysDeptService deptService; |
| | | @Autowired |
| | | private SysUserService userService; |
| | | |
| | | @Override |
| | | public String getInterfaceId() { |
| | | return PhoneConstant.API_PHONE_5101; |
| | | } |
| | | |
| | | @Override |
| | | public PhoneResponse execute(PhoneRequest<JSONObject> req, AuthUser authUser) throws Exception { |
| | | //转å对象 |
| | | ParamOrder param = JSONObject.parseObject(req.getData().toString(), ParamOrder.class); |
| | | if (null == param) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "åæ°æè¯¯ï¼è¯·éè¯ï¼ï¼"); |
| | | } |
| | | //åæ°éªè¯ |
| | | if (StringUtils.isEmpty(param.getDeptId())) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "åæ°æè¯¯ï¼è¯·éè¯ï¼ï¼"); |
| | | } |
| | | |
| | | param.setCompanyId(authUser.getCompanyId()); |
| | | QueryWrapper<WorkOrder> queryWrapper = new QueryWrapper<>(); |
| | | // queryWrapper.eq(null != param.getStatus(), "status", WorkStatus.STATUS_30.getCode()); |
| | | String scope = WorkOrderParam.SCOPE_SELF; |
| | | SysUser user = userService.getUserByLoginName(authUser.getUsername()); |
| | | this.updateQueryWrapper(queryWrapper, user, scope); |
| | | List<WorkOrder> list = workOrderMapper.selectList(queryWrapper); |
| | | SysDept dept = deptService.getCacheDept(param.getCompanyId(), param.getDeptId().toString()); |
| | | List<PWorkOrderDto> reqList = new ArrayList<>(); |
| | | PWorkOrderDto orderDto; |
| | | if (null != dept) { |
| | | for (WorkOrder workOrder : list) { |
| | | orderDto = new PWorkOrderDto(); |
| | | BeanUtils.copyProperties(workOrder, orderDto); |
| | | orderDto.setDeptName(dept.getDeptName()); |
| | | orderDto.setBizTypeName(WorkBizType.getMsg(workOrder.getBizType())); |
| | | reqList.add(orderDto); |
| | | } |
| | | } |
| | | return PhoneRespUtil.success(reqList, req); |
| | | } |
| | | |
| | | |
| | | private void updateQueryWrapper(QueryWrapper<WorkOrder> queryWrapper, SysUser user, String scope) { |
| | | |
| | | queryWrapper.eq("company_id", user.getCompanyId()); |
| | | |
| | | //妿æ¯ä¸ªäººå·¥åï¼å¤ç人为空æè
为å½å人 |
| | | if (WorkOrderParam.SCOPE_SELF.equals(scope)) { |
| | | queryWrapper.and((wrapper)->{ |
| | | wrapper.isNull("assignee_id").or().eq("assignee_id", user.getLoginName()); |
| | | }); |
| | | } |
| | | |
| | | //çç®¡ç¨æ·-æ¥çææåºåºåå¾
å |
| | | if (Constant.USER_TYPE_10.equals(user.getUserType())) { |
| | | if (WorkOrderParam.SCOPE_SELF.equals(scope)) { |
| | | queryWrapper.eq("node", WorkNode.NODE2.getCode()); |
| | | } |
| | | } |
| | | |
| | | //åºåºç¨æ·ï¼å¦ææ¯å
¬å¸ç¨æ·å¯ä»¥æ¥çå
¬å¸ä¸å±ææåºåºï¼å¦æä¸ºå½ååºåºåªæ¥è¯¢å½ååºåº |
| | | if (Constant.USER_TYPE_30.equals(user.getUserType())) { |
| | | if (ContextUtil.isDepotUser(user.getDeptId() + "")) { |
| | | queryWrapper.eq("dept_id", user.getDeptId() + ""); |
| | | } else { |
| | | queryWrapper.likeRight("dept_id", user.getDeptId() + ""); |
| | | } |
| | | if (WorkOrderParam.SCOPE_SELF.equals(scope)) { |
| | | queryWrapper.eq("node", WorkNode.NODE1.getCode()); |
| | | } |
| | | |
| | | } |
| | | |
| | | //é¶è¡ç¨æ·ï¼æ ¹æ®ååæ¥è¯¢é¶è¡ä¸ææåºåº |
| | | if (Constant.USER_TYPE_20.equals(user.getUserType())) { |
| | | //å¦ææ²¡æé
ç½®é¶è¡ï¼è®¾ç½®ä¸ä¸ªä¸åå¨çé¶è¡å· |
| | | if (StringUtils.isBlank(user.getUserData())) user.setUserData("9"); |
| | | queryWrapper.eq("bank_id", user.getUserData()); |
| | | if (WorkOrderParam.SCOPE_SELF.equals(scope)) { |
| | | queryWrapper.eq("node", WorkNode.NODE3.getCode()); |
| | | } |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.fzzy.common.constant.RespCodeEnum; |
| | | import com.fzzy.igds.app.v1.constant.PhoneConstant; |
| | | import com.fzzy.igds.app.v1.data.AuthUser; |
| | | import com.fzzy.igds.app.v1.data.ParamOrder; |
| | | import com.fzzy.igds.app.v1.data.PhoneRequest; |
| | | import com.fzzy.igds.app.v1.data.PhoneResponse; |
| | | import com.fzzy.igds.app.v1.mapper.PhoneMapper; |
| | | import com.fzzy.igds.app.v1.service.PhoneService; |
| | | import com.fzzy.igds.app.v1.util.PhoneRespUtil; |
| | | import com.fzzy.igds.constant.Constant; |
| | | import com.fzzy.igds.data.BaseResp; |
| | | import com.fzzy.igds.utils.ContextUtil; |
| | | import com.fzzy.work.data.WorkNode; |
| | | import com.fzzy.work.data.WorkStatus; |
| | | import com.fzzy.work.domain.WorkOrder; |
| | | import com.fzzy.work.domain.WorkOrderConf; |
| | | import com.fzzy.work.domain.WorkOrderProcess; |
| | | import com.fzzy.work.mapper.WorkOrderMapper; |
| | | import com.fzzy.work.service.WorkOrderConfService; |
| | | import com.fzzy.work.service.WorkOrderProcessService; |
| | | import com.fzzy.work.service.WorkOrderService; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Author: YYC |
| | | * @Description: å·¥å管ç-å·¥åå®¡æ ¸ |
| | | * @DateTime: 2026-1-12 14:43 |
| | | **/ |
| | | @Service |
| | | public class ServiceImpl5102 implements PhoneService { |
| | | |
| | | @Resource |
| | | private WorkOrderService orderService; |
| | | @Resource |
| | | private WorkOrderConfService confService; |
| | | @Resource |
| | | private WorkOrderProcessService orderProcessService; |
| | | |
| | | |
| | | @Override |
| | | public String getInterfaceId() { |
| | | return PhoneConstant.API_PHONE_5102; |
| | | } |
| | | |
| | | @Override |
| | | public PhoneResponse<Object> execute(PhoneRequest<JSONObject> req, AuthUser authUser) throws Exception { |
| | | //转å对象 |
| | | ParamOrder param = JSONObject.parseObject(req.getData().toString(), ParamOrder.class); |
| | | if (null == param) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "åæ°æè¯¯ï¼è¯·éè¯ï¼ï¼"); |
| | | } |
| | | //åæ°éªè¯ |
| | | if (StringUtils.isEmpty(param.getDeptId())) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "åæ°æè¯¯ï¼è¯·éè¯ï¼ï¼"); |
| | | } |
| | | //è·åå·¥å |
| | | WorkOrder work = orderService.selectById(param.getOrderId()); |
| | | if (null == work) return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "å½åå·¥åå·²ä¸åå¨"); |
| | | |
| | | if (work.getStatus().equals(WorkStatus.STATUS_50.getCode()) |
| | | || work.getStatus().equals(WorkStatus.STATUS_60.getCode())) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "å½åå·¥åå·²å¤çï¼è¯·å·æ°é¡µé¢éè¯ï¼ï¼"); |
| | | } |
| | | WorkOrderProcess process = new WorkOrderProcess(); |
| | | BeanUtils.copyProperties(param, process); |
| | | //夿æ¯ä¸æ¯æå®å¤ç人 |
| | | if (StringUtils.isNotEmpty(work.getAssigneeId())) { |
| | | if (!work.getAssigneeId().equals(authUser.getUsername())) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "å½åå·¥åå·²åé
å
¶ä»äººå¤çï¼è¯·å¿å¤ç"); |
| | | } |
| | | } |
| | | |
| | | String curNode = process.getNode(); |
| | | //è·åå¤ç人 |
| | | if (!curNode.equals(work.getNode())) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "å½åå·¥å已被å¤çï¼è¯·å·æ°é¡µé¢éè¯ï¼ï¼"); |
| | | } |
| | | |
| | | //è·åé
ç½®ä¿¡æ¯ |
| | | WorkOrderConf conf = confService.selectById(work.getConfId()); |
| | | if (null == conf) PhoneRespUtil.error(RespCodeEnum.CODE_1111, "å½åå·¥åæªé
ç½®æµç¨"); |
| | | |
| | | |
| | | //æ·»å è®°å½ |
| | | process.setId(ContextUtil.UUID()); |
| | | process.setCreateTime(new Date()); |
| | | process.setOrderId(work.getId()); |
| | | process.setAssigneeName(authUser.getCname()); |
| | | process.setAssigneeId(authUser.getUsername()); |
| | | |
| | | WorkNode nextNode = this.getNextNode(work.getNode(), conf); |
| | | |
| | | //éè¿æä½ |
| | | if ("pass".equals(param.getStatus())) { |
| | | process.setAction("éè¿"); |
| | | process.setNode(work.getNode()); |
| | | //ç»æå¤æï¼å¦ææ¯ç»æèç¹ï¼åç»æå·¥å |
| | | if (WorkNode.NODE_END.getCode().equals(nextNode.getCode())) { |
| | | work.setStatus(WorkStatus.STATUS_50.getCode()); |
| | | work.setAssigneeName(process.getAssigneeName()); |
| | | work.setAssigneeId(process.getAssigneeId()); |
| | | work.setNode(nextNode.getCode()); |
| | | orderService.complete(work); |
| | | } else { |
| | | work.setNode(nextNode.getCode()); |
| | | work.setStatus(WorkStatus.STATUS_30.getCode()); |
| | | orderService.updateData(work); |
| | | } |
| | | |
| | | //å¢å 审æ¹è®°å½ |
| | | orderProcessService.addData(process, WorkNode.NODE_END.equals(nextNode)); |
| | | return PhoneRespUtil.success(RespCodeEnum.CODE_0000.getCode(), req); |
| | | } |
| | | |
| | | //æç»æä½ |
| | | if ("refuse".equals(param.getStatus())) { |
| | | process.setAction("æç»"); |
| | | process.setNode(work.getNode()); |
| | | |
| | | work.setStatus(WorkStatus.STATUS_60.getCode()); |
| | | |
| | | orderService.complete(work); |
| | | |
| | | //å¢å 审æ¹è®°å½ |
| | | orderProcessService.addData(process, true); |
| | | |
| | | return PhoneRespUtil.success(RespCodeEnum.CODE_0000.getCode(), req); |
| | | } |
| | | |
| | | return PhoneRespUtil.success(RespCodeEnum.CODE_0000.getCode(), req); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ ¹æ®å½åèç¹è·åä¸ä¸ä¸ªèç¹ |
| | | * |
| | | * @param curNode |
| | | * @param conf |
| | | * @return |
| | | */ |
| | | private WorkNode getNextNode(String curNode, WorkOrderConf conf) { |
| | | |
| | | if (null == conf) return WorkNode.NODE_END; |
| | | |
| | | if (WorkNode.NODE_START.getCode().equals(curNode)) { |
| | | if (Constant.YN_Y.equals(conf.getNodeVal1())) return WorkNode.NODE1; |
| | | if (Constant.YN_Y.equals(conf.getNodeVal2())) return WorkNode.NODE2; |
| | | if (Constant.YN_Y.equals(conf.getNodeVal3())) return WorkNode.NODE3; |
| | | } |
| | | |
| | | if (WorkNode.NODE1.getCode().equals(curNode)) { |
| | | if (Constant.YN_Y.equals(conf.getNodeVal2())) return WorkNode.NODE2; |
| | | if (Constant.YN_Y.equals(conf.getNodeVal3())) return WorkNode.NODE3; |
| | | } |
| | | |
| | | if (WorkNode.NODE2.getCode().equals(curNode)) { |
| | | if (Constant.YN_Y.equals(conf.getNodeVal3())) return WorkNode.NODE3; |
| | | } |
| | | |
| | | return WorkNode.NODE_END; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.fzzy.common.constant.RespCodeEnum; |
| | | import com.fzzy.igds.app.v1.constant.PhoneConstant; |
| | | import com.fzzy.igds.app.v1.data.AuthUser; |
| | | import com.fzzy.igds.app.v1.data.ParamOrder; |
| | | import com.fzzy.igds.app.v1.data.PhoneRequest; |
| | | import com.fzzy.igds.app.v1.data.PhoneResponse; |
| | | import com.fzzy.igds.app.v1.service.PhoneService; |
| | | import com.fzzy.igds.app.v1.util.PhoneRespUtil; |
| | | import com.fzzy.igds.constant.Constant; |
| | | import com.fzzy.igds.domain.Camera; |
| | | import com.fzzy.igds.mapper.CameraMapper; |
| | | import com.fzzy.igds.service.SecCameraService; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author: YYC |
| | | * @Description: è§é¢ç管-çæ§å表 |
| | | * @DateTime: 2026-1-12 14:43 |
| | | **/ |
| | | @Service |
| | | public class ServiceImpl5103 implements PhoneService { |
| | | |
| | | @Resource |
| | | private CameraMapper cameraMapper; |
| | | |
| | | @Override |
| | | public String getInterfaceId() { |
| | | return PhoneConstant.API_PHONE_5103; |
| | | } |
| | | |
| | | @Override |
| | | public PhoneResponse<Object> execute(PhoneRequest<JSONObject> req, AuthUser authUser) throws Exception { |
| | | |
| | | //转å对象 |
| | | ParamOrder param = JSONObject.parseObject(req.getData().toString(), ParamOrder.class); |
| | | if (null == param) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "åæ°æè¯¯ï¼è¯·éè¯ï¼ï¼"); |
| | | } |
| | | //åæ°éªè¯ |
| | | if (StringUtils.isEmpty(param.getDeptId())) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "åæ°æè¯¯ï¼è¯·éè¯ï¼ï¼"); |
| | | } |
| | | QueryWrapper<Camera> queryWrapper = new QueryWrapper<>(); |
| | | |
| | | if (StringUtils.isNotBlank(authUser.getCompanyId())) { |
| | | queryWrapper.eq("company_id", authUser.getCompanyId()); |
| | | } |
| | | if (StringUtils.isNotBlank(param.getDeptId())) { |
| | | queryWrapper.likeRight("dept_id", param.getDeptId()); |
| | | } |
| | | List<Camera> list = cameraMapper.selectList(queryWrapper); |
| | | |
| | | if (list == null || list.isEmpty()) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_2000, "æ²¡ææ¥å°çæ§è®¾å¤ä¿¡æ¯ï¼"); |
| | | } |
| | | |
| | | //è¿æ»¤ææºæ¾ç¤º |
| | | List<Camera> result = new ArrayList<>(); |
| | | for (Camera secCameraDto : list) { |
| | | if (StringUtils.isNotEmpty(secCameraDto.getPhoneShowTag()) && Constant.YN_Y.equals(secCameraDto.getPhoneShowTag())) { |
| | | result.add(secCameraDto); |
| | | } |
| | | } |
| | | return PhoneRespUtil.success(list, req); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.fzzy.common.constant.RespCodeEnum; |
| | | import com.fzzy.igds.app.v1.constant.PhoneConstant; |
| | | import com.fzzy.igds.app.v1.data.*; |
| | | import com.fzzy.igds.app.v1.service.PhoneService; |
| | | import com.fzzy.igds.app.v1.util.PhoneRespUtil; |
| | | import com.fzzy.igds.camera.ApiCameraManager; |
| | | import com.fzzy.igds.camera.data.ApiCameraData; |
| | | import com.fzzy.igds.camera.data.ApiCameraResp; |
| | | import com.fzzy.igds.domain.Camera; |
| | | import com.fzzy.igds.service.SecCameraService; |
| | | import com.fzzy.igds.utils.ContextUtil; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author: YYC |
| | | * @Description: è§é¢ç管-çæ§ææ¾ |
| | | * @DateTime: 2026-1-12 14:43 |
| | | **/ |
| | | @Service |
| | | public class ServiceImpl5104 implements PhoneService { |
| | | |
| | | @Autowired |
| | | private SecCameraService secCameraService; |
| | | @Resource |
| | | private ApiCameraManager apiCameraManager; |
| | | |
| | | @Override |
| | | public String getInterfaceId() { |
| | | return PhoneConstant.API_PHONE_5104; |
| | | } |
| | | |
| | | @Override |
| | | public PhoneResponse<Object> execute(PhoneRequest<JSONObject> req, AuthUser authUser) throws Exception { |
| | | //转å对象 |
| | | ParamVideo param = JSONObject.parseObject(req.getData().toString(), ParamVideo.class); |
| | | if (null == param) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "åæ°æè¯¯ï¼è¯·éè¯ï¼ï¼"); |
| | | } |
| | | //åæ°éªè¯ |
| | | if (StringUtils.isEmpty(param.getId())) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "åæ°æè¯¯ï¼è¯·éè¯ï¼ï¼"); |
| | | } |
| | | if ("DEFAULT".equals(param.getPlayType())) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1007, "ç³»ç»æªé
ç½®å½åæåå¤´ææ¾æ¹å¼ï¼ä¸æ§è¡é¢è§"); |
| | | } |
| | | if (com.ruoyi.common.utils.StringUtils.isEmpty(param.getId()) || com.ruoyi.common.utils.StringUtils.isEmpty(param.getPlayType())) { |
| | | |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1005, "没æè·åå°çæ§ä¿¡æ¯ï¼"); |
| | | } |
| | | |
| | | // æ ¹æ®idè·å设å¤ä¿¡æ¯ |
| | | Camera camera = secCameraService.getCameraById(ContextUtil.getCompanyId(), param.getId()); |
| | | if (null == camera) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1005, "ç¼å䏿²¡æè·åå°æå头信æ¯ï¼"); |
| | | } |
| | | |
| | | //éè¿ç»ä¸å
¥å£è·åææ¾å°å |
| | | ApiCameraData apiCameraData = new ApiCameraData(); |
| | | apiCameraData.setCompanyId(camera.getCompanyId()); |
| | | apiCameraData.setDeptId(camera.getDeptId()); |
| | | apiCameraData.setCameraId(camera.getId()); |
| | | apiCameraData.setIp(camera.getIp()); |
| | | apiCameraData.setCtrlPort(camera.getControlPort()); |
| | | apiCameraData.setWebPort(camera.getWebPort()); |
| | | apiCameraData.setPlayType(param.getPlayType()); |
| | | apiCameraData.setSnapType(camera.getSnapType()); |
| | | apiCameraData.setSn(camera.getSn()); |
| | | apiCameraData.setChannel(camera.getChanNum()); |
| | | apiCameraData.setLoginId(camera.getLoginId()); |
| | | apiCameraData.setPwd(camera.getPwd()); |
| | | apiCameraData.setUrlIn(camera.getUrlIn()); |
| | | apiCameraData.setUrlOut(camera.getUrlOut()); |
| | | apiCameraData.setMediaAddr(camera.getMediaAddr()); |
| | | ApiCameraResp resp = apiCameraManager.getApiCameraService(apiCameraData.getPlayType()).getPlayAddr(apiCameraData); |
| | | |
| | | return PhoneRespUtil.success(resp, req); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.fzzy.common.constant.RespCodeEnum; |
| | | import com.fzzy.common.utils.DateUtil; |
| | | import com.fzzy.igds.app.v1.constant.PhoneConstant; |
| | | import com.fzzy.igds.app.v1.data.AuthUser; |
| | | import com.fzzy.igds.app.v1.data.ParamPatrol; |
| | | import com.fzzy.igds.app.v1.data.PhoneRequest; |
| | | import com.fzzy.igds.app.v1.data.PhoneResponse; |
| | | import com.fzzy.igds.app.v1.dto.PPatrolDto; |
| | | import com.fzzy.igds.app.v1.service.PhoneService; |
| | | import com.fzzy.igds.app.v1.util.PhoneRespUtil; |
| | | import com.fzzy.igds.domain.Patrol; |
| | | import com.fzzy.igds.domain.PatrolRecord; |
| | | import com.fzzy.igds.mapper.PatrolMapper; |
| | | import com.fzzy.igds.service.PatrolService; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.commons.lang3.time.DateFormatUtils; |
| | | import org.apache.commons.lang3.time.DateUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author: YYC |
| | | * @Description: å·¡æ£ç管-çµåå·¡æ´è®°å½ |
| | | * @DateTime: 2026-1-12 14:43 |
| | | **/ |
| | | @Service |
| | | public class ServiceImpl5105 implements PhoneService { |
| | | |
| | | @Resource |
| | | private PatrolService patrolService; |
| | | |
| | | @Override |
| | | public String getInterfaceId() { |
| | | return PhoneConstant.API_PHONE_5105; |
| | | } |
| | | |
| | | @Override |
| | | public PhoneResponse<Object> execute(PhoneRequest<JSONObject> req, AuthUser authUser) throws Exception { |
| | | //转å对象 |
| | | ParamPatrol param = JSONObject.parseObject(req.getData().toString(), ParamPatrol.class); |
| | | if (null == param) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "åæ°æè¯¯ï¼è¯·éè¯ï¼ï¼"); |
| | | } |
| | | //åæ°éªè¯ |
| | | if (StringUtils.isEmpty(param.getDeptId())) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "åæ°æè¯¯ï¼è¯·éè¯ï¼ï¼"); |
| | | } |
| | | //åæ°éªè¯ |
| | | if (null == param.getDateTime()) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "åæ°æè¯¯ï¼è¯·éè¯ï¼ï¼"); |
| | | } |
| | | List<PatrolRecord> list = patrolService.getRecordByPatrolId(DateFormatUtils.format(param.getDateTime(), "yyyyMMdd")); |
| | | return PhoneRespUtil.success(list, req); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.fzzy.common.constant.RespCodeEnum; |
| | | import com.fzzy.igds.app.v1.constant.PhoneConstant; |
| | | import com.fzzy.igds.app.v1.data.AuthUser; |
| | | import com.fzzy.igds.app.v1.data.ParamPatrol; |
| | | import com.fzzy.igds.app.v1.data.PhoneRequest; |
| | | import com.fzzy.igds.app.v1.data.PhoneResponse; |
| | | import com.fzzy.igds.app.v1.service.PhoneService; |
| | | import com.fzzy.igds.app.v1.util.PhoneRespUtil; |
| | | import com.fzzy.igds.domain.Patrol; |
| | | import com.fzzy.igds.domain.PatrolConf; |
| | | import com.fzzy.igds.domain.PatrolRecord; |
| | | import com.fzzy.igds.mapper.PatrolConfMapper; |
| | | import com.fzzy.igds.mapper.PatrolMapper; |
| | | import com.fzzy.igds.mapper.PatrolRecordMapper; |
| | | import com.fzzy.igds.service.FileService; |
| | | import com.fzzy.igds.service.PatrolService; |
| | | import com.fzzy.igds.utils.ContextUtil; |
| | | import com.ruoyi.common.config.FrameworkConfig; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.commons.lang3.time.DateFormatUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author: YYC |
| | | * @Description: å·¡æ£ç管-çµåå·¡æ´æå¡ |
| | | * @DateTime: 2026-1-12 14:43 |
| | | **/ |
| | | @Service |
| | | public class ServiceImpl5106 implements PhoneService { |
| | | |
| | | @Resource |
| | | private PatrolConfMapper patrolConfMapper; |
| | | @Resource |
| | | private PatrolMapper patrolMapper; |
| | | @Resource |
| | | private PatrolRecordMapper patrolRecordMapper; |
| | | @Resource |
| | | private FileService fileService; |
| | | |
| | | |
| | | @Override |
| | | public String getInterfaceId() { |
| | | return PhoneConstant.API_PHONE_5106; |
| | | } |
| | | |
| | | @Override |
| | | public PhoneResponse<Object> execute(PhoneRequest<JSONObject> req, AuthUser authUser) throws Exception { |
| | | //转å对象 |
| | | ParamPatrol param = JSONObject.parseObject(req.getData().toString(), ParamPatrol.class); |
| | | if (null == param) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "åæ°æè¯¯ï¼è¯·éè¯ï¼ï¼"); |
| | | } |
| | | //åæ°éªè¯ |
| | | if (StringUtils.isEmpty(param.getDeptId())) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "åæ°æè¯¯ï¼è¯·éè¯ï¼ï¼"); |
| | | } |
| | | //åæ°éªè¯ |
| | | if (StringUtils.isEmpty(param.getLongitude())) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "åæ°æè¯¯ï¼è¯·éè¯ï¼ï¼"); |
| | | } |
| | | //åæ°éªè¯ |
| | | if (StringUtils.isEmpty(param.getLatitude())) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "åæ°æè¯¯ï¼è¯·éè¯ï¼ï¼"); |
| | | } |
| | | //åæ°éªè¯ |
| | | if (StringUtils.isEmpty(param.getUserName())) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "åæ°æè¯¯ï¼è¯·éè¯ï¼ï¼"); |
| | | } |
| | | PatrolRecord patrolRecord = new PatrolRecord(); |
| | | String longitude = param.getLongitude(); |
| | | String latitude = param.getLatitude(); |
| | | patrolRecord.setLongitude(longitude.substring(0, (longitude.indexOf(".") + 6))); |
| | | patrolRecord.setLatitude(latitude.substring(0, (latitude.indexOf(".") + 6))); |
| | | patrolRecord.setCreateTime(new Date()); |
| | | patrolRecord.setPatrolId(DateFormatUtils.format(patrolRecord.getCreateTime(), "yyyyMMdd")); |
| | | patrolRecord.setId(ContextUtil.generateId()); |
| | | patrolRecord.setCompanyId(authUser.getCompanyId()); |
| | | patrolRecord.setCreateBy(authUser.getCname()); |
| | | patrolRecord.setUpdateTime(new Date()); |
| | | patrolRecord.setUpdateBy(authUser.getCname()); |
| | | String path = fileService.getFileSavePath("PATROL") + param.getImgName(); |
| | | patrolRecord.setImgName(path.replace(FrameworkConfig.getProfile(), "/profile/")); |
| | | |
| | | QueryWrapper<Patrol> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("id", patrolRecord.getPatrolId()); |
| | | List<Patrol> patrolList = patrolMapper.selectList(queryWrapper); |
| | | if (null == patrolList) { |
| | | Patrol patrol = new Patrol(); |
| | | patrol.setId(patrolRecord.getPatrolId()); |
| | | |
| | | patrol.setDeptId(authUser.getDeptId()); |
| | | patrol.setUserId(authUser.getUsername()); |
| | | patrol.setUserName(authUser.getCname()); |
| | | patrol.setCompanyId(authUser.getCompanyId()); |
| | | patrol.setCreateBy(authUser.getCname()); |
| | | patrol.setCreateTime(new Date()); |
| | | patrol.setUpdateBy(authUser.getCname()); |
| | | patrol.setUpdateTime(new Date()); |
| | | |
| | | QueryWrapper<PatrolConf> queryConfWrapper = new QueryWrapper<>(); |
| | | queryConfWrapper.ge("start", new Date()); |
| | | queryConfWrapper.le("end", new Date()); |
| | | queryConfWrapper.eq("company_id", authUser.getCompanyId()); |
| | | queryConfWrapper.eq("dept_id", authUser.getDeptId()); |
| | | List<PatrolConf> confList = patrolConfMapper.selectList(queryConfWrapper); |
| | | if (null == confList) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1007, "请填åç¸å
³ççæ¬¡ä¿¡æ¯ï¼ï¼"); |
| | | } |
| | | PatrolConf patrolConf = confList.get(0); |
| | | patrol.setConfId(patrolConf.getId()); |
| | | patrol.setConfName(patrolConf.getName()); |
| | | |
| | | int insert = patrolMapper.insert(patrol); |
| | | if (insert > 0) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1007, "ä¿å失败ï¼ï¼"); |
| | | } |
| | | } |
| | | int insert = patrolRecordMapper.insert(patrolRecord); |
| | | if (insert > 0) { |
| | | return PhoneRespUtil.success(RespCodeEnum.CODE_0000, req); |
| | | } |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1007, "ä¿å失败ï¼ï¼"); |
| | | |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.fzzy.common.constant.RespCodeEnum; |
| | | import com.fzzy.common.utils.Base64Util; |
| | | import com.fzzy.igds.app.v1.constant.PhoneConstant; |
| | | import com.fzzy.igds.app.v1.data.AuthUser; |
| | | import com.fzzy.igds.app.v1.data.ParamPatrol; |
| | | import com.fzzy.igds.app.v1.data.PhoneRequest; |
| | | import com.fzzy.igds.app.v1.data.PhoneResponse; |
| | | import com.fzzy.igds.app.v1.service.PhoneService; |
| | | import com.fzzy.igds.app.v1.util.PhoneRespUtil; |
| | | import com.fzzy.igds.domain.PatrolRecord; |
| | | import com.fzzy.igds.mapper.PatrolRecordMapper; |
| | | import com.fzzy.igds.service.FileService; |
| | | import com.ruoyi.common.config.FrameworkConfig; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author: YYC |
| | | * @Description: å·¡æ£ç管-å·¡æ´ç
§çæ¥ç |
| | | * @DateTime: 2026-1-12 14:43 |
| | | **/ |
| | | @Service |
| | | public class ServiceImpl5107 implements PhoneService { |
| | | |
| | | @Resource |
| | | private PatrolRecordMapper patrolRecordMapper; |
| | | @Resource |
| | | private FileService fileService; |
| | | |
| | | @Override |
| | | public String getInterfaceId() { |
| | | return PhoneConstant.API_PHONE_5107; |
| | | } |
| | | |
| | | @Override |
| | | public PhoneResponse<Object> execute(PhoneRequest<JSONObject> req, AuthUser authUser) throws Exception { |
| | | //转å对象 |
| | | ParamPatrol param = JSONObject.parseObject(req.getData().toString(), ParamPatrol.class); |
| | | if (null == param) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "åæ°æè¯¯ï¼è¯·éè¯ï¼ï¼"); |
| | | } |
| | | //åæ°éªè¯ |
| | | if (StringUtils.isEmpty(param.getId())) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "åæ°æè¯¯ï¼è¯·éè¯ï¼ï¼"); |
| | | } |
| | | param.setCompanyId(authUser.getCompanyId()); |
| | | PatrolRecord patrolRecord = patrolRecordMapper.selectById(param.getId()); |
| | | if (StringUtils.isNotEmpty(patrolRecord.getImgName())) { |
| | | String imgData = Base64Util.getImageStr(patrolRecord.getImgName().replace("/profile/", FrameworkConfig.getProfile())); |
| | | patrolRecord.setImgName(imgData); |
| | | } |
| | | return PhoneRespUtil.success(patrolRecord, req); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.fzzy.common.constant.RespCodeEnum; |
| | | import com.fzzy.igds.app.v1.constant.PhoneConstant; |
| | | import com.fzzy.igds.app.v1.data.AuthUser; |
| | | import com.fzzy.igds.app.v1.data.ParamPatrol; |
| | | import com.fzzy.igds.app.v1.data.PhoneRequest; |
| | | import com.fzzy.igds.app.v1.data.PhoneResponse; |
| | | import com.fzzy.igds.app.v1.dto.PSnapDto; |
| | | import com.fzzy.igds.app.v1.service.PhoneService; |
| | | import com.fzzy.igds.app.v1.util.PhoneRespUtil; |
| | | import com.fzzy.igds.domain.Dept; |
| | | import com.fzzy.igds.domain.PatrolRecord; |
| | | import com.fzzy.igds.domain.SnapRecord; |
| | | import com.fzzy.igds.mapper.SnapRecordMapper; |
| | | import com.fzzy.igds.service.CoreDeptService; |
| | | import com.fzzy.igds.service.FileService; |
| | | import com.fzzy.igds.utils.ContextUtil; |
| | | import com.fzzy.igds.utils.DateUtil; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.commons.lang3.time.DateFormatUtils; |
| | | import org.apache.commons.lang3.time.DateUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author: YYC |
| | | * @Description: ææç®¡ç-ææè®°å½å表 |
| | | * @DateTime: 2026-1-12 14:43 |
| | | **/ |
| | | @Service |
| | | public class ServiceImpl5108 implements PhoneService { |
| | | |
| | | @Resource |
| | | private SnapRecordMapper snapRecordMapper; |
| | | @Resource |
| | | private CoreDeptService deptService; |
| | | |
| | | |
| | | @Override |
| | | public String getInterfaceId() { |
| | | return PhoneConstant.API_PHONE_5108; |
| | | } |
| | | |
| | | @Override |
| | | public PhoneResponse<Object> execute(PhoneRequest<JSONObject> req, AuthUser authUser) throws Exception { |
| | | //转å对象 |
| | | ParamPatrol param = JSONObject.parseObject(req.getData().toString(), ParamPatrol.class); |
| | | if (null == param) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "åæ°æè¯¯ï¼è¯·éè¯ï¼ï¼"); |
| | | } |
| | | //åæ°éªè¯ |
| | | if (StringUtils.isEmpty(param.getDeptId())) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "åæ°æè¯¯ï¼è¯·éè¯ï¼ï¼"); |
| | | } |
| | | //åæ°éªè¯ |
| | | if (null == param.getDateTime()) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "åæ°æè¯¯ï¼è¯·éè¯ï¼ï¼"); |
| | | } |
| | | QueryWrapper<SnapRecord> queryWrapper = new QueryWrapper<>(); |
| | | |
| | | param.setCompanyId(ContextUtil.getCompanyId()); |
| | | queryWrapper.eq("company_id", param.getCompanyId()); |
| | | queryWrapper.likeRight("dept_id", param.getDeptId()); |
| | | queryWrapper.ge("snap_time", DateUtil.getCurZero(param.getDateTime())); |
| | | queryWrapper.le("snap_time", DateUtil.getNextZero(param.getDateTime())); |
| | | |
| | | List<SnapRecord> list = snapRecordMapper.selectList(queryWrapper); |
| | | PSnapDto snapDto; |
| | | Dept dept; |
| | | List<PSnapDto> snapDtoList = new ArrayList<>(); |
| | | for (SnapRecord snapRecord:list){ |
| | | snapDto = new PSnapDto(); |
| | | BeanUtils.copyProperties(snapRecord,snapDto); |
| | | dept = deptService.getDeptById(snapRecord.getDeptId()); |
| | | snapDto.setDeptName(dept.getKqmc()); |
| | | snapDtoList.add(snapDto); |
| | | } |
| | | return PhoneRespUtil.success(snapDtoList, req); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.fzzy.common.constant.RespCodeEnum; |
| | | import com.fzzy.common.utils.Base64Util; |
| | | import com.fzzy.igds.app.v1.constant.PhoneConstant; |
| | | import com.fzzy.igds.app.v1.data.AuthUser; |
| | | import com.fzzy.igds.app.v1.data.ParamPatrol; |
| | | import com.fzzy.igds.app.v1.data.PhoneRequest; |
| | | import com.fzzy.igds.app.v1.data.PhoneResponse; |
| | | import com.fzzy.igds.app.v1.service.PhoneService; |
| | | import com.fzzy.igds.app.v1.util.PhoneRespUtil; |
| | | import com.fzzy.igds.domain.PatrolRecord; |
| | | import com.fzzy.igds.domain.SnapRecord; |
| | | import com.fzzy.igds.mapper.SnapRecordMapper; |
| | | import com.fzzy.igds.service.FileService; |
| | | import com.ruoyi.common.config.FrameworkConfig; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @Author: YYC |
| | | * @Description: ææç®¡ç-ææç
§çæ¥ç |
| | | * @DateTime: 2026-1-12 14:43 |
| | | **/ |
| | | @Service |
| | | public class ServiceImpl5109 implements PhoneService { |
| | | |
| | | @Resource |
| | | private SnapRecordMapper snapRecordMapper; |
| | | @Resource |
| | | private FileService fileService; |
| | | |
| | | @Override |
| | | public String getInterfaceId() { |
| | | return PhoneConstant.API_PHONE_5109; |
| | | } |
| | | |
| | | @Override |
| | | public PhoneResponse<Object> execute(PhoneRequest<JSONObject> req, AuthUser authUser) throws Exception { |
| | | //转å对象 |
| | | ParamPatrol param = JSONObject.parseObject(req.getData().toString(), ParamPatrol.class); |
| | | if (null == param) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "åæ°æè¯¯ï¼è¯·éè¯ï¼ï¼"); |
| | | } |
| | | //åæ°éªè¯ |
| | | if (StringUtils.isEmpty(param.getId())) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "åæ°æè¯¯ï¼è¯·éè¯ï¼ï¼"); |
| | | } |
| | | param.setCompanyId(authUser.getCompanyId()); |
| | | SnapRecord snapRecord = snapRecordMapper.selectById(param.getId()); |
| | | if (StringUtils.isNotEmpty(snapRecord.getImgName())) { |
| | | String imgData = Base64Util.getImageStr(snapRecord.getImgName().replace("/profile/", FrameworkConfig.getProfile())); |
| | | snapRecord.setImgName(imgData); |
| | | } |
| | | return PhoneRespUtil.success(snapRecord, req); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.fzzy.common.constant.RespCodeEnum; |
| | | import com.fzzy.igds.app.v1.constant.PhoneConstant; |
| | | import com.fzzy.igds.app.v1.data.AuthUser; |
| | | import com.fzzy.igds.app.v1.data.ParamPatrol; |
| | | import com.fzzy.igds.app.v1.data.PhoneRequest; |
| | | import com.fzzy.igds.app.v1.data.PhoneResponse; |
| | | import com.fzzy.igds.app.v1.dto.PEventInfoDto; |
| | | import com.fzzy.igds.app.v1.service.PhoneService; |
| | | import com.fzzy.igds.app.v1.util.PhoneRespUtil; |
| | | import com.fzzy.igds.domain.Dept; |
| | | import com.fzzy.igds.domain.EventInfo; |
| | | import com.fzzy.igds.domain.SnapRecord; |
| | | import com.fzzy.igds.mapper.EventInfoMapper; |
| | | import com.fzzy.igds.service.CoreDeptService; |
| | | import com.fzzy.igds.utils.ContextUtil; |
| | | import com.fzzy.igds.utils.DateUtil; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author: YYC |
| | | * @Description: AIäºä»¶ç®¡ç-AIè®°å½å表 |
| | | * @DateTime: 2026-1-12 14:43 |
| | | **/ |
| | | @Service |
| | | public class ServiceImpl5110 implements PhoneService { |
| | | |
| | | @Resource |
| | | private EventInfoMapper eventInfoMapper; |
| | | @Resource |
| | | private CoreDeptService deptService; |
| | | |
| | | @Override |
| | | public String getInterfaceId() { |
| | | return PhoneConstant.API_PHONE_5110; |
| | | } |
| | | |
| | | @Override |
| | | public PhoneResponse<Object> execute(PhoneRequest<JSONObject> req, AuthUser authUser) throws Exception { |
| | | //转å对象 |
| | | ParamPatrol param = JSONObject.parseObject(req.getData().toString(), ParamPatrol.class); |
| | | if (null == param) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "åæ°æè¯¯ï¼è¯·éè¯ï¼ï¼"); |
| | | } |
| | | //åæ°éªè¯ |
| | | if (StringUtils.isEmpty(param.getDeptId())) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "åæ°æè¯¯ï¼è¯·éè¯ï¼ï¼"); |
| | | } |
| | | //åæ°éªè¯ |
| | | if (null == param.getDateTime()) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "åæ°æè¯¯ï¼è¯·éè¯ï¼ï¼"); |
| | | } |
| | | QueryWrapper<EventInfo> queryWrapper = new QueryWrapper<>(); |
| | | |
| | | param.setCompanyId(ContextUtil.getCompanyId()); |
| | | queryWrapper.eq("company_id", param.getCompanyId()); |
| | | queryWrapper.likeRight("dept_id", param.getDeptId()); |
| | | queryWrapper.ge("time", DateUtil.getCurZero(param.getDateTime())); |
| | | queryWrapper.le("time", DateUtil.getNextZero(param.getDateTime())); |
| | | |
| | | List<EventInfo> list = eventInfoMapper.selectList(queryWrapper); |
| | | List<PEventInfoDto> dtoList = new ArrayList<>(); |
| | | PEventInfoDto eventInfoDto; |
| | | Dept dept; |
| | | for (EventInfo eventInfo:list){ |
| | | eventInfoDto = new PEventInfoDto(); |
| | | BeanUtils.copyProperties(eventInfo,eventInfoDto); |
| | | dept = deptService.getDeptById(eventInfo.getDeptId()); |
| | | eventInfoDto.setDeptName(dept.getKqmc()); |
| | | dtoList.add(eventInfoDto); |
| | | } |
| | | return PhoneRespUtil.success(dtoList, req); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.fzzy.common.constant.RespCodeEnum; |
| | | import com.fzzy.common.utils.Base64Util; |
| | | import com.fzzy.igds.app.v1.constant.PhoneConstant; |
| | | import com.fzzy.igds.app.v1.data.AuthUser; |
| | | import com.fzzy.igds.app.v1.data.ParamPatrol; |
| | | import com.fzzy.igds.app.v1.data.PhoneRequest; |
| | | import com.fzzy.igds.app.v1.data.PhoneResponse; |
| | | import com.fzzy.igds.app.v1.dto.PPatrolDto; |
| | | import com.fzzy.igds.app.v1.service.PhoneService; |
| | | import com.fzzy.igds.app.v1.util.PhoneRespUtil; |
| | | import com.fzzy.igds.domain.SnapRecord; |
| | | import com.ruoyi.common.config.FrameworkConfig; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @Author: YYC |
| | | * @Description: AIäºä»¶ç®¡ç-AIå·¡æ´ç
§çæ¥ç |
| | | * @DateTime: 2026-1-12 14:43 |
| | | **/ |
| | | @Service |
| | | public class ServiceImpl5111 implements PhoneService { |
| | | |
| | | @Override |
| | | public String getInterfaceId() { |
| | | return PhoneConstant.API_PHONE_5111; |
| | | } |
| | | |
| | | @Override |
| | | public PhoneResponse<Object> execute(PhoneRequest<JSONObject> req, AuthUser authUser) throws Exception { |
| | | //转å对象 |
| | | ParamPatrol param = JSONObject.parseObject(req.getData().toString(), ParamPatrol.class); |
| | | if (null == param) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "åæ°æè¯¯ï¼è¯·éè¯ï¼ï¼"); |
| | | } |
| | | //åæ°éªè¯ |
| | | if (StringUtils.isEmpty(param.getImgName())) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_2000, "æªæ¾å°ææç
§çï¼ï¼"); |
| | | } |
| | | PPatrolDto patrolDto = new PPatrolDto(); |
| | | if (StringUtils.isNotEmpty(param.getImgName())) { |
| | | String imgData = Base64Util.getImageStr(param.getImgName().replace("/profile/", FrameworkConfig.getProfile())); |
| | | patrolDto.setImgName(imgData); |
| | | } |
| | | |
| | | return PhoneRespUtil.success(patrolDto, req); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.fzzy.common.constant.RespCodeEnum; |
| | | import com.fzzy.igds.app.v1.constant.PhoneConstant; |
| | | import com.fzzy.igds.app.v1.data.AuthUser; |
| | | import com.fzzy.igds.app.v1.data.ParamCommon; |
| | | import com.fzzy.igds.app.v1.data.PhoneRequest; |
| | | import com.fzzy.igds.app.v1.data.PhoneResponse; |
| | | import com.fzzy.igds.app.v1.service.PhoneService; |
| | | import com.fzzy.igds.app.v1.util.PhoneRespUtil; |
| | | import com.fzzy.igds.domain.Depot; |
| | | import com.fzzy.igds.service.DepotService; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author: YYC |
| | | * @Description: ç²®æ
æ°æ®æ¥ç-仿¿å表 |
| | | * @DateTime: 2026-1-12 14:43 |
| | | **/ |
| | | @Service |
| | | public class ServiceImpl5201 implements PhoneService { |
| | | |
| | | @Resource |
| | | private DepotService depotService; |
| | | |
| | | @Override |
| | | public String getInterfaceId() { |
| | | return PhoneConstant.API_PHONE_5201; |
| | | } |
| | | |
| | | @Override |
| | | public PhoneResponse<Object> execute(PhoneRequest<JSONObject> req, AuthUser authUser) throws Exception { |
| | | |
| | | //转å为对象 |
| | | ParamCommon param = JSONObject.parseObject(req.getData().toString(), ParamCommon.class); |
| | | if (null == param || StringUtils.isEmpty(param.getDeptId())) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "åæ°æè¯¯ï¼è¯·æ ¸æ¥ï¼"); |
| | | } |
| | | |
| | | //è·åä»åºä¿¡æ¯ |
| | | List<Depot> depotList = depotService.getData(authUser.getCompanyId(), param.getDeptId(), false); |
| | | |
| | | if (null == depotList || depotList.isEmpty()) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "æªæ¥å°æ°æ®ï¼"); |
| | | } |
| | | |
| | | return PhoneRespUtil.success(depotList, req); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.fzzy.igds.app.v1.constant.PhoneConstant; |
| | | import com.fzzy.igds.app.v1.data.AuthUser; |
| | | import com.fzzy.igds.app.v1.data.PhoneRequest; |
| | | import com.fzzy.igds.app.v1.data.PhoneResponse; |
| | | import com.fzzy.igds.app.v1.service.PhoneService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @Author: YYC |
| | | * @Description: ç²®æ
æ°æ®æ¥ç-å¹³æ¿ä»ç²®æ
æ¥å£ |
| | | * @DateTime: 2026-1-12 14:43 |
| | | **/ |
| | | @Service |
| | | public class ServiceImpl5202 implements PhoneService { |
| | | |
| | | @Override |
| | | public String getInterfaceId() { |
| | | return PhoneConstant.API_PHONE_5202; |
| | | } |
| | | |
| | | @Override |
| | | public PhoneResponse<Object> execute(PhoneRequest<JSONObject> req, AuthUser authUser) throws Exception { |
| | | return null; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.fzzy.igds.app.v1.constant.PhoneConstant; |
| | | import com.fzzy.igds.app.v1.data.AuthUser; |
| | | import com.fzzy.igds.app.v1.data.PhoneRequest; |
| | | import com.fzzy.igds.app.v1.data.PhoneResponse; |
| | | import com.fzzy.igds.app.v1.service.PhoneService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @Author: YYC |
| | | * @Description: ç²®æ
æ°æ®æ¥ç-åçä»ç²®æ
æ¥å£ |
| | | * @DateTime: 2026-1-12 14:43 |
| | | **/ |
| | | @Service |
| | | public class ServiceImpl5203 implements PhoneService { |
| | | |
| | | @Override |
| | | public String getInterfaceId() { |
| | | return PhoneConstant.API_PHONE_5203; |
| | | } |
| | | |
| | | @Override |
| | | public PhoneResponse<Object> execute(PhoneRequest<JSONObject> req, AuthUser authUser) throws Exception { |
| | | return null; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.fzzy.common.constant.RespCodeEnum; |
| | | import com.fzzy.common.utils.DateUtil; |
| | | import com.fzzy.igds.app.v1.constant.PhoneConstant; |
| | | import com.fzzy.igds.app.v1.data.AuthUser; |
| | | import com.fzzy.igds.app.v1.data.ParamDepot; |
| | | import com.fzzy.igds.app.v1.data.PhoneRequest; |
| | | import com.fzzy.igds.app.v1.data.PhoneResponse; |
| | | import com.fzzy.igds.app.v1.dto.PDetailDto; |
| | | import com.fzzy.igds.app.v1.dto.PGrainDto; |
| | | import com.fzzy.igds.app.v1.dto.PPointDto; |
| | | import com.fzzy.igds.app.v1.service.PhoneService; |
| | | import com.fzzy.igds.app.v1.util.PhoneRespUtil; |
| | | import com.fzzy.igds.app.v1.util.PhoneUtil; |
| | | import com.fzzy.igds.data.GrainData; |
| | | import com.fzzy.igds.data.GrainLay; |
| | | import com.fzzy.igds.data.GrainParam; |
| | | import com.fzzy.igds.data.GrainPoint; |
| | | import com.fzzy.igds.domain.Depot; |
| | | import com.fzzy.igds.domain.DepotConf; |
| | | import com.fzzy.igds.domain.Grain; |
| | | import com.fzzy.igds.service.DepotConfService; |
| | | import com.fzzy.igds.service.DepotService; |
| | | import com.fzzy.igds.service.GrainService; |
| | | import com.fzzy.igds.utils.GrainDataBuilder; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.commons.lang3.time.DateUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author: YYC |
| | | * @Description: ç²®æ
æ°æ®æ¥ç-å岿°æ®(æ ¹æ®é¡µç æ¥è¯¢)æ¥å£ |
| | | * @DateTime: 2026-1-12 14:43 |
| | | **/ |
| | | @Service |
| | | public class ServiceImpl5204 implements PhoneService { |
| | | |
| | | @Autowired |
| | | private PhoneUtil phoneUtil; |
| | | @Autowired |
| | | private DepotService depotService; |
| | | @Autowired |
| | | private GrainService coreGrainService; |
| | | @Autowired |
| | | private DepotConfService depotConfService; |
| | | |
| | | @Override |
| | | public String getInterfaceId() { |
| | | return PhoneConstant.API_PHONE_5204; |
| | | } |
| | | |
| | | @Override |
| | | public PhoneResponse<Object> execute(PhoneRequest<JSONObject> req, AuthUser authUser) throws Exception { |
| | | ParamDepot param = JSONObject.parseObject(req.getData().toString(), ParamDepot.class); |
| | | if (null == param) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "åæ°æè¯¯ï¼è¯·éè¯ï¼ï¼"); |
| | | } |
| | | //åæ°éªè¯ |
| | | if (StringUtils.isEmpty(param.getDeptId()) || StringUtils.isEmpty(param.getDepotId()) || null == param.getDateTime()) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "åæ°æè¯¯ï¼è¯·éè¯ï¼ï¼"); |
| | | } |
| | | GrainParam grainParam = new GrainParam(); |
| | | grainParam.setDepotId(param.getDepotId()); |
| | | grainParam.setCompanyId(authUser.getCompanyId()); |
| | | Date date = DateUtils.parseDate(param.getDateTime(), "yyyy-MM"); |
| | | //设置æ¥è¯¢æ¶é´,æç第ä¸å¤©å°æåä¸å¤© |
| | | grainParam.setStart(DateUtil.getMonthFirst(date)); |
| | | grainParam.setEnd(DateUtil.getNextMonthFirst(date)); |
| | | grainParam.setDeptId(param.getDeptId()); |
| | | |
| | | //æ¥è¯¢ç²®æ
æ°æ® |
| | | List<Grain> list = coreGrainService.listData(grainParam); |
| | | Depot depot = depotService.getCacheDepot(authUser.getCompanyId(), param.getDepotId()); |
| | | if (null == list || list.isEmpty()) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1005, "该ä»åºææ ç²®æ
æ°æ®ï¼"); |
| | | } |
| | | |
| | | //è¿åæ°æ®å°è£
|
| | | List<PGrainDto> dtoList = new ArrayList<>(); |
| | | PGrainDto dto; |
| | | List<PPointDto> listPoints; |
| | | List<PDetailDto> listDetail; |
| | | PPointDto pointDto; |
| | | PDetailDto detailDto; |
| | | |
| | | DepotConf depotConf; |
| | | GrainData data; |
| | | Depot depotData; |
| | | List<GrainData> result = new ArrayList<>(); |
| | | for (Grain grain : list) { |
| | | depotConf = depotConfService.getCacheDepotConfByDepotId(grain.getCompanyId(), grain.getDepotId()); |
| | | data = new GrainData(); |
| | | BeanUtils.copyProperties(grain, data); |
| | | // æ·»å ä»åºä¿¡æ¯ |
| | | depotData = depotService.getCacheDepot(param.getCompanyId(), param.getDepotId()); |
| | | GrainDataBuilder.updateGrainData(data, depotConf, depotData.getDepotType()); |
| | | result.add(data); |
| | | } |
| | | for (GrainData grainData : result) { |
| | | dto = new PGrainDto(); |
| | | dto.setDepotId(grainData.getDepotId()); |
| | | dto.setDepotName(phoneUtil.getDepotName(authUser.getCompanyId(),dto.getDepotId())); |
| | | dto.setDepotType(depot.getDepotType()); |
| | | dto.setReceiveDate(grainData.getReceiveDate()); |
| | | dto.setTempIn(grainData.getTempIn()); |
| | | dto.setHumidityIn(grainData.getHumidityIn()); |
| | | dto.setTempOut(grainData.getTempOut()); |
| | | dto.setHumidityOut(grainData.getHumidityOut()); |
| | | dto.setTempMax(grainData.getTempMax()); |
| | | dto.setTempMin(grainData.getTempMin()); |
| | | dto.setTempAve(grainData.getTempAve()); |
| | | dto.setCable(grainData.getCable().replaceAll(",","-")); |
| | | if(StringUtils.isNotEmpty(grainData.getCableCir())){ |
| | | dto.setCableCir(grainData.getCableCir().replaceAll(",", "-")); |
| | | } |
| | | |
| | | listPoints = new ArrayList<>(); |
| | | for (GrainPoint point : grainData.getListPoints()) { |
| | | pointDto = new PPointDto(); |
| | | pointDto.setX(point.getX()); |
| | | pointDto.setY(point.getY()); |
| | | pointDto.setZ(point.getZ()); |
| | | pointDto.setFz(point.getFz()); |
| | | pointDto.setTemp(point.getTemp()); |
| | | listPoints.add(pointDto); |
| | | } |
| | | dto.setPoints(listPoints); |
| | | |
| | | listDetail = new ArrayList<>(); |
| | | for (GrainLay lay : grainData.getListLays()) { |
| | | detailDto = new PDetailDto(); |
| | | detailDto.setFz(lay.getFz()); |
| | | detailDto.setFzName(lay.getFz() + "å±"); |
| | | detailDto.setTempMax(lay.getTempMax()); |
| | | detailDto.setTempMin(lay.getTempMin()); |
| | | detailDto.setTempAve(lay.getTempAve()); |
| | | listDetail.add(detailDto); |
| | | } |
| | | dto.setDetails(listDetail); |
| | | |
| | | dtoList.add(dto); |
| | | } |
| | | return PhoneRespUtil.success(dtoList, req); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.fzzy.common.constant.RespCodeEnum; |
| | | import com.fzzy.igds.app.v1.constant.PhoneConstant; |
| | | import com.fzzy.igds.app.v1.data.AuthUser; |
| | | import com.fzzy.igds.app.v1.data.ParamDepot; |
| | | import com.fzzy.igds.app.v1.data.PhoneRequest; |
| | | import com.fzzy.igds.app.v1.data.PhoneResponse; |
| | | import com.fzzy.igds.app.v1.dto.PDetailDto; |
| | | import com.fzzy.igds.app.v1.dto.PGrainDto; |
| | | import com.fzzy.igds.app.v1.dto.PPointDto; |
| | | import com.fzzy.igds.app.v1.service.PhoneService; |
| | | import com.fzzy.igds.app.v1.util.PhoneRespUtil; |
| | | import com.fzzy.igds.app.v1.util.PhoneUtil; |
| | | import com.fzzy.igds.data.GrainData; |
| | | import com.fzzy.igds.data.GrainLay; |
| | | import com.fzzy.igds.data.GrainParam; |
| | | import com.fzzy.igds.data.GrainPoint; |
| | | import com.fzzy.igds.domain.Depot; |
| | | import com.fzzy.igds.domain.DepotConf; |
| | | import com.fzzy.igds.domain.Grain; |
| | | import com.fzzy.igds.service.DepotConfService; |
| | | import com.fzzy.igds.service.DepotService; |
| | | import com.fzzy.igds.service.GrainService; |
| | | import com.fzzy.igds.utils.GrainDataBuilder; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author: YYC |
| | | * @Description: ç²®æ
æ°æ®æ¥ç-å¹³æ¿ä»ç²®æ
æ¥å£ |
| | | * @DateTime: 2026-1-12 14:43 |
| | | **/ |
| | | @Service |
| | | public class ServiceImpl5205 implements PhoneService { |
| | | |
| | | @Autowired |
| | | private PhoneUtil phoneUtil; |
| | | @Autowired |
| | | private GrainService grainService; |
| | | @Autowired |
| | | private DepotService depotService; |
| | | @Autowired |
| | | private DepotConfService depotConfService; |
| | | |
| | | @Override |
| | | public String getInterfaceId() { |
| | | return PhoneConstant.API_PHONE_5205; |
| | | } |
| | | |
| | | @Override |
| | | public PhoneResponse<Object> execute(PhoneRequest<JSONObject> req, AuthUser authUser) throws Exception { |
| | | ParamDepot param = JSONObject.parseObject(req.getData().toString(), ParamDepot.class); |
| | | if (null == param) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "åæ°æè¯¯ï¼è¯·éè¯ï¼ï¼"); |
| | | } |
| | | //åæ°éªè¯ |
| | | if (StringUtils.isEmpty(param.getDeptId()) || StringUtils.isEmpty(param.getDepotId())) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "åæ°æè¯¯ï¼è¯·éè¯ï¼ï¼"); |
| | | } |
| | | GrainParam grainParam = new GrainParam(); |
| | | grainParam.setDeptId(param.getDeptId()); |
| | | grainParam.setDepotId(param.getDepotId()); |
| | | grainParam.setCompanyId(authUser.getCompanyId()); |
| | | grainParam.setLimit(1);//设置é»è®¤åªè·å䏿¡æ°æ® |
| | | |
| | | //æ¥è¯¢ç²®æ
æ°æ® |
| | | List<Grain> list = grainService.listData(grainParam); |
| | | |
| | | Depot depot = depotService.getCacheDepot(authUser.getCompanyId(), param.getDepotId()); |
| | | if (null == list || list.isEmpty()) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_2000, req, "该ä»åºææ ç²®æ
æ°æ®ï¼"); |
| | | } |
| | | DepotConf depotConf; |
| | | GrainData data; |
| | | Depot depotData; |
| | | List<GrainData> result = new ArrayList<>(); |
| | | for (Grain grain : list) { |
| | | depotConf = depotConfService.getCacheDepotConfByDepotId(grain.getCompanyId(), grain.getDepotId()); |
| | | data = new GrainData(); |
| | | BeanUtils.copyProperties(grain, data); |
| | | // æ·»å ä»åºä¿¡æ¯ |
| | | depotData = depotService.getCacheDepot(param.getCompanyId(), param.getDepotId()); |
| | | GrainDataBuilder.updateGrainData(data, depotConf, depotData.getDepotType()); |
| | | result.add(data); |
| | | } |
| | | |
| | | //åæè¿æ¶é´çç²®æ
æ°æ® |
| | | GrainData grainData = result.get(0); |
| | | |
| | | //转æ¢ååºæ°æ® |
| | | PGrainDto dto = new PGrainDto(); |
| | | dto.setDepotId(grainData.getDepotId()); |
| | | dto.setDepotName(phoneUtil.getDepotName(authUser.getCompanyId(), dto.getDepotId())); |
| | | dto.setDepotType(depot.getDepotType()); |
| | | dto.setReceiveDate(grainData.getReceiveDate()); |
| | | dto.setTempIn(grainData.getTempIn()); |
| | | dto.setHumidityIn(grainData.getHumidityIn()); |
| | | dto.setTempOut(grainData.getTempOut()); |
| | | dto.setHumidityOut(grainData.getHumidityOut()); |
| | | dto.setTempMax(grainData.getTempMax()); |
| | | dto.setTempMin(grainData.getTempMin()); |
| | | dto.setTempAve(grainData.getTempAve()); |
| | | dto.setCable(grainData.getCable().replaceAll(",","-")); |
| | | if(StringUtils.isNotEmpty(grainData.getCableCir())){ |
| | | dto.setCableCir(grainData.getCableCir().replaceAll(",", "-")); |
| | | } |
| | | |
| | | List<PPointDto> listPoints = new ArrayList<>(); |
| | | PPointDto pointDto; |
| | | for (GrainPoint point : grainData.getListPoints()) { |
| | | pointDto = new PPointDto(); |
| | | pointDto.setX(point.getX()); |
| | | pointDto.setY(point.getY()); |
| | | pointDto.setZ(point.getZ()); |
| | | pointDto.setFz(point.getFz()); |
| | | pointDto.setTemp(point.getTemp()); |
| | | listPoints.add(pointDto); |
| | | } |
| | | dto.setPoints(listPoints); |
| | | |
| | | List<PDetailDto> listDetail = new ArrayList<>(); |
| | | PDetailDto detailDto; |
| | | |
| | | for (GrainLay lay : grainData.getListLays()) { |
| | | detailDto = new PDetailDto(); |
| | | detailDto.setFz(lay.getFz()); |
| | | detailDto.setFzName(lay.getFz() + "å±"); |
| | | detailDto.setTempMax(lay.getTempMax()); |
| | | detailDto.setTempMin(lay.getTempMin()); |
| | | detailDto.setTempAve(lay.getTempAve()); |
| | | listDetail.add(detailDto); |
| | | } |
| | | dto.setDetails(listDetail); |
| | | |
| | | return PhoneRespUtil.success(dto, req); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.fzzy.common.constant.RespCodeEnum; |
| | | import com.fzzy.igds.app.v1.constant.PhoneConstant; |
| | | import com.fzzy.igds.app.v1.data.AuthUser; |
| | | import com.fzzy.igds.app.v1.data.ParamDepot; |
| | | import com.fzzy.igds.app.v1.data.PhoneRequest; |
| | | import com.fzzy.igds.app.v1.data.PhoneResponse; |
| | | import com.fzzy.igds.app.v1.dto.PQuantityDto; |
| | | import com.fzzy.igds.app.v1.service.PhoneService; |
| | | import com.fzzy.igds.app.v1.util.PhoneRespUtil; |
| | | import com.fzzy.igds.constant.DepotType; |
| | | import com.fzzy.igds.domain.Depot; |
| | | import com.fzzy.igds.domain.Quantity; |
| | | import com.fzzy.igds.service.DepotService; |
| | | import com.fzzy.igds.service.QuantityService; |
| | | import com.fzzy.igds.service.SysDeptService; |
| | | import com.fzzy.igds.utils.ContextUtil; |
| | | import com.ruoyi.common.core.domain.entity.SysDept; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author: YYC |
| | | * @Description: æä½æ»è§-æä½å表 |
| | | * @DateTime: 2026-1-12 14:43 |
| | | **/ |
| | | @Service |
| | | public class ServiceImpl5206 implements PhoneService { |
| | | |
| | | @Resource |
| | | private DepotService depotService; |
| | | @Resource |
| | | private QuantityService quantityService; |
| | | @Autowired |
| | | private SysDeptService deptService; |
| | | |
| | | @Override |
| | | public String getInterfaceId() { |
| | | return PhoneConstant.API_PHONE_5206; |
| | | } |
| | | |
| | | @Override |
| | | public PhoneResponse<Object> execute(PhoneRequest<JSONObject> req, AuthUser authUser) throws Exception { |
| | | |
| | | ParamDepot param = JSONObject.parseObject(req.getData().toString(), ParamDepot.class); |
| | | if (null == param) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "åæ°æè¯¯ï¼è¯·éè¯ï¼ï¼"); |
| | | } |
| | | //åæ°éªè¯ |
| | | if (StringUtils.isEmpty(param.getDeptId())) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "åæ°æè¯¯ï¼è¯·éè¯ï¼ï¼"); |
| | | } |
| | | |
| | | if (StringUtils.isEmpty(param.getDeptId())) { |
| | | param.setDeptId(authUser.getDeptId()); |
| | | } |
| | | //è·åææçä»åæµ
åä» |
| | | List<Depot> depotList = depotService.getCacheDepotList(param.getDeptId()); |
| | | if (null == depotList || depotList.isEmpty()) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "æªæ¥å°ä¿¡æ¯ï¼ï¼"); |
| | | } |
| | | |
| | | List<PQuantityDto> list = new ArrayList<>(); |
| | | List<Quantity> quantityList; |
| | | PQuantityDto quantity; |
| | | SysDept dept; |
| | | for (Depot depot : depotList) { |
| | | if (DepotType.TYPE_02.getCode().equals(depot.getDepotType()) || DepotType.TYPE_04.getCode().equals(depot.getDepotType())) { |
| | | quantityList = quantityService.getQuantityList(depot.getId(), 1); |
| | | quantity = new PQuantityDto(); |
| | | if (null == quantityList || quantityList.isEmpty()) { |
| | | quantity.setDepotId(depot.getId()); |
| | | } else { |
| | | BeanUtils.copyProperties(quantityList.get(0),quantity); |
| | | } |
| | | |
| | | dept = deptService.getCacheDept(depot.getCompanyId(),depot.getDeptId()); |
| | | quantity.setDepotData(depot); |
| | | quantity.setDeptName(dept.getDeptName()); |
| | | list.add(quantity); |
| | | } |
| | | } |
| | | |
| | | return PhoneRespUtil.success(list, req); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.fzzy.common.constant.RespCodeEnum; |
| | | import com.fzzy.igds.app.v1.constant.PhoneConstant; |
| | | import com.fzzy.igds.app.v1.data.AuthUser; |
| | | import com.fzzy.igds.app.v1.data.ParamPatrol; |
| | | import com.fzzy.igds.app.v1.data.PhoneRequest; |
| | | import com.fzzy.igds.app.v1.data.PhoneResponse; |
| | | import com.fzzy.igds.app.v1.dto.PQuantityDto; |
| | | import com.fzzy.igds.app.v1.service.PhoneService; |
| | | import com.fzzy.igds.app.v1.util.PhoneRespUtil; |
| | | import com.fzzy.igds.domain.Depot; |
| | | import com.fzzy.igds.domain.Quantity; |
| | | import com.fzzy.igds.domain.SnapRecord; |
| | | import com.fzzy.igds.mapper.QuantityMapper; |
| | | import com.fzzy.igds.service.DepotService; |
| | | import com.fzzy.igds.service.SysDeptService; |
| | | import com.fzzy.igds.utils.ContextUtil; |
| | | import com.fzzy.igds.utils.DateUtil; |
| | | import com.ruoyi.common.core.domain.entity.SysDept; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author: YYC |
| | | * @Description: æ°éçæµ-æ°éçæµå表 |
| | | * @DateTime: 2026-1-12 14:43 |
| | | **/ |
| | | @Service |
| | | public class ServiceImpl5207 implements PhoneService { |
| | | @Resource |
| | | private QuantityMapper quantityMapper; |
| | | @Autowired |
| | | private SysDeptService deptService; |
| | | @Resource |
| | | private DepotService depotService; |
| | | |
| | | @Override |
| | | public String getInterfaceId() { |
| | | return PhoneConstant.API_PHONE_5207; |
| | | } |
| | | |
| | | @Override |
| | | public PhoneResponse<Object> execute(PhoneRequest<JSONObject> req, AuthUser authUser) throws Exception { |
| | | //转å对象 |
| | | ParamPatrol param = JSONObject.parseObject(req.getData().toString(), ParamPatrol.class); |
| | | if (null == param) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "åæ°æè¯¯ï¼è¯·éè¯ï¼ï¼"); |
| | | } |
| | | //åæ°éªè¯ |
| | | if (StringUtils.isEmpty(param.getDeptId())) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "åæ°æè¯¯ï¼è¯·éè¯ï¼ï¼"); |
| | | } |
| | | //åæ°éªè¯ |
| | | if (null == param.getDateTime()) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "åæ°æè¯¯ï¼è¯·éè¯ï¼ï¼"); |
| | | } |
| | | QueryWrapper<Quantity> queryWrapper = new QueryWrapper<>(); |
| | | |
| | | param.setCompanyId(ContextUtil.getCompanyId()); |
| | | queryWrapper.eq("company_id", param.getCompanyId()); |
| | | queryWrapper.likeRight("dept_id", param.getDeptId()); |
| | | queryWrapper.ge("receive_date", DateUtil.getCurZero(param.getDateTime())); |
| | | queryWrapper.le("receive_date", DateUtil.getNextZero(param.getDateTime())); |
| | | |
| | | List<Quantity> list = quantityMapper.selectList(queryWrapper); |
| | | |
| | | if (null == list || list.isEmpty()) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "æªæ¥å°ä¿¡æ¯ï¼ï¼"); |
| | | } |
| | | PQuantityDto quantityDto; |
| | | SysDept dept; |
| | | Depot depot; |
| | | List<PQuantityDto> dtoList = new ArrayList<>(); |
| | | for (Quantity quantity : list) { |
| | | dept = deptService.getCacheDept(quantity.getCompanyId(), quantity.getDeptId()); |
| | | depot = depotService.getCacheDepot(quantity.getCompanyId(), quantity.getDepotId()); |
| | | quantityDto = new PQuantityDto(); |
| | | BeanUtils.copyProperties(quantity, quantityDto); |
| | | quantityDto.setDeptName(dept.getDeptName()); |
| | | quantityDto.setDepotData(depot); |
| | | |
| | | dtoList.add(quantityDto); |
| | | } |
| | | return PhoneRespUtil.success(dtoList, req); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.fzzy.common.constant.RespCodeEnum; |
| | | import com.fzzy.common.utils.Base64Util; |
| | | import com.fzzy.igds.app.v1.constant.PhoneConstant; |
| | | import com.fzzy.igds.app.v1.data.AuthUser; |
| | | import com.fzzy.igds.app.v1.data.ParamPatrol; |
| | | import com.fzzy.igds.app.v1.data.PhoneRequest; |
| | | import com.fzzy.igds.app.v1.data.PhoneResponse; |
| | | import com.fzzy.igds.app.v1.dto.PPatrolDto; |
| | | import com.fzzy.igds.app.v1.service.PhoneService; |
| | | import com.fzzy.igds.app.v1.util.PhoneRespUtil; |
| | | import com.fzzy.igds.domain.FileInfo; |
| | | import com.fzzy.igds.domain.PatrolRecord; |
| | | import com.fzzy.igds.service.FileService; |
| | | import com.ruoyi.common.config.FrameworkConfig; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author: YYC |
| | | * @Description: æ°éçæµ-çæµç
§ç |
| | | * @DateTime: 2026-1-12 14:43 |
| | | **/ |
| | | @Service |
| | | public class ServiceImpl5208 implements PhoneService { |
| | | @Autowired |
| | | private FileService fileService; |
| | | |
| | | @Override |
| | | public String getInterfaceId() { |
| | | return PhoneConstant.API_PHONE_5208; |
| | | } |
| | | |
| | | @Override |
| | | public PhoneResponse<Object> execute(PhoneRequest<JSONObject> req, AuthUser authUser) throws Exception { |
| | | //转å对象 |
| | | ParamPatrol param = JSONObject.parseObject(req.getData().toString(), ParamPatrol.class); |
| | | if (null == param) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "åæ°æè¯¯ï¼è¯·éè¯ï¼ï¼"); |
| | | } |
| | | //åæ°éªè¯ |
| | | if (StringUtils.isEmpty(param.getId())) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "åæ°æè¯¯ï¼è¯·éè¯ï¼ï¼"); |
| | | } |
| | | param.setCompanyId(authUser.getCompanyId()); |
| | | List<FileInfo> fileList = fileService.listFile(param.getCompanyId(), param.getId()); |
| | | List<PPatrolDto> patrolDtoList = new ArrayList<>(); |
| | | PPatrolDto patrolDto; |
| | | for (FileInfo fileInfo : fileList) { |
| | | if (StringUtils.isNotEmpty(fileInfo.getFilePath())) { |
| | | String imgData = Base64Util.getImageStr(fileInfo.getFilePath().replace("/profile/", FrameworkConfig.getProfile())); |
| | | patrolDto = new PPatrolDto(); |
| | | patrolDto.setBase64Img(imgData); |
| | | patrolDtoList.add(patrolDto); |
| | | } |
| | | } |
| | | return PhoneRespUtil.success(patrolDtoList, req); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.fzzy.common.constant.RespCodeEnum; |
| | | import com.fzzy.igds.app.v1.constant.PhoneConstant; |
| | | import com.fzzy.igds.app.v1.data.AuthUser; |
| | | import com.fzzy.igds.app.v1.data.ParamInoutHandle; |
| | | import com.fzzy.igds.app.v1.data.PhoneRequest; |
| | | import com.fzzy.igds.app.v1.data.PhoneResponse; |
| | | import com.fzzy.igds.app.v1.dto.PInoutDto; |
| | | import com.fzzy.igds.app.v1.service.PhoneService; |
| | | import com.fzzy.igds.app.v1.util.PhoneRespUtil; |
| | | |
| | | import com.fzzy.igds.constant.Constant; |
| | | import com.fzzy.igds.constant.FoodLevel; |
| | | import com.fzzy.igds.constant.FoodVariety; |
| | | import com.fzzy.igds.constant.InoutConstant; |
| | | import com.fzzy.igds.domain.Depot; |
| | | import com.fzzy.igds.domain.InoutRecord; |
| | | import com.fzzy.igds.mapper.InoutRecordMapper; |
| | | import com.fzzy.igds.service.DepotService; |
| | | import com.fzzy.igds.service.InoutRecordService; |
| | | import com.fzzy.igds.utils.DateUtil; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author: YYC |
| | | * @Description: ç²®é£è´é-å
¥åºå¾
å¼ä»å表 |
| | | * @DateTime: 2026-1-12 14:43 |
| | | **/ |
| | | @Service |
| | | public class ServiceImpl5401 implements PhoneService { |
| | | @Resource |
| | | private InoutRecordMapper inoutRecordMapper; |
| | | @Resource |
| | | private DepotService depotService; |
| | | |
| | | @Override |
| | | public String getInterfaceId() { |
| | | return PhoneConstant.API_PHONE_5401; |
| | | } |
| | | |
| | | @Override |
| | | public PhoneResponse<Object> execute(PhoneRequest<JSONObject> req, AuthUser authUser) throws Exception { |
| | | |
| | | ParamInoutHandle param = JSONObject.parseObject(req.getData().toString(), ParamInoutHandle.class); |
| | | |
| | | if (null == param) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "åæ°æè¯¯ï¼è¯·éè¯ï¼ï¼"); |
| | | } |
| | | |
| | | //åæ°éªè¯ |
| | | if (StringUtils.isEmpty(param.getDeptId()) || StringUtils.isEmpty(param.getType())) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "åæ°æè¯¯ï¼è¯·éè¯ï¼ï¼"); |
| | | } |
| | | |
| | | if (StringUtils.isEmpty(param.getCompanyId())) { |
| | | param.setCompanyId(authUser.getCompanyId()); |
| | | } |
| | | //设置æµç¨ä¸ºå¼ä»æµç¨ |
| | | param.setProgress(InoutConstant.PROGRESS_HANDLE); |
| | | QueryWrapper<InoutRecord> queryWrapper = new QueryWrapper<>(); |
| | | if (com.ruoyi.common.utils.StringUtils.isNotBlank(param.getCompanyId())) { |
| | | queryWrapper.eq("company_id", param.getCompanyId()); |
| | | } |
| | | if (StringUtils.isNotBlank(param.getDeptId())) { |
| | | queryWrapper.likeRight("dept_id", param.getDeptId()); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(param.getId())) { |
| | | queryWrapper.eq("id", param.getId()); |
| | | } |
| | | if (StringUtils.isNotBlank(param.getPlateNum())) { |
| | | queryWrapper.like("plate_num", param.getPlateNum()); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(param.getProgress())) { |
| | | queryWrapper.eq("progress", param.getProgress()); |
| | | } |
| | | if (StringUtils.isNotBlank(param.getType())) { |
| | | queryWrapper.eq("type", param.getType()); |
| | | } |
| | | |
| | | queryWrapper.ne("record_status", Constant.RECORD_STATUS_DEL); //䏿¯å é¤çååï¼å³æ£å¸¸çåå |
| | | queryWrapper.orderByDesc("create_time"); |
| | | List<InoutRecord> list = inoutRecordMapper.selectList(queryWrapper); |
| | | List<PInoutDto> listDto = new ArrayList<>(); |
| | | PInoutDto inoutData ; |
| | | for (InoutRecord record : list) { |
| | | inoutData = new PInoutDto(); |
| | | BeanUtils.copyProperties(record, inoutData); |
| | | Depot depot = depotService.getCacheDepot(authUser.getCompanyId(), record.getDepotId()); |
| | | |
| | | //设置ä»åºãç²®é£åç§ãç²®é£ç级ãä¿ç®¡åçåç§° |
| | | inoutData.setDepotName(depot.getName()); |
| | | inoutData.setStoreKeeper(depot.getStoreKeeper()); |
| | | inoutData.setStoreKeeperName(depot.getStoreKeeperName()); |
| | | inoutData.setFoodVarietyName(FoodVariety.getMsg(record.getFoodVariety())); |
| | | inoutData.setFoodLevelName(FoodLevel.getMsg(record.getFoodLevel())); |
| | | listDto.add(inoutData); |
| | | } |
| | | return PhoneRespUtil.success(listDto, req); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.fzzy.common.constant.RespCodeEnum; |
| | | import com.fzzy.igds.app.v1.constant.PhoneConstant; |
| | | import com.fzzy.igds.app.v1.data.AuthUser; |
| | | import com.fzzy.igds.app.v1.data.ParamInoutHandle; |
| | | import com.fzzy.igds.app.v1.data.PhoneRequest; |
| | | import com.fzzy.igds.app.v1.data.PhoneResponse; |
| | | import com.fzzy.igds.app.v1.service.PhoneService; |
| | | import com.fzzy.igds.app.v1.util.PhoneRespUtil; |
| | | import com.fzzy.igds.constant.Constant; |
| | | import com.fzzy.igds.constant.InoutConstant; |
| | | import com.fzzy.igds.data.FileData; |
| | | import com.fzzy.igds.data.InoutData; |
| | | import com.fzzy.igds.data.PageResponse; |
| | | import com.fzzy.igds.domain.FileInfo; |
| | | import com.fzzy.igds.domain.InoutRecord; |
| | | import com.fzzy.igds.domain.InoutSysConf; |
| | | import com.fzzy.igds.mapper.InoutRecordMapper; |
| | | import com.fzzy.igds.service.FileService; |
| | | import com.fzzy.igds.service.InoutConfService; |
| | | import com.fzzy.igds.service.InoutRecordService; |
| | | import com.fzzy.igds.utils.ContextUtil; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author: YYC |
| | | * @Description: ç²®é£è´é-å
¥åºå¼ä»æäº¤ |
| | | * @DateTime: 2026-1-12 14:43 |
| | | **/ |
| | | @Service |
| | | public class ServiceImpl5402 implements PhoneService { |
| | | @Resource |
| | | private InoutRecordMapper inoutRecordMapper; |
| | | @Resource |
| | | private InoutRecordService inoutRecordService; |
| | | @Resource |
| | | private InoutConfService inoutConfService; |
| | | @Resource |
| | | private FileService fileService; |
| | | |
| | | @Override |
| | | public String getInterfaceId() { |
| | | return PhoneConstant.API_PHONE_5402; |
| | | } |
| | | |
| | | @Override |
| | | public PhoneResponse<Object> execute(PhoneRequest<JSONObject> req, AuthUser authUser) throws Exception { |
| | | |
| | | //转å为对象 |
| | | ParamInoutHandle param = JSONObject.parseObject(req.getData().toString(), ParamInoutHandle.class); |
| | | if (null == param) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "åæ°æè¯¯ï¼è¯·éè¯ï¼ï¼"); |
| | | } |
| | | param.setCompanyId(authUser.getCompanyId()); |
| | | param.setDeptId(authUser.getDeptId()); |
| | | |
| | | QueryWrapper<InoutRecord> queryWrapper = new QueryWrapper<>(); |
| | | if (StringUtils.isNotBlank(param.getCompanyId())) { |
| | | queryWrapper.eq("company_id", param.getCompanyId()); |
| | | } |
| | | if (StringUtils.isNotBlank(param.getId())) { |
| | | queryWrapper.eq("id", param.getId()); |
| | | } |
| | | //å¼ä»æäº¤åï¼å次确认å½åæµæ°´æ¯å¦ä¸ºå¼ä»æµç¨ |
| | | InoutRecord inoutRecord = inoutRecordMapper.selectOne(queryWrapper); |
| | | if (!InoutConstant.PROGRESS_HANDLE.equals(inoutRecord.getProgress())) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "该ååä¸å¨å¼ä»ç¶æï¼ä¸è½è¿è¡å¼ä»æäº¤ï¼"); |
| | | } |
| | | |
| | | InoutData data = new InoutData(); |
| | | BeanUtils.copyProperties(inoutRecord, data); |
| | | //å¼ä»ç»ææäº¤,éæ´æ°æµç¨ç¶æãå¼ä»ç»ææ¶é´ãå¼ä»äººãå¼ä»æ£éç |
| | | data.setDeOther(param.getDeHandle()); |
| | | data.setHandleUser(authUser.getCname()); |
| | | //设置å¼ä»å¾çä¿¡æ¯ |
| | | List<FileInfo> files = new ArrayList<>(); |
| | | FileInfo fileData1 = new FileInfo(); |
| | | FileInfo fileData2 = new FileInfo(); |
| | | fileData1.setFileName(param.getFileName1()); |
| | | fileData2.setFileName(param.getFileName2()); |
| | | files.add(fileData1); |
| | | files.add(fileData2); |
| | | data.setFiles(files); |
| | | |
| | | if (null == data.getHandleUser()) { |
| | | data.setHandleUser(authUser.getUsername()); |
| | | } |
| | | InoutSysConf inoutSysConf = inoutConfService.getCacheInoutSysConf(authUser.getCompanyId(), data.getDeptId()); |
| | | if (null == inoutSysConf) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "æç¤ºï¼å½åç³»ç»ä¸æµç¨é
ç½®å¼å¸¸ï¼è¯·è系管çå"); |
| | | } |
| | | |
| | | // è·åä¸ä¸ä¸ªæµç¨ç¶æ |
| | | String curProgress = data.getProgress(); |
| | | String nextProgress = getNextProgress(curProgress, data.getType(), inoutSysConf); |
| | | data.setProgress(nextProgress); |
| | | data.setHandleEnd(new Date()); |
| | | |
| | | // æ§è¡æ°æ®æ´æ° |
| | | int num = inoutRecordService.updateInoutRecord(data); |
| | | if (num == 0) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "æäº¤å¤±è´¥ï¼"); |
| | | } |
| | | //éä»¶å¤ç |
| | | fileService.saveInoutFiles(data.getFiles(), data.getId(), curProgress, "INOUT"); |
| | | |
| | | return PhoneRespUtil.success(RespCodeEnum.CODE_0000, req); |
| | | // if (param.getType().equals(PhoneConstant.PHONE_INOUT_START)) { |
| | | // //å¼ä»å¼å§æäº¤ï¼åªæ´æ°å¼ä»å¼å§æ¶é´ |
| | | // int i = inoutRecordService.updateInoutRecord(data); |
| | | // if (i > 0) { |
| | | // return PhoneRespUtil.success(RespCodeEnum.CODE_0000, req); |
| | | // } |
| | | // return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "æäº¤å¤±è´¥ï¼"); |
| | | // } else { |
| | | // //å¼ä»ç»ææäº¤,éæ´æ°æµç¨ç¶æãå¼ä»ç»ææ¶é´ãå¼ä»äººãå¼ä»æ£éç |
| | | // data.setDeOther(param.getDeHandle()); |
| | | // data.setHandleUser(authUser.getCname()); |
| | | // //设置å¼ä»å¾çä¿¡æ¯ |
| | | // List<FileInfo> files = new ArrayList<>(); |
| | | // FileInfo fileData1 = new FileInfo(); |
| | | // FileInfo fileData2 = new FileInfo(); |
| | | // fileData1.setFileName(param.getFileName1()); |
| | | // fileData2.setFileName(param.getFileName2()); |
| | | // files.add(fileData1); |
| | | // files.add(fileData2); |
| | | // data.setFiles(files); |
| | | // |
| | | // if (null == data.getHandleUser()) { |
| | | // data.setHandleUser(authUser.getUsername()); |
| | | // } |
| | | // InoutSysConf inoutSysConf = inoutConfService.getCacheInoutSysConf(authUser.getCompanyId(), data.getDeptId()); |
| | | // if (null == inoutSysConf) { |
| | | // return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "æç¤ºï¼å½åç³»ç»ä¸æµç¨é
ç½®å¼å¸¸ï¼è¯·è系管çå"); |
| | | // } |
| | | // |
| | | // // è·åä¸ä¸ä¸ªæµç¨ç¶æ |
| | | // String curProgress = data.getProgress(); |
| | | // String nextProgress = getNextProgress(curProgress, data.getType(), inoutSysConf); |
| | | // data.setProgress(nextProgress); |
| | | // data.setHandleEnd(new Date()); |
| | | // |
| | | // // æ§è¡æ°æ®æ´æ° |
| | | // int num = inoutRecordService.updateInoutRecord(data); |
| | | // if (num == 0) { |
| | | // return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "æäº¤å¤±è´¥ï¼"); |
| | | // } |
| | | // //éä»¶å¤ç |
| | | // fileService.saveInoutFiles(data.getFiles(), data.getId(), curProgress, "INOUT"); |
| | | // |
| | | // return PhoneRespUtil.success(RespCodeEnum.CODE_0000, req); |
| | | // } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * è·åä¸ä¸æµç¨ |
| | | * |
| | | * @param curProgress |
| | | * @param type |
| | | * @param sysConf |
| | | * @return |
| | | */ |
| | | private String getNextProgress(String curProgress, String type, InoutSysConf sysConf) { |
| | | String nextProgress = null; |
| | | List<String> list = null; |
| | | if (Constant.TYPE_IN.equals(type)) { |
| | | list = Arrays.asList(sysConf.getProgressIn().split("-")); |
| | | } |
| | | if (Constant.TYPE_OUT.equals(type)) { |
| | | list = Arrays.asList(sysConf.getProgressOut().split("-")); |
| | | } |
| | | if (list != null) { |
| | | for (int i = 0; i < list.size() - 1; i++) { |
| | | if (curProgress.equals(list.get(i))) { |
| | | nextProgress = list.get(i + 1); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | return nextProgress; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.fzzy.common.constant.RespCodeEnum; |
| | | import com.fzzy.igds.app.v1.constant.PhoneConstant; |
| | | import com.fzzy.igds.app.v1.data.AuthUser; |
| | | import com.fzzy.igds.app.v1.data.ParamInoutRecord; |
| | | import com.fzzy.igds.app.v1.data.PhoneRequest; |
| | | import com.fzzy.igds.app.v1.data.PhoneResponse; |
| | | import com.fzzy.igds.app.v1.dto.PInoutDto; |
| | | import com.fzzy.igds.app.v1.dto.PInoutSum; |
| | | import com.fzzy.igds.app.v1.service.PhoneService; |
| | | import com.fzzy.igds.app.v1.util.PhoneRespUtil; |
| | | import com.fzzy.igds.app.v1.util.PhoneUtil; |
| | | import com.fzzy.igds.constant.FoodVariety; |
| | | import com.fzzy.igds.constant.InoutConstant; |
| | | import com.fzzy.igds.constant.InoutProgress; |
| | | import com.fzzy.igds.data.InoutData; |
| | | import com.fzzy.igds.data.InoutParam; |
| | | import com.fzzy.igds.domain.InoutRecord; |
| | | import com.fzzy.igds.service.InoutRecordService; |
| | | import com.fzzy.igds.utils.NumberUtil; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author: YYC |
| | | * @Description: ç²®å®æ¶è®°å½ |
| | | * @DateTime: 2026-1-12 14:43 |
| | | **/ |
| | | @Service |
| | | public class ServiceImpl5405 implements PhoneService { |
| | | |
| | | @Resource |
| | | private InoutRecordService inoutRecordService; |
| | | @Resource |
| | | private PhoneUtil phoneUtil; |
| | | |
| | | @Override |
| | | public String getInterfaceId() { |
| | | return PhoneConstant.API_PHONE_5405; |
| | | } |
| | | |
| | | @Override |
| | | public PhoneResponse<Object> execute(PhoneRequest<JSONObject> req, AuthUser authUser) throws Exception { |
| | | |
| | | //转å为对象 |
| | | ParamInoutRecord param = JSONObject.parseObject(req.getData().toString(), ParamInoutRecord.class); |
| | | if (null == param) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "åæ°æè¯¯ï¼è¯·éè¯ï¼ï¼"); |
| | | } |
| | | //åæ°éªè¯ |
| | | if (StringUtils.isEmpty(param.getDeptId())) { |
| | | return PhoneRespUtil.error(RespCodeEnum.CODE_1111, "åæ°æè¯¯ï¼è¯·éè¯ï¼ï¼"); |
| | | } |
| | | InoutParam inoutParam = new InoutParam(); |
| | | inoutParam.setDeptId(param.getDeptId()); |
| | | inoutParam.setStart(new Date()); |
| | | inoutParam.setEnd(new Date()); |
| | | //å½åæµç¨ä¸ |
| | | List<InoutRecord> listProgress = inoutRecordService.listInout(inoutParam); |
| | | |
| | | PInoutSum dto = new PInoutSum(); |
| | | |
| | | double inNum = 0.0; |
| | | double inCompleteNum = 0.0; |
| | | double outNum = 0.0; |
| | | double outCompleteNum = 0.0; |
| | | |
| | | //ç»è®¡æªå®ææ
åµ |
| | | List<PInoutDto> listDto = new ArrayList<>(); |
| | | PInoutDto inoutDto; |
| | | if (listProgress != null && !listProgress.isEmpty()) { |
| | | for (InoutRecord inoutData : listProgress) { |
| | | inoutDto = new PInoutDto(); |
| | | BeanUtils.copyProperties(inoutData, inoutDto); |
| | | |
| | | if (InoutConstant.TYPE_IN.equals(inoutData.getType())) { |
| | | inoutDto.setTypeName("å
¥åº"); |
| | | inNum++; |
| | | } else { |
| | | inoutDto.setTypeName("åºåº"); |
| | | outNum++; |
| | | } |
| | | if (InoutConstant.TYPE_IN.equals(inoutData.getType()) && InoutConstant.PROGRESS_RECORD.equals(inoutData.getProgress())) { |
| | | inCompleteNum++; |
| | | } else if (InoutConstant.TYPE_OUT.equals(inoutData.getType()) && InoutConstant.PROGRESS_RECORD.equals(inoutData.getProgress())) { |
| | | outCompleteNum++; |
| | | } |
| | | |
| | | inoutDto.setProgressName(InoutProgress.getMsg(inoutData.getProgress())); |
| | | inoutDto.setDepotName(phoneUtil.getDepotName(authUser.getCompanyId(), inoutData.getDepotId())); |
| | | inoutDto.setFoodVarietyName(FoodVariety.getMsg(inoutData.getFoodVariety())); |
| | | if (!InoutConstant.PROGRESS_RECORD.equals(inoutData.getProgress())) { |
| | | listDto.add(inoutDto); |
| | | } |
| | | } |
| | | } |
| | | dto.setListInout(listDto); |
| | | |
| | | //设置ç»è®°æ°ã宿æ°ä»¥å宿ç |
| | | dto.setInCompleteNum(inCompleteNum); |
| | | dto.setInSumNum(inNum); |
| | | if (dto.getInSumNum() != 0) { |
| | | dto.setPerInComplete(NumberUtil.keepPrecision(inCompleteNum / inNum * 100, 2)); |
| | | } |
| | | |
| | | dto.setOutCompleteNum(outCompleteNum); |
| | | dto.setOutSumNum(outNum); |
| | | if (dto.getOutSumNum() != 0) { |
| | | dto.setPerOutComplete(NumberUtil.keepPrecision(outCompleteNum / outNum * 100, 2)); |
| | | } |
| | | dto.setTime(new Date()); |
| | | return PhoneRespUtil.success(dto, req); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.util; |
| | | |
| | | |
| | | import com.fzzy.common.constant.RespCodeEnum; |
| | | import com.fzzy.igds.app.v1.data.PhoneRequest; |
| | | import com.fzzy.igds.app.v1.data.PhoneResponse; |
| | | |
| | | /** |
| | | * @Author: YYC |
| | | * @Description: |
| | | * @DateTime: 2026-1-12 17:53 |
| | | **/ |
| | | public class PhoneRespUtil { |
| | | |
| | | /** |
| | | * ååºæåï¼æ ¹æ®reqèªå¨åå¡«éè¦çåæ° |
| | | * |
| | | * @param data |
| | | * @param req |
| | | * @return |
| | | */ |
| | | public static PhoneResponse success(Object data, PhoneRequest req) { |
| | | return new PhoneResponse(RespCodeEnum.CODE_0000.getCode(),RespCodeEnum.CODE_0000.getMsg(), req.getOutId(), data); |
| | | } |
| | | |
| | | public static PhoneResponse success(Object data) { |
| | | return new PhoneResponse(RespCodeEnum.CODE_0000.getCode(),RespCodeEnum.CODE_0000.getMsg(), data); |
| | | } |
| | | |
| | | /** |
| | | * ååºå¼å¸¸çå°è£
ï¼èªå®ä¹å¼å¸¸ç¼ç ååå |
| | | * |
| | | * @param code |
| | | * @param msg |
| | | * @param req |
| | | * @return |
| | | */ |
| | | public static PhoneResponse error(RespCodeEnum code, PhoneRequest req, String msg) { |
| | | return error(code,req.getOutId(),msg); |
| | | } |
| | | |
| | | public static PhoneResponse error(RespCodeEnum code, String msg) { |
| | | return new PhoneResponse(code,null, msg); |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param code |
| | | * @param outId |
| | | * @param msg |
| | | * @return |
| | | */ |
| | | public static PhoneResponse error(RespCodeEnum code, String outId, String msg) { |
| | | if (null == msg) { |
| | | return new PhoneResponse(code,outId, code.getMsg() ); |
| | | } |
| | | return new PhoneResponse(code, outId, msg); |
| | | } |
| | | |
| | | /** |
| | | * ååºå¼å¸¸çå°è£
ï¼éè¿ç¼ç è·åå¼å¸¸åå |
| | | * |
| | | * @param code |
| | | * @param req |
| | | * @return |
| | | */ |
| | | public static PhoneResponse error(RespCodeEnum code, PhoneRequest req) { |
| | | return new PhoneResponse(code.getCode(),code.getMsg(), req.getOutId(),null); |
| | | } |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.app.v1.util; |
| | | |
| | | import com.fzzy.igds.constant.Constant; |
| | | import com.fzzy.igds.domain.Depot; |
| | | import com.fzzy.igds.service.DepotService; |
| | | import com.fzzy.igds.service.DicService; |
| | | import com.ruoyi.common.core.domain.entity.SysDictData; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author chen |
| | | */ |
| | | @Component |
| | | public class PhoneUtil { |
| | | @Autowired |
| | | private DicService triggerService; |
| | | @Resource |
| | | private DepotService depotService; |
| | | |
| | | |
| | | private static final String KEY_API_PHONE_TOKEN = "KEY_API_PHONE_TOKEN"; |
| | | |
| | | /** |
| | | * å建ç¼åKey |
| | | * |
| | | * @param token |
| | | * @return |
| | | */ |
| | | public static String createKey(String token) { |
| | | return Constant.APP_NAME + ":" + KEY_API_PHONE_TOKEN + ":" + token; |
| | | } |
| | | |
| | | /** |
| | | * è·ååºå
¥åºæµç¨åç§° |
| | | * |
| | | * @param companyId |
| | | * @param progress |
| | | * @return |
| | | */ |
| | | public String getProgressName(String companyId, String progress) { |
| | | List<SysDictData> list = triggerService.getDictDataByType(companyId, "PROCESS_STATUS_"); |
| | | String progressName = ""; |
| | | for (SysDictData dicTrigger : list) { |
| | | if (dicTrigger.getDictValue().equals(progress)) { |
| | | progressName = dicTrigger.getDictLabel(); |
| | | break; |
| | | } |
| | | } |
| | | return progressName; |
| | | } |
| | | |
| | | /** |
| | | * è·åä»åºåç§° |
| | | * |
| | | * @param companyId |
| | | * @param depotId |
| | | * @return |
| | | */ |
| | | public String getDepotName(String companyId, String depotId) { |
| | | Depot depot = depotService.getCacheDepot(companyId,depotId); |
| | | return depot.getName(); |
| | | } |
| | | |
| | | /** |
| | | * è·åæå®ä»åºçä¿¡æ¯ |
| | | * |
| | | * @param companyId |
| | | * @param depotId |
| | | * @return |
| | | */ |
| | | public Depot getDepot(String companyId, String depotId) { |
| | | List<Depot> depotList = depotService.getCacheDepotList(companyId); |
| | | Depot depots = new Depot(); |
| | | if (depotList != null && depotList.size() > 0) { |
| | | for (Depot depot : depotList) { |
| | | if (depot.getId().equals(depotId)) { |
| | | depots = depot; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | return depots; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.fzzy.igds.app.v1.mapper.PhoneMapper"> |
| | | |
| | | <update id="updateOrder"> |
| | | update work_order |
| | | <set> |
| | | <if test="param.status != null and param.status != ''">status = #{param.status},</if> |
| | | <if test="param.receiveTime != null and param.receiveTime != ''">recive_time = #{param.status},</if> |
| | | </set> |
| | | where id = #{param.id} |
| | | </update> |
| | | </mapper> |