Browse Source

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

wangzhinan 5 years ago
parent
commit
52498575ab

+ 9 - 9
common/common-entity/src/main/java/com/yihu/jw/entity/iot/message/IotMessageDO.java

@ -21,11 +21,11 @@ public class IotMessageDO extends UuidIdentityEntityWithOperator implements Seri
    @Column(name = "content")
    private String content;//消息内容
    @Column(name = "type")
    private String type;//消息类型 1:SIM卡续费通知 2:库存预警提醒 3:定期检修提醒 4:设备质检提醒',
    private Integer type;//消息类型 1:SIM卡续费通知 2:库存预警提醒 3:定期检修提醒 4:设备质检提醒',
    @Column(name = "read_msg")
    private String readMsg;//消息状态,1:已读  0:未读',
    private Integer readMsg;//消息状态,1:已读  0:未读',
    @Column(name = "del")
    private String del;//删除标志  1:删除  0:不删除',
    private Integer del;//删除标志  1:删除  0:不删除',
    @Column(name = "relation_code")
    private String relationCode;//业务关联id
@ -46,27 +46,27 @@ public class IotMessageDO extends UuidIdentityEntityWithOperator implements Seri
        this.content = content;
    }
    public String getType() {
    public Integer getType() {
        return type;
    }
    public void setType(String type) {
    public void setType(Integer type) {
        this.type = type;
    }
    public String getReadMsg() {
    public Integer getReadMsg() {
        return readMsg;
    }
    public void setReadMsg(String readMsg) {
    public void setReadMsg(Integer readMsg) {
        this.readMsg = readMsg;
    }
    public String getDel() {
    public Integer getDel() {
        return del;
    }
    public void setDel(String del) {
    public void setDel(Integer del) {
        this.del = del;
    }

+ 3 - 3
svr/svr-iot-job/src/main/java/com/yihu/jw/service/channel/DeviceQualityPlanService.java

@ -45,9 +45,9 @@ public class DeviceQualityPlanService {
                IotMessageDO iotMessageDO = new IotMessageDO();
                iotMessageDO.setTitle("设备质检提醒");
                iotMessageDO.setContent("订单:"+one.getOrderNo()+"将于:"+one.getPlanTime()+"进行质检,请及时维护");
                iotMessageDO.setReadMsg("0");
                iotMessageDO.setDel("0");
                iotMessageDO.setType("4");
                iotMessageDO.setReadMsg(0);
                iotMessageDO.setDel(0);
                iotMessageDO.setType(4);
                iotMessageDao.save(iotMessageDO);
        });

+ 6 - 6
svr/svr-iot-job/src/main/java/com/yihu/jw/service/channel/SimBalanceService.java

@ -46,9 +46,9 @@ public class SimBalanceService {
           IotMessageDO iotMessageDO = new IotMessageDO();
           iotMessageDO.setTitle("SIM卡续费通知");
           iotMessageDO.setContent("您的:"+one.getDeviceName()+"设备绑定的SIM卡:"+one.getSim()+"余额不足"+simBalanceRemind.getCode()+"元,请及时充值,避免设备离线");
           iotMessageDO.setReadMsg("0");
           iotMessageDO.setDel("0");
           iotMessageDO.setType("1");
           iotMessageDO.setReadMsg(0);
           iotMessageDO.setDel(0);
           iotMessageDO.setType(1);
           iotMessageDao.save(iotMessageDO);
       });
@ -64,9 +64,9 @@ public class SimBalanceService {
                IotMessageDO iotMessageDO = new IotMessageDO();
                iotMessageDO.setTitle("SIM卡续费通知");
                iotMessageDO.setContent("您的:"+one.getDeviceName()+"设备绑定的SIM卡:"+one.getSim()+"已欠费"+arrears+"元,请及时充值,避免设备离线");
                iotMessageDO.setReadMsg("0");
                iotMessageDO.setDel("0");
                iotMessageDO.setType("1");
                iotMessageDO.setReadMsg(0);
                iotMessageDO.setDel(0);
                iotMessageDO.setType(1);
                iotMessageDao.save(iotMessageDO);
            });
        }

+ 1 - 2
svr/svr-iot/src/main/java/com/yihu/iot/controller/IotMessageService/IotMessageController.java

@ -1,4 +1,4 @@
package com.yihu.iot.controller.IotMessageService;
package com.yihu.iot.controller.iotMessage;
import com.yihu.iot.service.message.IotMessageService;
import com.yihu.jw.entity.iot.message.IotMessageDO;
@ -8,7 +8,6 @@ import com.yihu.jw.rm.iot.IotRequestMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

+ 3 - 3
svr/svr-iot/src/main/java/com/yihu/iot/controller/platform/IotInterfaceController.java

@ -46,7 +46,7 @@ public class IotInterfaceController extends EnvelopRestEndpoint {
    @PostMapping(value = IotRequestMapping.Platform.addInterface)
    @ApiOperation(value = "新增共享接口",notes = "新增共享接口")
    public MixEnvelop<IotShareInterfaceDO,IotShareInterfaceDO> addInterface(@ApiParam(name = "JSON",value = "接口JSON串") @RequestParam(value = "JSON",required = true)String json){
    public MixEnvelop<IotShareInterfaceDO,IotShareInterfaceDO> addInterface(@ApiParam(name = "jsonData",value = "接口JSON串") @RequestParam(value = "jsonData",required = true)String json){
        try {
            iotShareInterfaceService.addInterface(json);
@ -60,7 +60,7 @@ public class IotInterfaceController extends EnvelopRestEndpoint {
    @PostMapping(value = IotRequestMapping.Platform.editInterface)
    @ApiOperation(value = "编辑共享接口",notes = "编辑共享接口")
    public MixEnvelop<IotShareInterfaceDO,IotShareInterfaceDO> editInterface(@ApiParam(name = "JSON",value = "接口JSON串") @RequestParam(value = "JSON",required = true)String json){
    public MixEnvelop<IotShareInterfaceDO,IotShareInterfaceDO> editInterface(@ApiParam(name = "jsonData",value = "接口JSON串") @RequestParam(value = "jsonData",required = true)String json){
        try {
            iotShareInterfaceService.editInterface(json);
@ -254,7 +254,7 @@ public class IotInterfaceController extends EnvelopRestEndpoint {
    public MixEnvelop<IotCompanyAppInterfaceDO, IotCompanyAppInterfaceDO> allotInterface(@ApiParam(name = "jsonData", value = "json", defaultValue = "")
                                                             @RequestParam(value = "jsonData", required = true)String jsonData,
                                                                             @ApiParam(name = "ids", value = "IDS", defaultValue = "")
                                                             @RequestBody List<String> ids) {
                                                             @RequestParam(value = "ids",required = true) String ids) {
        try {
            iotCompanyAppInterfaceService.allotInterface(jsonData,ids);

+ 0 - 2
svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotDeviceQualityInspectionPlanService.java

@ -229,7 +229,6 @@ public class IotDeviceQualityInspectionPlanService extends BaseJpaService<IotDev
     * @return
     */
    public MixEnvelop<IotDeviceQualityInspectionPlanVO, IotDeviceQualityInspectionPlanVO> queryPage(String status, String orderNo, String startTime, String endTime, Integer page, Integer size){
//        SELECT  b.* FROM (SELECT  c.* from iot_device_quality_inspection_plan c  WHERE c.del=1 ORDER BY c.plan_time DESC ) b GROUP BY b.order_no;
        StringBuffer sql = new StringBuffer("SELECT  c.* from iot_device_quality_inspection_plan c  WHERE c.del=1 ");
        List<Object> args = new ArrayList<>();
@ -250,7 +249,6 @@ public class IotDeviceQualityInspectionPlanService extends BaseJpaService<IotDev
            args.add(endTime);
        }
        sql.append(" ORDER BY c.plan_time DESC ");
//    "SELECT  b.* FROM ("+sql+")"+" b GROUP BY b.order_no limit ";
        StringBuffer sql1= new StringBuffer("SELECT  b.* FROM (");
        sql1.append(sql).append(") b GROUP BY b.order_no limit ").append((page-1)*size).append(",").append(size);

+ 2 - 2
svr/svr-iot/src/main/java/com/yihu/iot/service/message/IotMessageService.java

@ -73,10 +73,10 @@ public class IotMessageService  extends BaseJpaService<IotMessageDO, IotMessageD
     */
    public MixEnvelop<IotMessageDO, IotMessageDO> markRead(String id) {
        IotMessageDO messageDO = iotMessageDao.findOne(id);
        if(messageDO.getReadMsg().equalsIgnoreCase("1")){
        if(messageDO.getReadMsg()==1){
            return MixEnvelop.getError("消息已标记已读,请勿重复操作");
        }
        messageDO.setReadMsg("1");
        messageDO.setReadMsg(1);
        iotMessageDao.save(messageDO);
        return MixEnvelop.getSuccess(IotRequestMapping.Message.message_success_update);
    }

+ 5 - 2
svr/svr-iot/src/main/java/com/yihu/iot/service/platform/IotCompanyAppInterfaceService.java

@ -36,9 +36,12 @@ public class IotCompanyAppInterfaceService extends BaseJpaService<IotCompanyAppI
     * 分配接口
     * @param jsonData
     */
    public void allotInterface(String jsonData, List<String> ids) {
    public void allotInterface(String jsonData, String ids) {
        ids.forEach(one->{
        List<String> list = JSONObject.parseObject(ids, List.class);
        list.forEach(one->{
            IotCompanyAppInterfaceDO iotCompanyAppInterfaceDO = JSONObject.parseObject(jsonData, IotCompanyAppInterfaceDO.class);
            iotCompanyAppInterfaceDO.setShareInterfaceId(one);
            iotCompanyAppInterfaceDO.setDel("0");