Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV
21个文件已修改
8个文件已添加
2 文件已重命名
| | |
| | | - **å·¥å
·é**: Hutool 5.8.22 |
| | | - **æ¥å¿æ¡æ¶**: Log4j2 2.20.0 |
| | | |
| | | ## IDçæå¨ä½¿ç¨è¯´æ |
| | | |
| | | ç³»ç»ä½¿ç¨èªå®ä¹çIDLongGeneratoræ¥çæå¯ä¸çLongåIDï¼ç¡®ä¿å¨åå¸å¼ç¯å¢ä¸çIDå¯ä¸æ§ã |
| | | |
| | | ### IDLongGeneratorç¹æ§ |
| | | |
| | | - **æ ¼å¼**: `å¹´ææ¥æ¶åç§` + `3ä½èªå¢åºå` + `2ä½ç³»ç»åç¼` |
| | | - **é¿åº¦**: 19使°åï¼å¦ï¼20231218104504069**00**ï¼ |
| | | - **å¹¶åæ§**: æ¯æåä¸ç§å
çæ1000个ä¸åID |
| | | - **åå¸å¼**: éè¿åç¼åºåä¸ååç³»ç»ï¼é¿å
IDå²çª |
| | | |
| | | ### ä½¿ç¨æ¹å¼ |
| | | |
| | | ```java |
| | | // ä¾èµæ³¨å
¥ |
| | | @Autowired |
| | | private IDLongGenerator idLongGenerator; |
| | | |
| | | // çæID |
| | | Long id = idLongGenerator.generate(); |
| | | ``` |
| | | |
| | | ### åºç¨åºæ¯ |
| | | |
| | | - **管çå¡å建**: createManagementCardæ¹æ³ä¸ä½¿ç¨IDLongGeneratorçæç®¡çå¡ID |
| | | - **å®ä½ä¸»é®**: ææä¸å¡å®ä½ç主é®IDçæ |
| | | - **订åå·**: ä¸å¡æµæ°´å·çæ |
| | | - **æ¥å¿è®°å½**: æä½è®°å½çå¯ä¸æ è¯ |
| | | |
| | | ### é
置说æ |
| | | |
| | | ç³»ç»å¯å¨æ¶ä¼èªå¨è®¾ç½®IDåç¼ï¼ä¸åçæå¡æ¨¡å使ç¨ä¸åçåç¼æ¥é¿å
IDå²çªï¼ |
| | | |
| | | ```xml |
| | | <!-- web.xmlæSpringé
ç½® --> |
| | | <context-param> |
| | | <param-name>idSuffix</param-name> |
| | | <param-value>01</param-value> <!-- ä¸åæå¡ä½¿ç¨ä¸ååç¼ --> |
| | | </context-param> |
| | | ``` |
| | | |
| | | ## å¼åç¯å¢æå»º |
| | | |
| | | ### åç½®æ¡ä»¶ |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrStManure; |
| | | import com.dy.pipIrrGlobal.voPr.VoManure; |
| | | import com.dy.pipIrrGlobal.voPr.VoMqttSimple; |
| | | import com.dy.pipIrrGlobal.voPr.VoSoil; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | |
| | | |
| | | List<VoMqttSimple> selectAllSimple() ; |
| | | |
| | | |
| | | VoManure selectOne(Long id) ; |
| | | /** |
| | | * æ ¹æ®æå®æ¡ä»¶æ¥è¯¢è®°å½æ»æ° |
| | | * @param params |
| | | * @return |
| | | */ |
| | | Long totalCount(Map<?, ?> params); |
| | | |
| | | /** |
| | | * æ ¹æ®æå®æ¡ä»¶æ¥è¯¢è®°å½ |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoManure> selectSome(Map<?, ?> params); |
| | | |
| | | |
| | | int updateByPrimaryKeySelective(PrStManure record); |
| | | |
| | | int updateByPrimaryKey(PrStManure record); |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrStSoil; |
| | | import com.dy.pipIrrGlobal.voPr.VoMqttSimple; |
| | | import com.dy.pipIrrGlobal.voPr.VoSoil; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | |
| | | |
| | | List<VoMqttSimple> selectAllSimple() ; |
| | | |
| | | |
| | | VoSoil selectOne(Long id) ; |
| | | /** |
| | | * æ ¹æ®æå®æ¡ä»¶æ¥è¯¢è®°å½æ»æ° |
| | | * @param params |
| | | * @return |
| | | */ |
| | | Long totalCount(Map<?, ?> params); |
| | | |
| | | /** |
| | | * æ ¹æ®æå®æ¡ä»¶æ¥è¯¢è®°å½ |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoSoil> selectSome(Map<?, ?> params); |
| | | |
| | | int updateByPrimaryKeySelective(PrStSoil record); |
| | | |
| | | int updateByPrimaryKey(PrStSoil record); |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrStWeather; |
| | | import com.dy.pipIrrGlobal.voPr.VoMqttSimple; |
| | | import com.dy.pipIrrGlobal.voPr.VoWeather; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | |
| | | |
| | | PrStWeather selectByPrimaryKey(Long id); |
| | | |
| | | |
| | | VoWeather selectOne(Long id) ; |
| | | /** |
| | | * æ ¹æ®æå®æ¡ä»¶æ¥è¯¢è®°å½æ»æ° |
| | | * @param params |
| | | * @return |
| | | */ |
| | | Long totalCount(Map<?, ?> params); |
| | | |
| | | /** |
| | | * æ ¹æ®æå®æ¡ä»¶æ¥è¯¢è®°å½ |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoWeather> selectSome(Map<?, ?> params); |
| | | |
| | | List<VoMqttSimple> selectAllSimple() ; |
| | | |
| | | int updateByPrimaryKeySelective(PrStWeather record); |
| | |
| | | /** |
| | | * 便®æ°´å¡å°åè·åæ°´å¡ç¼å·ï¼12æ19æ¥åºå¼ï¼ |
| | | * 2024-06-30åæ¶åºå¼ï¼æ¢å¤ä½¿ç¨ |
| | | * |
| | | * @param cardAddr |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * æ ¹æ®æ°´å¡ç¼å·è·åæ°´å¡è¡¨ä¸»é®ï¼12æ19æ¥æ·»å ååºå¼ï¼ |
| | | * |
| | | * @param cardNum 16使°´å¡ç¼å· |
| | | * @return æ°´å¡è¡¨ä¸»é® |
| | | */ |
| | |
| | | |
| | | /** |
| | | * æ ¹æ®è¡æ¿åºåä¸²æ¨¡åæ¥è¯¢æ°´å¡ç¼å· |
| | | * |
| | | * @param areaCode |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * æ ¹æ®æ°´å¡ç¼å·è·åæ°´å¡è¡¨ä¸»é®ååæ·ç¼å· |
| | | * |
| | | * @param cardNum |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * æ ¹æ®æ°´å¡ç¼å·è·åæ°´å¡å¯¹åºçåæ·idåå§å |
| | | * |
| | | * @param cardAddr |
| | | * @param cardNum |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * å¾å°æ°´å¡å¯¹è±¡ |
| | | * |
| | | * @param cardAddr |
| | | * @param cardNum |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * æ ¹æ®åæ·ä¸»é®è·åæ°´å¡å表ï¼ç©çå¡+èæå¡ï¼ |
| | | * |
| | | * @param clientId |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * æ ¹æ®æ°´å¡ç¼å·è·åæä½è®°å½å表 |
| | | * |
| | | * @param cardNum æ°´å¡ç¼å· |
| | | * @return æ°´å¡æä½è®°å½å表 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * æ ¹æ®æ°´å¡ç¼å·è·åä½é¢ |
| | | * |
| | | * @param cardNum æ°´å¡ç¼å· |
| | | * @return ä½é¢ |
| | | */ |
| | |
| | | |
| | | /** |
| | | * æ ¹æ®æ°´å¡ç¼å·è·åå
弿»é¢ |
| | | * |
| | | * @param cardNum |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * æ ¹æ®æ°´å¡ç¼å·è·åå¡çç¶æ |
| | | * |
| | | * @param cardNum |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * æ ¹æ®æå®æ¡ä»¶è·åæ°´å¡åè¡¨è®°å½æ°ï¼åºç¨ç¨åºä½¿ç¨ |
| | | * |
| | | * @param params |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * æ ¹æ®æå®æ¡ä»¶è·åæ°´å¡å表ï¼åºç¨ç¨åºä½¿ç¨ |
| | | * |
| | | * @param params |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * è·åå·²æå¤±ï¼æªè¡¥å¡çè®°å½æ°éï¼åºç¨ç¨åºä½¿ç¨ |
| | | * |
| | | * @return |
| | | */ |
| | | Long getUnreplacedRecordCount(); |
| | | |
| | | /** |
| | | * è·åå·²æå¤±ï¼æªè¡¥å¡çè®°å½ï¼åºç¨ç¨åºä½¿ç¨ |
| | | * |
| | | * @return |
| | | */ |
| | | List<VoCards> getUnreplaced(Map<?, ?> params); |
| | | |
| | | /** |
| | | * æ ¹æ®æå®æ°´å¡ç¼å·è·åæå¤±è®°å½æ°éï¼è¡¥å¡ãè§£é使ç¨ï¼ |
| | | * |
| | | * @param cardNum |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * æ ¹æ®æå®æ°´å¡ç¼å·è·åå·²è¡¥å¡æ°éï¼è¡¥å¡ãè§£é使ç¨ï¼ |
| | | * |
| | | * @param cardNum æ°´å¡ç¼å· |
| | | * @return ç¬¦åæ¡ä»¶è®°å½æ°ï¼æå¤ä¸æ¡ |
| | | */ |
| | |
| | | |
| | | /** |
| | | * æ ¹æ®åæ·å§ååææºå·è·åæ°´å¡åè¡¨è®°å½æ°ï¼åºç¨ç¨åºä½¿ç¨ |
| | | * |
| | | * @param params |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * æ ¹æ®åæ·å§ååææºå·è·åæ°´å¡å表ï¼åºç¨ç¨åºä½¿ç¨ |
| | | * |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoCards2> getCardsByClientNameAndPhone(Map<?, ?> params); |
| | | |
| | | |
| | | /** |
| | | * æ ¹æ®åæ·IDæ¥è¯¢æ£å¸¸ç¶æçæ°´å¡å表,å°ç¨åºä½¿ç¨ |
| | | * |
| | | * @param clientId |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * æ´æ°å®ä½å¡å©ä½éé¢ |
| | | * |
| | | * @param id |
| | | * @param money |
| | | */ |
| | |
| | | |
| | | /** |
| | | *å½åä½é¢æ»éï¼ç©çå¡ï¼ |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * æ ¹æ®æ°´å¡å°åè·åæ°´å¡æ°éï¼ç¨æ¥å¤æè¯¥å¡æ¯å¦å
许å¼å¡ï¼æ æå¡çæé¤å¨å¤ |
| | | * |
| | | * @param cardAddr |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * æ ¹æ®æ°´å¡å°åè·åæå®ç¶æçæ°´å¡æ°éï¼ç¨æ¥å¤æè¯¥å¡æ¯å¦å
许å¼å¡ |
| | | * |
| | | * @param cardAddr |
| | | * @return |
| | | */ |
| | | Long getCountByCardAddrAndState(String cardAddr); |
| | | |
| | | |
| | | /** |
| | | * è·åæå®æ¶é´æ®µæ°´å¡ä½¿ç¨æ
åµè®°å½æ°é |
| | | * |
| | | * @param params |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * è·åæå®æ¶é´æ®µæ°´å¡ä½¿ç¨æ
åµï¼å
å¼åè®¡ãæ¶è´¹å计ãä½é¢ |
| | | * |
| | | * @param params |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * è·åæå®æ¶é´æ®µå
æ°´å¡å
弿»è®¡ |
| | | * |
| | | * @param timeStart |
| | | * @param timeStop |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * è·åæå®æ¶é´æ®µå
æ°´å¡æ¶è´¹æ»è®¡ |
| | | * |
| | | * @param timeStart |
| | | * @param timeStop |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 便®æ°´å¡å°åå°æå䏿¡æ æç¶æçæå®æä½è®°å½æ¹ä¸ºææ |
| | | * |
| | | * @param cardAddr |
| | | * @param operateType |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * å
弿ºç¨æ ¹æ®è®¢åå·å°æ°´å¡æ¹ä¸ºææ |
| | | * |
| | | * @param orderNumber |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * æ ¹æ®æ°´å¡IDè·ååæ°´å¡IDï¼è¡¥å¡éç¥ä¸ä½¿ç¨ |
| | | * |
| | | * @param cardId |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * å
弿ºç¨æ ¹æ®è¡¥å¡ç订åå·å°æå¤±æ°´å¡ä½é¢ç½®é¶ |
| | | * |
| | | * @param orderNumber |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * å
弿ºç¨è·ååæ·æ°´å¡ä¿¡æ¯ |
| | | * |
| | | * @param cardAddr |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * è·åå·²æå¤±æ°´å¡åè¡¨è®°å½æ°é |
| | | * |
| | | * @param params |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * è·åå·²æå¤±æ°´å¡å表 |
| | | * |
| | | * @param params |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * æ ¹æ®æ°´å¡ç¼å·è·åå¡ä¿¡æ¯ |
| | | * |
| | | * @param cardNum |
| | | * @return |
| | | */ |
| | | VoCardByClientNum getCardByCardNum(@Param("cardNum") String cardNum); |
| | | |
| | | /** |
| | | * æ£æ¥å¡å°åæ¯å¦å·²åå¨ï¼ç®¡çå¡è¡¨ + åæ·æ°´å¡è¡¨ï¼ |
| | | * |
| | | * @param cardAddr å¡å°å |
| | | * @return åå¨çè®°å½æ°é |
| | | */ |
| | | Long checkCardAddrExists(@Param("cardAddr") String cardAddr); |
| | | } |
| | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.dy.common.po.BaseEntity; |
| | |
| | | */ |
| | | private String remarks; |
| | | |
| | | /** |
| | | * æ³¨éæ¶é´ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @TableField("cancel_time") |
| | | private Date cancelTime; |
| | | |
| | | /** |
| | | * å¡çç¶æ;1-æ£å¸¸ï¼2-已注éï¼3-å·²æå¤±ï¼4-æªåå¡ |
| | | */ |
| | | @NotNull(message = "å¡çç¶æä¸è½ä¸ºç©º") |
| | | private Byte state; |
| | | |
| | | } |
| New file |
| | |
| | | package com.dy.pipIrrGlobal.voPr; |
| | | |
| | | import com.dy.common.po.BaseEntity; |
| | | import com.fasterxml.jackson.annotation.JsonPropertyOrder; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/6/24 17:11 |
| | | * @Description |
| | | */ |
| | | @Data |
| | | @JsonPropertyOrder({ "id", "fboxId", "no", "name", "lng", "lat", "remark"}) |
| | | @Schema(title = "æ°´è¥æºå¼å¯¹è±¡") |
| | | public class VoManure implements BaseEntity { |
| | | private static final long serialVersionUID = 202506241715001L; |
| | | /** |
| | | * ä¸»é® |
| | | */ |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | @Schema(title = "æ°´è¥æºID") |
| | | public Long id; |
| | | |
| | | /** |
| | | * FBoxåºåå· |
| | | */ |
| | | @Schema(title = "FBoxåºåå·") |
| | | public String fboxId ; |
| | | |
| | | /** |
| | | * æ°´è¥ç«ç¼å· |
| | | */ |
| | | @Schema(title = "ç¼å·") |
| | | public Integer no ; |
| | | |
| | | /** |
| | | * æ°´è¥ç«åç§° |
| | | */ |
| | | @Schema(title = "åç§°") |
| | | public String name; |
| | | |
| | | /** |
| | | * ç»åº¦ |
| | | */ |
| | | @Schema(title = "ç»åº¦") |
| | | public Double lng; |
| | | |
| | | /** |
| | | * 纬度 |
| | | */ |
| | | @Schema(title = "纬度") |
| | | public Double lat; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @Schema(title = "夿³¨") |
| | | public String remark; |
| | | |
| | | } |
| New file |
| | |
| | | package com.dy.pipIrrGlobal.voPr; |
| | | |
| | | import com.dy.common.po.BaseEntity; |
| | | import com.fasterxml.jackson.annotation.JsonPropertyOrder; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/6/24 17:11 |
| | | * @Description |
| | | */ |
| | | @Data |
| | | @JsonPropertyOrder({ "id", "fboxId", "no", "name", "lng", "lat", "remark"}) |
| | | @Schema(title = "墿
ç«å¼å¯¹è±¡") |
| | | public class VoSoil implements BaseEntity { |
| | | private static final long serialVersionUID = 202506241715002L; |
| | | /** |
| | | * ä¸»é® |
| | | */ |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | @Schema(title = "墿
ç«ID") |
| | | public Long id; |
| | | |
| | | /** |
| | | * FBoxåºåå· |
| | | */ |
| | | @Schema(title = "FBoxåºåå·") |
| | | public String fboxId ; |
| | | |
| | | /** |
| | | * æ°´è¥ç«ç¼å· |
| | | */ |
| | | @Schema(title = "ç¼å·") |
| | | public Integer no ; |
| | | |
| | | /** |
| | | * æ°´è¥ç«åç§° |
| | | */ |
| | | @Schema(title = "åç§°") |
| | | public String name; |
| | | |
| | | /** |
| | | * ç»åº¦ |
| | | */ |
| | | @Schema(title = "ç»åº¦") |
| | | public Double lng; |
| | | |
| | | /** |
| | | * 纬度 |
| | | */ |
| | | @Schema(title = "纬度") |
| | | public Double lat; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @Schema(title = "夿³¨") |
| | | public String remark; |
| | | |
| | | } |
| New file |
| | |
| | | package com.dy.pipIrrGlobal.voPr; |
| | | |
| | | import com.dy.common.po.BaseEntity; |
| | | import com.fasterxml.jackson.annotation.JsonPropertyOrder; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/6/24 17:11 |
| | | * @Description |
| | | */ |
| | | @Data |
| | | @JsonPropertyOrder({ "id", "fboxId", "no", "name", "lng", "lat", "remark"}) |
| | | @Schema(title = "æ°è±¡ç«å¼å¯¹è±¡") |
| | | public class VoWeather implements BaseEntity { |
| | | private static final long serialVersionUID = 202506241715003L; |
| | | /** |
| | | * ä¸»é® |
| | | */ |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | @Schema(title = "æ°è±¡ç«ID") |
| | | public Long id; |
| | | |
| | | /** |
| | | * FBoxåºåå· |
| | | */ |
| | | @Schema(title = "FBoxåºåå·") |
| | | public String fboxId ; |
| | | |
| | | /** |
| | | * æ°´è¥ç«ç¼å· |
| | | */ |
| | | @Schema(title = "ç¼å·") |
| | | public Integer no ; |
| | | |
| | | /** |
| | | * æ°´è¥ç«åç§° |
| | | */ |
| | | @Schema(title = "åç§°") |
| | | public String name; |
| | | |
| | | /** |
| | | * ç»åº¦ |
| | | */ |
| | | @Schema(title = "ç»åº¦") |
| | | public Double lng; |
| | | |
| | | /** |
| | | * 纬度 |
| | | */ |
| | | @Schema(title = "纬度") |
| | | public Double lat; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @Schema(title = "夿³¨") |
| | | public String remark; |
| | | |
| | | } |
| | |
| | | from pr_st_manure |
| | | where deleted != 1 ; |
| | | </select> |
| | | |
| | | <select id="selectOne" parameterType="java.lang.Long" resultType="com.dy.pipIrrGlobal.voPr.VoManure"> |
| | | <!--@mbg.generated--> |
| | | SELECT tb.id, |
| | | tb.fbox_id AS fboxId, |
| | | tb.`no`, |
| | | tb.`name`, |
| | | tb.lng, |
| | | tb.lat, |
| | | tb.remark |
| | | FROM pr_st_manure tb |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | <!--æ ¹æ®æå®æ¡ä»¶æ¥è¯¢æ»æ°--> |
| | | <select id="totalCount" parameterType="java.util.Map" resultType="java.lang.Long"> |
| | | SELECT COUNT(*) AS recordCount |
| | | FROM pr_st_manure tb |
| | | <where> |
| | | tb.deleted != 1 |
| | | <if test="name != null and name != ''"> |
| | | AND tb.name LIKE CONCAT('%', #{name}, '%') |
| | | </if> |
| | | </where> |
| | | </select> |
| | | <!--æ ¹æ®æå®æ¡ä»¶æ¥è¯¢--> |
| | | <select id="selectSome" parameterType="java.util.Map" resultType="com.dy.pipIrrGlobal.voPr.VoManure"> |
| | | SELECT tb.id, |
| | | tb.fbox_id AS fboxId, |
| | | tb.`no`, |
| | | tb.`name`, |
| | | tb.lng, |
| | | tb.lat, |
| | | tb.remark |
| | | FROM pr_st_manure tb |
| | | <where> |
| | | tb.deleted != 1 |
| | | <if test="name != null and name != ''"> |
| | | AND tb.name LIKE CONCAT('%', #{name}, '%') |
| | | </if> |
| | | </where> |
| | | ORDER BY tb.id DESC |
| | | <trim prefix="limit "> |
| | | <if test="start != null and count != null"> |
| | | #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER} |
| | | </if> |
| | | </trim> |
| | | </select> |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from pr_st_manure |
| | |
| | | from pr_st_soil |
| | | where deleted != 1 ; |
| | | </select> |
| | | |
| | | <select id="selectOne" parameterType="java.lang.Long" resultType="com.dy.pipIrrGlobal.voPr.VoSoil"> |
| | | <!--@mbg.generated--> |
| | | SELECT tb.id, |
| | | tb.fbox_id AS fboxId, |
| | | tb.`no`, |
| | | tb.`name`, |
| | | tb.lng, |
| | | tb.lat, |
| | | tb.remark |
| | | FROM pr_st_soil tb |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <!--æ ¹æ®æå®æ¡ä»¶æ¥è¯¢æ»æ°--> |
| | | <select id="totalCount" parameterType="java.util.Map" resultType="java.lang.Long"> |
| | | SELECT COUNT(*) AS recordCount |
| | | FROM pr_st_soil tb |
| | | <where> |
| | | tb.deleted != 1 |
| | | <if test="name != null and name != ''"> |
| | | AND tb.name LIKE CONCAT('%', #{name}, '%') |
| | | </if> |
| | | </where> |
| | | </select> |
| | | <!--æ ¹æ®æå®æ¡ä»¶æ¥è¯¢--> |
| | | <select id="selectSome" parameterType="java.util.Map" resultType="com.dy.pipIrrGlobal.voPr.VoSoil"> |
| | | SELECT tb.id, |
| | | tb.fbox_id AS fboxId, |
| | | tb.`no`, |
| | | tb.`name`, |
| | | tb.lng, |
| | | tb.lat, |
| | | tb.remark |
| | | FROM pr_st_soil tb |
| | | <where> |
| | | tb.deleted != 1 |
| | | <if test="name != null and name != ''"> |
| | | AND tb.name LIKE CONCAT('%', #{name}, '%') |
| | | </if> |
| | | </where> |
| | | ORDER BY tb.id DESC |
| | | <trim prefix="limit "> |
| | | <if test="start != null and count != null"> |
| | | #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER} |
| | | </if> |
| | | </trim> |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from pr_st_soil |
| | |
| | | from pr_st_weather |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | |
| | | <select id="selectOne" parameterType="java.lang.Long" resultType="com.dy.pipIrrGlobal.voPr.VoWeather"> |
| | | <!--@mbg.generated--> |
| | | SELECT tb.id, |
| | | tb.fbox_id AS fboxId, |
| | | tb.`no`, |
| | | tb.`name`, |
| | | tb.lng, |
| | | tb.lat, |
| | | tb.remark |
| | | FROM pr_st_weather tb |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <!--æ ¹æ®æå®æ¡ä»¶æ¥è¯¢æ»æ°--> |
| | | <select id="totalCount" parameterType="java.util.Map" resultType="java.lang.Long"> |
| | | SELECT COUNT(*) AS recordCount |
| | | FROM pr_st_weather tb |
| | | <where> |
| | | tb.deleted != 1 |
| | | <if test="name != null and name != ''"> |
| | | AND tb.name LIKE CONCAT('%', #{name}, '%') |
| | | </if> |
| | | </where> |
| | | </select> |
| | | <!--æ ¹æ®æå®æ¡ä»¶æ¥è¯¢--> |
| | | <select id="selectSome" parameterType="java.util.Map" resultType="com.dy.pipIrrGlobal.voPr.VoWeather"> |
| | | SELECT tb.id, |
| | | tb.fbox_id AS fboxId, |
| | | tb.`no`, |
| | | tb.`name`, |
| | | tb.lng, |
| | | tb.lat, |
| | | tb.remark |
| | | FROM pr_st_weather tb |
| | | <where> |
| | | tb.deleted != 1 |
| | | <if test="name != null and name != ''"> |
| | | AND tb.name LIKE CONCAT('%', #{name}, '%') |
| | | </if> |
| | | </where> |
| | | ORDER BY tb.id DESC |
| | | <trim prefix="limit "> |
| | | <if test="start != null and count != null"> |
| | | #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER} |
| | | </if> |
| | | </trim> |
| | | </select> |
| | | <select id="selectAllSimple" resultType="com.dy.pipIrrGlobal.voPr.VoMqttSimple"> |
| | | <!--@mbg.generated--> |
| | | select |
| | |
| | | ORDER BY card.createDt DESC |
| | | LIMIT 1 |
| | | </select> |
| | | |
| | | <!--æ£æ¥å¡å°åæ¯å¦å·²åå¨ï¼ç®¡çå¡è¡¨ + åæ·æ°´å¡è¡¨ï¼--> |
| | | <select id="checkCardAddrExists" resultType="java.lang.Long"> |
| | | SELECT COUNT(*) AS totalCount FROM ( |
| | | -- æ£æ¥ç®¡çå¡è¡¨ä¸æ£å¸¸(1)åæå¤±(3)ç¶æçè®°å½ï¼æé¤å·²æ³¨é(2)åæªåå¡(4) |
| | | SELECT card_addr FROM se_management_card |
| | | WHERE card_addr = #{cardAddr} |
| | | AND state IN (1, 3) |
| | | |
| | | UNION ALL |
| | | |
| | | -- æ£æ¥åæ·æ°´å¡è¡¨ä¸æ£å¸¸(1)åæå¤±(3)ç¶æçè®°å½ |
| | | SELECT cardAddr FROM se_client_card |
| | | WHERE cardAddr = #{cardAddr} |
| | | AND state IN (1, 3) |
| | | ) AS combined_result |
| | | </select> |
| | | </mapper> |
| | |
| | | <result column="domain" jdbcType="VARCHAR" property="domain" /> |
| | | <result column="open_clost_time" jdbcType="INTEGER" property="openClostTime" /> |
| | | <result column="remarks" jdbcType="VARCHAR" property="remarks" /> |
| | | <result column="cancel_time" jdbcType="TIMESTAMP" property="cancelTime" /> |
| | | <result column="state" jdbcType="TINYINT" property="state" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, protocol, card_addr, security_code, card_type, create_time, order_no, district_code, |
| | | project_no, ip, `domain`, open_clost_time, remarks |
| | | project_no, ip, `domain`, open_clost_time, remarks, cancel_time, state |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | |
| | | security_code, card_type, create_time, |
| | | order_no, district_code, project_no, |
| | | ip, `domain`, open_clost_time, |
| | | remarks) |
| | | remarks, cancel_time, state) |
| | | values (#{id,jdbcType=BIGINT}, #{protocol,jdbcType=VARCHAR}, #{cardAddr,jdbcType=VARCHAR}, |
| | | #{securityCode,jdbcType=VARCHAR}, #{cardType,jdbcType=TINYINT}, #{createTime,jdbcType=TIMESTAMP}, |
| | | #{orderNo,jdbcType=VARCHAR}, #{districtCode,jdbcType=VARCHAR}, #{projectNo,jdbcType=INTEGER}, |
| | | #{ip,jdbcType=VARCHAR}, #{domain,jdbcType=VARCHAR}, #{openClostTime,jdbcType=INTEGER}, |
| | | #{remarks,jdbcType=VARCHAR}) |
| | | #{remarks,jdbcType=VARCHAR}, #{cancelTime,jdbcType=TIMESTAMP}, #{state,jdbcType=TINYINT}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoSe.SeManagementCard"> |
| | | <!--@mbg.generated--> |
| | |
| | | <if test="remarks != null"> |
| | | remarks, |
| | | </if> |
| | | <if test="cancelTime != null"> |
| | | cancel_time, |
| | | </if> |
| | | <if test="state != null"> |
| | | state, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | |
| | | </if> |
| | | <if test="remarks != null"> |
| | | #{remarks,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="cancelTime != null"> |
| | | #{cancelTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="state != null"> |
| | | #{state,jdbcType=TINYINT}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | |
| | | <if test="remarks != null"> |
| | | remarks = #{remarks,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="cancelTime != null"> |
| | | cancel_time = #{cancelTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="state != null"> |
| | | state = #{state,jdbcType=TINYINT}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | |
| | | ip = #{ip,jdbcType=VARCHAR}, |
| | | `domain` = #{domain,jdbcType=VARCHAR}, |
| | | open_clost_time = #{openClostTime,jdbcType=INTEGER}, |
| | | remarks = #{remarks,jdbcType=VARCHAR} |
| | | remarks = #{remarks,jdbcType=VARCHAR}, |
| | | cancel_time = #{cancelTime,jdbcType=TIMESTAMP}, |
| | | state = #{state,jdbcType=TINYINT} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
| | |
| | | import com.dy.common.aop.SsoAop; |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.common.webUtil.ResultCodeMsg; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrStManure; |
| | | import com.dy.pipIrrGlobal.voPr.VoManure; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.media.Content; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | |
| | | import org.springframework.validation.BindingResult; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | |
| | | this.sv = sv ; |
| | | } |
| | | |
| | | /** |
| | | * å页æ¥è¯¢æ°´è¥æºè®°å½ |
| | | * @param vo |
| | | * @return |
| | | */ |
| | | @Operation(summary = "è·å¾ä¸é¡µæ°´è¥æºè®°å½", description = "è¿åä¸é¡µæ°´è¥æºæ°æ®") |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "è¿åä¸é¡µæ°´è¥æºæ°æ®ï¼BaseResponse.content:QueryResultVo[{}]ï¼", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = VoManure.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "/some") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoManure>>> some(QueryVo vo){ |
| | | try { |
| | | return BaseResponseUtils.buildSuccess(this.sv.selectSome(vo)); |
| | | } catch (Exception e) { |
| | | log.error("è·åæ°´è¥æºè®°å½å¼å¸¸", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å¾å°ä¸å¥æ°´è¥æºæ°æ® |
| | |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "è¿åä¸å¥æ°´è¥æºæ°æ®ï¼BaseResponse.content:{}ï¼", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = PrStManure.class))} |
| | | schema = @Schema(implementation = VoManure.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "one") |
| | | @SsoAop() |
| | | public BaseResponse<PrStManure> one(Long id){ |
| | | return BaseResponseUtils.buildSuccess(this.sv.selectById(id)); |
| | | public BaseResponse<VoManure> one(Long id){ |
| | | return BaseResponseUtils.buildSuccess(this.sv.selectOne(id)); |
| | | } |
| | | |
| | | /** |
| | |
| | | package com.dy.pipIrrProject.mqtt.manure; |
| | | |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.daoPr.PrStManureMapper; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrStManure; |
| | | import com.dy.pipIrrGlobal.voPr.VoManure; |
| | | import com.dy.pipIrrGlobal.voPr.VoMqttSimple; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.dubbo.common.utils.PojoUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®æå®æ¡ä»¶æ¥è¯¢è®°å½ |
| | | * |
| | | * @param queryVo æ¥è¯¢å¼å¯¹è±¡ |
| | | * @return è®°å½å表 |
| | | */ |
| | | public QueryResultVo<List<VoManure>> selectSome(QueryVo queryVo) { |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo); |
| | | Long itemTotal = dao.totalCount(params); |
| | | |
| | | QueryResultVo<List<VoManure>> rsVo = new QueryResultVo<>(); |
| | | rsVo.pageSize = queryVo.pageSize; |
| | | rsVo.pageCurr = queryVo.pageCurr; |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = dao.selectSome(params); |
| | | return rsVo; |
| | | } |
| | | |
| | | /** |
| | | * å¾å°ä¸ä¸ªå®ä½ |
| | | * @param id å®ä½ID |
| | | * @return å®ä½ |
| | | */ |
| | | public PrStManure selectById(Long id){ |
| | | return this.dao.selectById(id) ; |
| | | public VoManure selectOne(Long id){ |
| | | return this.dao.selectOne(id) ; |
| | | } |
| | | /** |
| | | * ä¿åï¼æ·»å ï¼è§é¢çæ§ç¹ |
| New file |
| | |
| | | package com.dy.pipIrrProject.mqtt.manure; |
| | | |
| | | import com.dy.common.webUtil.QueryConditionVo; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/6/24 17:21 |
| | | * @Description |
| | | */ |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ToString(callSuper = true) |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Builder |
| | | @Schema(name = "æ°´è¥æºæ¥è¯¢æ¡ä»¶") |
| | | public class QueryVo extends QueryConditionVo { |
| | | @Schema(description = "æ°´è¥æºåç§°") |
| | | public String name; |
| | | } |
| New file |
| | |
| | | package com.dy.pipIrrProject.mqtt.soil; |
| | | |
| | | import com.dy.common.webUtil.QueryConditionVo; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/6/24 17:21 |
| | | * @Description |
| | | */ |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ToString(callSuper = true) |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Builder |
| | | @Schema(name = "墿
ç«æ¥è¯¢æ¡ä»¶") |
| | | public class QueryVo extends QueryConditionVo { |
| | | @Schema(description = "墿
ç«åç§°") |
| | | public String name; |
| | | } |
| | |
| | | import com.dy.common.aop.SsoAop; |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.common.webUtil.ResultCodeMsg; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrStSoil; |
| | | import com.dy.pipIrrGlobal.voPr.VoSoil; |
| | | import com.dy.pipIrrProject.mqtt.manure.QueryVo; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.media.Content; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | |
| | | import org.springframework.validation.BindingResult; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | |
| | | this.sv = sv ; |
| | | } |
| | | |
| | | /** |
| | | * å页æ¥è¯¢å¢æ
ç«è®°å½ |
| | | * @param vo |
| | | * @return |
| | | */ |
| | | @Operation(summary = "è·å¾ä¸é¡µå¢æ
ç«è®°å½", description = "è¿åä¸é¡µå¢æ
ç«æ°æ®") |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "è¿åä¸é¡µå¢æ
ç«æ°æ®ï¼BaseResponse.content:QueryResultVo[{}]ï¼", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = VoSoil.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "/some") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoSoil>>> some(QueryVo vo){ |
| | | try { |
| | | return BaseResponseUtils.buildSuccess(this.sv.selectSome(vo)); |
| | | } catch (Exception e) { |
| | | log.error("è·å墿
ç«è®°å½å¼å¸¸", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å¾å°ä¸å¥å¢æ
ç«æ°æ® |
| | |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "è¿åä¸å¥å¢æ
ç«æ°æ®ï¼BaseResponse.content:{}ï¼", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = PrStSoil.class))} |
| | | schema = @Schema(implementation = VoSoil.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "one") |
| | | @SsoAop() |
| | | public BaseResponse<PrStSoil> one(Long id){ |
| | | return BaseResponseUtils.buildSuccess(this.sv.selectById(id)); |
| | | public BaseResponse<VoSoil> one(Long id){ |
| | | return BaseResponseUtils.buildSuccess(this.sv.selectOne(id)); |
| | | } |
| | | |
| | | /** |
| | |
| | | package com.dy.pipIrrProject.mqtt.soil; |
| | | |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.daoPr.PrStSoilMapper; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrStSoil; |
| | | import com.dy.pipIrrGlobal.voPr.VoSoil; |
| | | import com.dy.pipIrrGlobal.voPr.VoMqttSimple; |
| | | import com.dy.pipIrrProject.mqtt.manure.QueryVo; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.dubbo.common.utils.PojoUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | |
| | | public List<VoMqttSimple> allSimple(){ |
| | | return this.dao.selectAllSimple() ; |
| | | } |
| | | /** |
| | | * æ ¹æ®æå®æ¡ä»¶æ¥è¯¢è®°å½ |
| | | * |
| | | * @param queryVo æ¥è¯¢å¼å¯¹è±¡ |
| | | * @return è®°å½å表 |
| | | */ |
| | | public QueryResultVo<List<VoSoil>> selectSome(QueryVo queryVo) { |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo); |
| | | Long itemTotal = dao.totalCount(params); |
| | | |
| | | QueryResultVo<List<VoSoil>> rsVo = new QueryResultVo<>(); |
| | | rsVo.pageSize = queryVo.pageSize; |
| | | rsVo.pageCurr = queryVo.pageCurr; |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = dao.selectSome(params); |
| | | return rsVo; |
| | | } |
| | | |
| | | /** |
| | | * å¾å°ä¸ä¸ªå®ä½ |
| | | * @param id å®ä½ID |
| | | * @return å®ä½ |
| | | */ |
| | | public PrStSoil selectById(Long id){ |
| | | return this.dao.selectById(id) ; |
| | | public VoSoil selectOne(Long id){ |
| | | return this.dao.selectOne(id) ; |
| | | } |
| | | /** |
| | | * ä¿åï¼æ·»å ï¼è§é¢çæ§ç¹ |
| New file |
| | |
| | | package com.dy.pipIrrProject.mqtt.weather; |
| | | |
| | | import com.dy.common.webUtil.QueryConditionVo; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/6/24 17:21 |
| | | * @Description |
| | | */ |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ToString(callSuper = true) |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Builder |
| | | @Schema(name = "æ°è±¡ç«æ¥è¯¢æ¡ä»¶") |
| | | public class QueryVo extends QueryConditionVo { |
| | | @Schema(description = "æ°è±¡ç«åç§°") |
| | | public String name; |
| | | } |
| | |
| | | import com.dy.common.aop.SsoAop; |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.common.webUtil.ResultCodeMsg; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrStWeather; |
| | | import com.dy.pipIrrGlobal.voPr.VoWeather; |
| | | import com.dy.pipIrrProject.mqtt.manure.QueryVo; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.media.Content; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | |
| | | import org.springframework.validation.BindingResult; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | |
| | | this.sv = sv ; |
| | | } |
| | | |
| | | /** |
| | | * å页æ¥è¯¢æ°è±¡ç«è®°å½ |
| | | * @param vo |
| | | * @return |
| | | */ |
| | | @Operation(summary = "è·å¾ä¸é¡µæ°è±¡ç«è®°å½", description = "è¿åä¸é¡µæ°è±¡ç«æ°æ®") |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "è¿åä¸é¡µæ°è±¡ç«æ°æ®ï¼BaseResponse.content:QueryResultVo[{}]ï¼", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = VoWeather.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "/some") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoWeather>>> some(QueryVo vo){ |
| | | try { |
| | | return BaseResponseUtils.buildSuccess(this.sv.selectSome(vo)); |
| | | } catch (Exception e) { |
| | | log.error("è·åæ°è±¡ç«è®°å½å¼å¸¸", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å¾å°ä¸å¥æ°è±¡ç«æ°æ® |
| | |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "è¿åä¸å¥æ°è±¡ç«æ°æ®ï¼BaseResponse.content:{}ï¼", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = PrStWeather.class))} |
| | | schema = @Schema(implementation = VoWeather.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "one") |
| | | @SsoAop() |
| | | public BaseResponse<PrStWeather> one(Long id){ |
| | | return BaseResponseUtils.buildSuccess(this.sv.selectById(id)); |
| | | public BaseResponse<VoWeather> one(Long id){ |
| | | return BaseResponseUtils.buildSuccess(this.sv.selectOne(id)); |
| | | } |
| | | |
| | | /** |
| | |
| | | package com.dy.pipIrrProject.mqtt.weather; |
| | | |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.daoPr.PrStWeatherMapper; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrStWeather; |
| | | import com.dy.pipIrrGlobal.voPr.VoMqttSimple; |
| | | import com.dy.pipIrrGlobal.voPr.VoWeather; |
| | | import com.dy.pipIrrProject.mqtt.manure.QueryVo; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.dubbo.common.utils.PojoUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | |
| | | public List<VoMqttSimple> allSimple(){ |
| | | return this.dao.selectAllSimple() ; |
| | | } |
| | | /** |
| | | * æ ¹æ®æå®æ¡ä»¶æ¥è¯¢è®°å½ |
| | | * |
| | | * @param queryVo æ¥è¯¢å¼å¯¹è±¡ |
| | | * @return è®°å½å表 |
| | | */ |
| | | public QueryResultVo<List<VoWeather>> selectSome(QueryVo queryVo) { |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo); |
| | | Long itemTotal = dao.totalCount(params); |
| | | |
| | | QueryResultVo<List<VoWeather>> rsVo = new QueryResultVo<>(); |
| | | rsVo.pageSize = queryVo.pageSize; |
| | | rsVo.pageCurr = queryVo.pageCurr; |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = dao.selectSome(params); |
| | | return rsVo; |
| | | } |
| | | |
| | | /** |
| | | * å¾å°ä¸ä¸ªå®ä½ |
| | | * @param id å®ä½ID |
| | | * @return å®ä½ |
| | | */ |
| | | public PrStWeather selectById(Long id){ |
| | | return this.dao.selectById(id) ; |
| | | public VoWeather selectOne(Long id){ |
| | | return this.dao.selectOne(id) ; |
| | | } |
| | | /** |
| | | * ä¿åï¼æ·»å ï¼è§é¢çæ§ç¹ |
| | |
| | | */ |
| | | @PostMapping(path = "termActiveCard", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @SsoAop() |
| | | public BaseResponse<VoTermActiveCard> termActiveCard(@RequestBody @Valid ActiveCard po, BindingResult bindingResult) { |
| | | public BaseResponse<VoTermActiveCard> termActiveCard(@RequestBody @Valid ActiveCard po, |
| | | BindingResult bindingResult) { |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | return BaseResponseUtils |
| | | .buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | Map map_result = cardSv.activeOrReissueTermCard(po); |
| | |
| | | @SsoAop() |
| | | public BaseResponse<VoTermCommon> termRecharge(@RequestBody @Valid DtoRecharge po, BindingResult bindingResult) { |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | return BaseResponseUtils |
| | | .buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | Map map_result = cardSv.addRecharge(po, null); |
| | |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> termReportLoss(@RequestBody @Valid DtoLoss po, BindingResult bindingResult) { |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | return BaseResponseUtils |
| | | .buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | Map map_result = cardSv.reportLoss(po); |
| | |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> termUnlock(@RequestBody @Valid DtoUnlock po, BindingResult bindingResult) { |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | return BaseResponseUtils |
| | | .buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | Map map_result = cardSv.unlock(po); |
| | |
| | | @SsoAop() |
| | | public BaseResponse<VoTermCommon> termReissue(@RequestBody @Valid DtoReissue po, BindingResult bindingResult) { |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | return BaseResponseUtils |
| | | .buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | Map map_result = cardSv.reissue(po); |
| | |
| | | @SsoAop() |
| | | public BaseResponse<VoTermCommon> termCancel(@RequestBody @Valid DtoCancel po, BindingResult bindingResult) { |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | return BaseResponseUtils |
| | | .buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | Map map_result = cardSv.cancel(po); |
| | |
| | | |
| | | /** |
| | | * è¡¥æ£ |
| | | * |
| | | * @param po |
| | | * @param bindingResult |
| | | * @return |
| | | */ |
| | | @PostMapping(path = "termRepay", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @SsoAop() |
| | | public BaseResponse<VoRepaySupplement> termRepay(@RequestBody @Valid DtoRepaySupplement po, BindingResult bindingResult) { |
| | | public BaseResponse<VoRepaySupplement> termRepay(@RequestBody @Valid DtoRepaySupplement po, |
| | | BindingResult bindingResult) { |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | return BaseResponseUtils |
| | | .buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | if(po.getRepayMorny() == null || po.getRepayMorny() <= 0) { |
| | |
| | | |
| | | /** |
| | | * è¿è¿ |
| | | * |
| | | * @param po |
| | | * @param bindingResult |
| | | * @return |
| | | */ |
| | | @PostMapping(path = "supplement", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @SsoAop() |
| | | public BaseResponse<VoRepaySupplement> supplement(@RequestBody @Valid DtoRepaySupplement po, BindingResult bindingResult) { |
| | | public BaseResponse<VoRepaySupplement> supplement(@RequestBody @Valid DtoRepaySupplement po, |
| | | BindingResult bindingResult) { |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | return BaseResponseUtils |
| | | .buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | if(po.getSupplementMoney() == null || po.getSupplementMoney() <= 0) { |
| | |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> termCallBack(@RequestBody @Valid DtoCallBack po, BindingResult bindingResult) { |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | return BaseResponseUtils |
| | | .buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | Map map_result = cardSv.callBack(po); |
| | |
| | | |
| | | /** |
| | | * 读åå¡ä¿¡æ¯ |
| | | * |
| | | * @param cardAddr |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * æ ¹æ®æå®æ¡ä»¶è·åæ°´å¡å表ï¼ç»ç«¯åºç¨ç¨åºä½¿ç¨ |
| | | * |
| | | * @param vo |
| | | * @return |
| | | */ |
| | | @Operation(summary = "è·å¾ä¸é¡µæ°´å¡è®°å½", description = "è¿åä¸é¡µæ°´å¡æ°æ®") |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "è¿åä¸é¡µæ°´å¡æ°æ®ï¼BaseResponse.content:QueryResultVo[{}]ï¼", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = VoCards.class))} |
| | | ) |
| | | @ApiResponse(responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, description = "è¿åä¸é¡µæ°´å¡æ°æ®ï¼BaseResponse.content:QueryResultVo[{}]ï¼", content = { |
| | | @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, schema = @Schema(implementation = VoCards.class)) }) |
| | | }) |
| | | @GetMapping(path = "getcards") |
| | | @SsoAop() |
| | |
| | | |
| | | /** |
| | | * è·åå·²æå¤±çæ°´å¡å表ï¼ç»ç«¯åºç¨ç¨åºä½¿ç¨ |
| | | * |
| | | * @param vo |
| | | * @return |
| | | */ |
| | | @Operation(summary = "è·å¾ä¸é¡µå·²æå¤±æ°´å¡è®°å½", description = "è¿åä¸é¡µå·²æå¤±æ°´å¡æ°æ®") |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "è¿åä¸é¡µå·²æå¤±æ°´å¡æ°æ®ï¼BaseResponse.content:QueryResultVo[{}]ï¼", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = VoCards.class))} |
| | | ) |
| | | @ApiResponse(responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, description = "è¿åä¸é¡µå·²æå¤±æ°´å¡æ°æ®ï¼BaseResponse.content:QueryResultVo[{}]ï¼", content = { |
| | | @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, schema = @Schema(implementation = VoCards.class)) }) |
| | | }) |
| | | @GetMapping(path = "getlostcards") |
| | | @SsoAop() |
| | |
| | | |
| | | /** |
| | | * æ ¹æ®æ°´å¡ç¼å·è·åå¡ä¿¡æ¯ |
| | | * |
| | | * @param cardNum æ°´å¡ç¼å· |
| | | * @return |
| | | */ |
| | | @Operation(summary = "æ ¹æ®æ°´å¡ç¼å·è·åå¡ä¿¡æ¯", description = "æ ¹æ®æ°´å¡ç¼å·è·å对åºçå¡ä¿¡æ¯") |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "è¿åå¡ä¿¡æ¯ï¼BaseResponse.content:VoCardByClientNumï¼", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = VoCardByClientNum.class))} |
| | | ) |
| | | @ApiResponse(responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, description = "è¿åå¡ä¿¡æ¯ï¼BaseResponse.content:VoCardByClientNumï¼", content = { |
| | | @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, schema = @Schema(implementation = VoCardByClientNum.class)) }) |
| | | }) |
| | | @GetMapping(path = "getcardbycardnum") |
| | | @SsoAop() |
| | |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å建管çå¡ |
| | | * |
| | | * @param dto å建管çå¡åæ° |
| | | * @param bindingResult åæ°éªè¯ç»æ |
| | | * @return åå»ºç»æ |
| | | */ |
| | | @Operation(summary = "å建管çå¡", description = "å建å
弿ºç¨ç®¡çå¡") |
| | | @ApiResponses(value = { |
| | | @ApiResponse(responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, description = "å建æåï¼è¿å订åå·", content = { |
| | | @Content(mediaType = MediaType.APPLICATION_JSON_VALUE) }) |
| | | }) |
| | | @PostMapping(path = "createManagementCard", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @SsoAop() |
| | | public BaseResponse<String> createManagementCard(@RequestBody @Valid CreateManagementCardDto dto, |
| | | BindingResult bindingResult) { |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils |
| | | .buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | // éªè¯å¡çç±»åæ¯å¦å¨å
许èå´å
|
| | | if (dto.getCardType() < 2 || dto.getCardType() > 10) { |
| | | return BaseResponseUtils.buildErrorMsg("å¡çç±»åå¿
é¡»å¨2-10ä¹é´"); |
| | | } |
| | | |
| | | // æ£æ¥å¡çå°åæ¯å¦å·²åå¨ |
| | | if (cardSv.isCardAddrExists(dto.getCardAddr())) { |
| | | return BaseResponseUtils.buildErrorMsg("该å¡çå°åå·²åå¨ï¼è¯·ä½¿ç¨å
¶ä»å°å"); |
| | | } |
| | | |
| | | Map<String, Object> result = cardSv.createManagementCard(dto); |
| | | if ((Boolean) result.get("success")) { |
| | | return BaseResponseUtils.buildSuccess((String) result.get("content")); |
| | | } else { |
| | | return BaseResponseUtils.buildErrorMsg(result.get("msg").toString()); |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.dy.pipIrrGlobal.daoSe.*; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeCardOperate; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeClientCard; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeManagementCard; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeRechargeHistory; |
| | | import com.dy.pipIrrGlobal.voSe.*; |
| | | import com.dy.pipIrrTerminal.card.dto.*; |
| | |
| | | import com.dy.pipIrrTerminal.card.qo.QoLostCards; |
| | | import com.dy.pipIrrTerminal.card.enums.CardStateENUM; |
| | | import com.dy.pipIrrTerminal.card.enums.LastOperateENUM; |
| | | import com.dy.pipIrrTerminal.card.enums.ManagementCardStateENUM; |
| | | import com.dy.pipIrrTerminal.card.enums.OperateTypeENUM; |
| | | import com.dy.pipIrrTerminal.card.enums.RechargeTypeENUM; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import com.dy.common.util.IDLongGenerator; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | |
| | | @Autowired |
| | | private SeManagerCardMapper seManagerCardMapper; |
| | | |
| | | @Autowired |
| | | private SeManagementCardMapper seManagementCardMapper; |
| | | |
| | | @Autowired |
| | | private IDLongGenerator idLongGenerator; |
| | | |
| | | @Value("${project.projectNo}") |
| | | private Integer projectNo; |
| | | |
| | | /** |
| | | * æ ¹æ®æ°´å¡å°åå¤æè¯¥å¡æ¯å¦å¯ä»¥å¼å¡ |
| | | * |
| | | * @param cardAddr |
| | | * @return true:å¯ä»¥å¼å¡ |
| | | */ |
| | |
| | | |
| | | /** |
| | | * æ ¹æ®æ°´å¡ç¼å·å¤æè¯¥å¡æ¯å¦å¯ä»¥å
å¼ |
| | | * |
| | | * @param po |
| | | * @return true:å¯ä»¥å
å¼ |
| | | */ |
| | |
| | | |
| | | /** |
| | | * æ ¹æ®æ°´å¡ç¼å·å¤æè¯¥å¡æ¯å¦å¯ä»¥æå¤± |
| | | * |
| | | * @param po |
| | | * @return true:å¯ä»¥æ¥å¤± |
| | | */ |
| | |
| | | |
| | | /** |
| | | * æ ¹æ®æ°´å¡ç¼å·å¤æè¯¥å¡æ¯å¦å¯ä»¥è§£é |
| | | * |
| | | * @param po |
| | | * @return |
| | | */ |
| | |
| | | map.put("content", card); |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®æ°´å¡ç¼å·å¤æè¯¥å¡æ¯å¦å¯ä»¥è¡¥å¡ |
| | | * |
| | | * @param po |
| | | * @return true:å¯ä»¥è¡¥å¡ |
| | | */ |
| | |
| | | |
| | | /** |
| | | * æ ¹æ®æ°´å¡ç¼å·å¤æè¯¥å¡æ¯å¦å¯ä»¥æ³¨é |
| | | * |
| | | * @param po |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * æ ¹æ®æ°´å¡ç¼å·å¤æè¯¥å¡æ¯å¦å¯ä»¥è¡¥æ£ |
| | | * |
| | | * @param po |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * æ ¹æ®æ°´å¡ç¼å·å¤æè¯¥å¡æ¯å¦å¯ä»¥è¿è¿ |
| | | * |
| | | * @param po |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * æ ¹æ®åæ·ç¼å·è·å5çº§è¡æ¿åºå串areaCodeï¼è¡¥å¡è¿ç¨ä¸å¼æ°å¡ä½¿ç¨ |
| | | * |
| | | * @param clientId |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * å¼å¡éå å
å¼ |
| | | * |
| | | * @param po |
| | | * @param cardNum |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * æ¿æ´»æè¡¥å¡ |
| | | * |
| | | * @param po |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * å
å¼ |
| | | * |
| | | * @param po |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * è¡¥å¡ |
| | | * |
| | | * @param po |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * æå¤± |
| | | * |
| | | * @param po |
| | | * @return |
| | | */ |
| | |
| | | seClientCard.setLossdtdt(new Date()); |
| | | seClientCard.setState(CardStateENUM.LOSS.getCode()); |
| | | seClientCard.setLastoper(LastOperateENUM.LOSS.getCode()); |
| | | Integer rec_updateClientCard = Optional.ofNullable(seClientCardMapper.updateByPrimaryKeySelective(seClientCard)).orElse(0); |
| | | Integer rec_updateClientCard = Optional.ofNullable(seClientCardMapper.updateByPrimaryKeySelective(seClientCard)) |
| | | .orElse(0); |
| | | if (rec_updateClientCard == 0) { |
| | | map.put("msg", "æå¤±å¤±è´¥-åæ·å¡ä¿®æ¹å¼å¸¸"); |
| | | return map; |
| | |
| | | |
| | | /** |
| | | * è§£é |
| | | * |
| | | * @param po |
| | | * @return |
| | | */ |
| | |
| | | seClientCard.setMoney(po.getMoney()); |
| | | seClientCard.setState(CardStateENUM.NORMAL.getCode()); |
| | | seClientCard.setLastoper(LastOperateENUM.UNLOCK.getCode()); |
| | | Integer rec_updateClientCard = Optional.ofNullable(seClientCardMapper.updateByPrimaryKeySelective(seClientCard)).orElse(0); |
| | | Integer rec_updateClientCard = Optional.ofNullable(seClientCardMapper.updateByPrimaryKeySelective(seClientCard)) |
| | | .orElse(0); |
| | | if (rec_updateClientCard == 0) { |
| | | map.put("msg", "è§£é失败-åæ·å¡ä¿®æ¹å¼å¸¸"); |
| | | return map; |
| | |
| | | |
| | | /** |
| | | * éå¡ |
| | | * |
| | | * @param po |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * è¡¥æ£ |
| | | * |
| | | * @param po |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * è¿è¿ |
| | | * |
| | | * @param po |
| | | * @return |
| | | */ |
| | |
| | | seCardOperate.setClientId(clientId); |
| | | seCardOperate.setMoney(po.getBalance()); |
| | | seCardOperate.setRefundAmount(po.getSupplementMoney()); |
| | | seCardOperate.setOperateType(OperateTypeENUM.WRITE_BACK.getCode()); |
| | | seCardOperate.setOperateType(OperateTypeENUM.SUPPLEMENT.getCode()); |
| | | seCardOperate.setRemarks(po.getRemarks()); |
| | | seCardOperate.setOperator(po.getOperator()); |
| | | seCardOperate.setOperateDt(operateTime); |
| | |
| | | |
| | | /** |
| | | * æä½åè° |
| | | * |
| | | * @param po |
| | | * @return |
| | | */ |
| | |
| | | Integer operateType = po.getOperateType(); |
| | | String orderNumber = po.getOrderNumber(); |
| | | |
| | | // å
æ£æ¥æ¯å¦ä¸ºç®¡çå¡ |
| | | if (operateType.equals(OperateTypeENUM.MANAGEMENT_CARD_WRITE.getCode().intValue())) { |
| | | // 管çç±»åå¡åå¡é»è¾ |
| | | return handleManagementCardWrite(cardAddr, orderNumber); |
| | | } |
| | | |
| | | // å¤çåæ·å¡é»è¾ |
| | | Long cardId = seClientCardMapper.getCardIdByAddr(cardAddr); |
| | | if (cardId == null || cardId.equals(0)) { |
| | | map.put("msg", "æ¨æå®çæ°´å¡ä¸åå¨"); |
| | | return map; |
| | | } |
| | | |
| | | if(operateType == 1) { |
| | | if (operateType.equals(OperateTypeENUM.ACTIVE.getCode().intValue())) { |
| | | /** |
| | | * å¼å¡æä½æ§è¡éç¥ |
| | | * 1.便®è®¢åå·å°æ æç¶æçæä½è®°å½æ¹ä¸ºææ |
| | |
| | | turnRechargeHistoryValidByOrderNumber(orderNumber); |
| | | updateCard(cardId, orderNumber+"p"); |
| | | } |
| | | } else if (operateType == 2) { |
| | | } else if (operateType.equals(OperateTypeENUM.RECHARGE.getCode().intValue())) { |
| | | /** |
| | | * å
弿使§è¡éç¥ |
| | | * 1. æä½è®°å½æ¹ä¸ºææ |
| | |
| | | turnOperateValidByOrderNumber(orderNumber + "p"); |
| | | turnRechargeHistoryValidByOrderNumber(orderNumber); |
| | | updateCard(cardId, orderNumber+"p"); |
| | | }else if (operateType == 3) { |
| | | } else if (operateType.equals(OperateTypeENUM.CANCEL.getCode().intValue())) { |
| | | /** |
| | | * é塿使§è¡éç¥ |
| | | * 1. æä½è®°å½æ¹ä¸ºææ |
| | |
| | | return map; |
| | | } |
| | | |
| | | } else if (operateType == 4) { |
| | | } else if (operateType.equals(OperateTypeENUM.REISSUE.getCode().intValue())) { |
| | | /** |
| | | * è¡¥å¡æä½æ§è¡éç¥ |
| | | * 1. æ°æ°´å¡è®°å½æ¹ä¸ºææ |
| | |
| | | map.put("msg", "è¡¥å¡åè°å¤±è´¥"); |
| | | return map; |
| | | } |
| | | } else if (operateType == 5) { |
| | | } else if (operateType.equals(OperateTypeENUM.REFUND.getCode().intValue())) { |
| | | /** |
| | | * è¡¥æ£æä½æ§è¡éç¥ |
| | | * 1. æä½è®°å½æ¹ä¸ºææ |
| | |
| | | map.put("msg", "è¡¥æ£åè°å¤±è´¥"); |
| | | return map; |
| | | } |
| | | } else if (operateType == 6) { |
| | | } else if (operateType.equals(OperateTypeENUM.SUPPLEMENT.getCode().intValue())) { |
| | | /** |
| | | * è¿è¿æä½æ§è¡éç¥ |
| | | * 1. æä½è®°å½æ¹ä¸ºææ |
| | |
| | | |
| | | map.put("success", true); |
| | | map.put("msg", "æä½æå"); |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * å¤ç管çç±»åå¡åå¡åè° |
| | | * |
| | | * @param cardAddr å¡å°å |
| | | * @param orderNumber 订åå· |
| | | * @return å¤çç»æ |
| | | */ |
| | | private Map<String, Object> handleManagementCardWrite(String cardAddr, String orderNumber) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("success", false); |
| | | map.put("content", null); |
| | | |
| | | try { |
| | | // æ ¹æ®å¡å°åå订åå·æ¥æ¾ç®¡çå¡ |
| | | SeManagementCard managementCard = seManagementCardMapper.selectOne( |
| | | com.baomidou.mybatisplus.core.toolkit.Wrappers.<SeManagementCard>lambdaQuery() |
| | | .eq(SeManagementCard::getCardAddr, cardAddr) |
| | | .eq(SeManagementCard::getOrderNo, orderNumber)); |
| | | |
| | | if (managementCard == null) { |
| | | map.put("msg", "æªæ¾å°å¯¹åºç管çå¡è®°å½"); |
| | | return map; |
| | | } |
| | | |
| | | // æ´æ°ç®¡çå¡ç¶æä¸ºæ£å¸¸ |
| | | managementCard.setState(ManagementCardStateENUM.NORMAL.getCode()); |
| | | |
| | | int updateResult = seManagementCardMapper.updateByPrimaryKeySelective(managementCard); |
| | | if (updateResult > 0) { |
| | | map.put("success", true); |
| | | map.put("msg", "管çå¡åå¡å®æï¼ç¶æå·²æ´æ°ä¸ºæ£å¸¸"); |
| | | } else { |
| | | map.put("msg", "管çå¡ç¶ææ´æ°å¤±è´¥"); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("å¤ç管çå¡åå¡åè°å¼å¸¸", e); |
| | | map.put("msg", "å¤ç管çå¡åå¡åè°æ¶åçå¼å¸¸ï¼" + e.getMessage()); |
| | | } |
| | | |
| | | return map; |
| | | } |
| | | |
| | |
| | | |
| | | /** |
| | | * å¦æè¡¥å¡æ¶éè¿äºéé¢ï¼æ¸
空æå¤±å¡ä½é¢ |
| | | * |
| | | * @param orderNumber |
| | | */ |
| | | public Integer emptyCardBalance(String orderNumber) { |
| | |
| | | |
| | | /** |
| | | * ä¿®æ¹æ³¨éæ°´å¡è¡¨çè®°å½åä½é¢ï¼0ï¼ |
| | | * |
| | | * @param orderNumber |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * ä¿®æ¹è¡¥æ£æ°´å¡è¡¨è®°å½åä½é¢ |
| | | * |
| | | * @param cardId |
| | | * @param orderNumber |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * ä¿®æ¹è¿è¿æ°´å¡è¡¨è®°å½åä½é¢ |
| | | * |
| | | * @param cardId |
| | | * @param orderNumber |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 夿æå®æ°´å¡æ¯å¦ä¸ºæå¤±ç¶æä¸æ è¡¥å¡è®°å½ |
| | | * |
| | | * @param cardNum |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * è¯»åæ°´å¡ä¿¡æ¯ |
| | | * |
| | | * @param cardAddr |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * æ ¹æ®æå®æ¡ä»¶è·åæ°´å¡å表 |
| | | * |
| | | * @param vo æ¥è¯¢æ¡ä»¶ |
| | | * @return æ°´å¡å表 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * è·åå·²æå¤±çæ°´å¡å表 |
| | | * |
| | | * @param vo æ¥è¯¢æ¡ä»¶ |
| | | * @return å·²æå¤±çæ°´å¡å表 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * æ ¹æ®æ°´å¡ç¼å·è·åå¡ä¿¡æ¯ |
| | | * |
| | | * @param cardNum æ°´å¡ç¼å· |
| | | * @return å¡ä¿¡æ¯ |
| | | */ |
| | | public VoCardByClientNum getCardByCardNum(String cardNum) { |
| | | return seClientCardMapper.getCardByCardNum(cardNum); |
| | | } |
| | | |
| | | /** |
| | | * å建管çå¡ |
| | | * |
| | | * @param dto å建管çå¡DTO |
| | | * @return åå»ºç»æ |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Map<String, Object> createManagementCard(CreateManagementCardDto dto) { |
| | | Map<String, Object> result = new HashMap<>(); |
| | | result.put("success", false); |
| | | |
| | | try { |
| | | // æ£æ¥å¡å°åæ¯å¦å·²åå¨ |
| | | if (isCardAddrExists(dto.getCardAddr())) { |
| | | result.put("msg", "å建失败-æ¤å¡å°åå·²åå¨"); |
| | | return result; |
| | | } |
| | | |
| | | // åètermActiveCardé»è¾ï¼çæè®¢åå· |
| | | String orderNo = generateOrderNo(); |
| | | |
| | | // 使ç¨IDLongGeneratorçæå¯ä¸ID |
| | | Long id = idLongGenerator.generate(); |
| | | Date createTime = new Date(); |
| | | |
| | | // æå»ºç®¡çå¡å¯¹è±¡ |
| | | SeManagementCard managementCard = SeManagementCard.builder() |
| | | .id(id) |
| | | .protocol(dto.getProtocol()) |
| | | .cardAddr(dto.getCardAddr()) |
| | | .securityCode(dto.getSecurityCode()) |
| | | .cardType(dto.getCardType()) |
| | | .createTime(createTime) |
| | | .orderNo(orderNo) |
| | | .districtCode(dto.getDistrictCode()) |
| | | .projectNo(dto.getProjectNo() != null ? dto.getProjectNo() : this.projectNo) |
| | | .ip(dto.getIp()) |
| | | .domain(dto.getDomain()) |
| | | .openClostTime(dto.getOpenClostTime()) |
| | | .remarks(dto.getRemarks()) |
| | | .state(ManagementCardStateENUM.UNWRITTEN.getCode()) // é»è®¤ç¶æä¸ºæªåå¡ |
| | | .build(); |
| | | |
| | | // æå
¥æ°æ®åº |
| | | int insertResult = seManagementCardMapper.insertSelective(managementCard); |
| | | |
| | | if (insertResult > 0) { |
| | | result.put("success", true); |
| | | result.put("content", orderNo); // è¿å订åå· |
| | | result.put("msg", "è¯·æ±æå"); |
| | | } else { |
| | | result.put("msg", "管çå¡å建失败-æ°æ®åºæå
¥å¼å¸¸"); |
| | | } |
| | | |
| | | } catch (Exception e) { |
| | | log.error("å建管çå¡å¼å¸¸: {}", e.getMessage(), e); |
| | | result.put("msg", "管çå¡å建失败: " + e.getMessage()); |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * æ£æ¥å¡çå°åæ¯å¦å·²åå¨ |
| | | * |
| | | * @param cardAddr å¡çå°å |
| | | * @return true-å·²åå¨ï¼false-ä¸åå¨ |
| | | */ |
| | | public boolean isCardAddrExists(String cardAddr) { |
| | | // 使ç¨ä¸æ¬¡æ¥è¯¢æ£æ¥ä¸¤ä¸ªè¡¨ä¸æ¯å¦åå¨è¯¥å¡å°å |
| | | // 1. 管çå¡è¡¨ï¼ææè®°å½é½æ£æ¥ |
| | | // 2. åæ·æ°´å¡è¡¨ï¼åªæ£æ¥æ£å¸¸(1)åæå¤±(3)ç¶æçè®°å½ |
| | | Long totalCount = seClientCardMapper.checkCardAddrExists(cardAddr); |
| | | return totalCount != null && totalCount > 0; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.dy.pipIrrTerminal.card.dto; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import jakarta.validation.constraints.NotBlank; |
| | | import jakarta.validation.constraints.NotNull; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2025-01-20 |
| | | * @Description å建管çå¡DTO |
| | | */ |
| | | @Data |
| | | @Schema(name = "å建管çå¡DTO") |
| | | public class CreateManagementCardDto { |
| | | |
| | | /** |
| | | * é讯åè®® |
| | | */ |
| | | @NotBlank(message = "é讯åè®®ä¸è½ä¸ºç©º") |
| | | @Schema(description = "é讯åè®®", example = "RS485") |
| | | private String protocol; |
| | | |
| | | /** |
| | | * å¡çå°å |
| | | */ |
| | | @NotBlank(message = "å¡çå°åä¸è½ä¸ºç©º") |
| | | @Schema(description = "å¡çå°å", example = "001") |
| | | private String cardAddr; |
| | | |
| | | /** |
| | | * è¯å«ç |
| | | */ |
| | | @NotBlank(message = "è¯å«ç ä¸è½ä¸ºç©º") |
| | | @Schema(description = "è¯å«ç ", example = "A0B1C289") |
| | | private String securityCode; |
| | | |
| | | /** |
| | | * å¡çç±»å |
| | | * 2-设置åºå表å·å¡ï¼3-åæ°å¡ï¼4-æ£æ¥å¡ï¼5-æµè¯å¡ï¼6-æ¸
é¶å¡ï¼7-IP设置å¡ï¼8-åå设置å¡ï¼9-GPSå¡ï¼10-æ¶é´é
ç½®å¡ |
| | | */ |
| | | @NotNull(message = "å¡çç±»åä¸è½ä¸ºç©º") |
| | | @Schema(description = "å¡çç±»å", example = "2", allowableValues = { "2", "3", "4", "5", "6", "7", "8", "9", "10" }) |
| | | private Byte cardType; |
| | | |
| | | /** |
| | | * 5çº§è¡æ¿åºåç¼ç |
| | | */ |
| | | @Schema(description = "5çº§è¡æ¿åºåç¼ç ", example = "110101") |
| | | private String districtCode; |
| | | |
| | | /** |
| | | * 项ç®ç¼ç |
| | | */ |
| | | @Schema(description = "项ç®ç¼ç ", example = "1001") |
| | | private Integer projectNo; |
| | | |
| | | /** |
| | | * IPå°å |
| | | */ |
| | | @Schema(description = "IPå°å", example = "192.168.1.100") |
| | | private String ip; |
| | | |
| | | /** |
| | | * åå |
| | | */ |
| | | @Schema(description = "åå", example = "example.com") |
| | | private String domain; |
| | | |
| | | /** |
| | | * å¼å
³éæ¶é´ |
| | | */ |
| | | @Schema(description = "å¼å
³éæ¶é´(ç§)", example = "30") |
| | | private Integer openClostTime; |
| | | |
| | | /** |
| | | * 夿³¨ä¿¡æ¯ |
| | | */ |
| | | @Schema(description = "夿³¨ä¿¡æ¯", example = "管çå¡å¤æ³¨") |
| | | private String remarks; |
| | | } |
| | |
| | | private String orderNumber; |
| | | |
| | | /** |
| | | * æä½ç±»åï¼1-å¼å¡ï¼2-å
å¼ï¼3-éå¡ï¼4-è¡¥å¡ï¼5-è¡¥æ£ |
| | | * æä½ç±»åï¼1-å¼å¡ï¼2-å
å¼ï¼3-éå¡ï¼4-è¡¥å¡ï¼5-è¡¥æ£ï¼6-è¿è¿ï¼7-管çç±»åå¡åå¡ |
| | | */ |
| | | @NotNull(message = "æä½ç±»åä¸è½ä¸ºç©º") |
| | | private Integer operateType; |
| New file |
| | |
| | | package com.dy.pipIrrTerminal.card.enums; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2025-01-20 |
| | | * @LastEditTime 2025-01-20 |
| | | * @Description 管çå¡ç¶ææä¸¾ |
| | | */ |
| | | |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum ManagementCardStateENUM { |
| | | NORMAL((byte) 1, "æ£å¸¸"), |
| | | CANCELLED((byte) 2, "已注é"), |
| | | LOSS((byte) 3, "å·²æå¤±"), |
| | | UNWRITTEN((byte) 4, "æªåå¡"); |
| | | |
| | | private final Byte code; |
| | | private final String message; |
| | | } |
| | |
| | | * @author ZhuBaoMin |
| | | * @date 2025-05-08 11:45 |
| | | * @LastEditTime 2025-05-08 11:45 |
| | | * @Description |
| | | * @Description æä½ç±»åæä¸¾ |
| | | */ |
| | | |
| | | @Getter |
| | |
| | | CANCEL((byte)3, "éå¡"), |
| | | REISSUE((byte)4, "è¡¥å¡"), |
| | | REFUND((byte)5, "è¡¥æ£"), |
| | | LOSS((byte)6, "æå¤±"), |
| | | REVERSAL((byte)7, "岿£"), |
| | | UNLOCK((byte)8, "è§£é"), |
| | | CONSUME((byte)9, "æ¶è´¹"), |
| | | WRITE_BACK((byte)10, "åå"); |
| | | SUPPLEMENT((byte) 6, "è¿è¿"), |
| | | MANAGEMENT_CARD_WRITE((byte) 7, "管çç±»åå¡åå¡"), |
| | | // ä¿çå
¶ä»ç³»ç»ä½¿ç¨çæä¸¾å¼ |
| | | LOSS((byte) 8, "æå¤±"), |
| | | UNLOCK((byte) 9, "è§£é"), |
| | | REVERSAL((byte) 10, "岿£"), |
| | | CONSUME((byte) 11, "æ¶è´¹"), |
| | | WRITE_BACK((byte) 12, "åå"); |
| | | |
| | | private final Byte code; |
| | | private final String message; |