修改bug
This commit is contained in:
parent
34972c76fe
commit
a2cc34903e
|
|
@ -0,0 +1,73 @@
|
|||
package com.nu.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import org.jeecg.common.constant.ProvinceCityArea;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @Description: nu_config_suppliers_apply
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-12-23
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
public class SuppliersInfoMQDto implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**id*/
|
||||
@ApiModelProperty(value = "id")
|
||||
private String id;
|
||||
/**供应商名称*/
|
||||
private String suppliersName;
|
||||
/**供应商性质 1代理商 2批发商 3制造商*/
|
||||
private String suppliersNature;
|
||||
/**供应商地址*/
|
||||
private String suppliersAddress;
|
||||
/**负责人*/
|
||||
private String personInCharge;
|
||||
/**联系电话*/
|
||||
private String contactNumber;
|
||||
/**供应状态 1正常供应 2暂停供应*/
|
||||
private String supplyState;
|
||||
/**开户行*/
|
||||
private String openingBank;
|
||||
/**开户行账号*/
|
||||
private String openingBankNo;
|
||||
/**微信账号*/
|
||||
private String wechartId;
|
||||
/**资质照片*/
|
||||
private String imgPath;
|
||||
/**创建人*/
|
||||
private String createBy;
|
||||
/**创建日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
/**所属部门*/
|
||||
private String sysOrgCode;
|
||||
/**审核状态*/
|
||||
@Excel(name = "审核状态", width = 15)
|
||||
private String applyStatus;
|
||||
/**审核备注*/
|
||||
private String applyContent;
|
||||
/**申请id*/
|
||||
private String applyId;
|
||||
/**供应商id*/
|
||||
private String suppliersId;
|
||||
}
|
||||
|
|
@ -0,0 +1,201 @@
|
|||
package com.nu.modules.configSuppliersApply.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.nu.dto.SuppliersInfoMQDto;
|
||||
import com.nu.modules.configSuppliersInfo.entity.ConfigSuppliersInfo;
|
||||
import com.nu.modules.configSuppliersInfo.service.IConfigSuppliersInfoService;
|
||||
import com.nu.utils.RabbitMQUtil;
|
||||
import io.netty.util.internal.StringUtil;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import com.nu.modules.configSuppliersApply.entity.NuConfigSuppliersApply;
|
||||
import com.nu.modules.configSuppliersApply.service.INuConfigSuppliersApplyService;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
|
||||
/**
|
||||
* @Description: 供应商入驻申请
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-12-23
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="供应商入驻申请")
|
||||
@RestController
|
||||
@RequestMapping("/configSuppliersApply/nuConfigSuppliersApply")
|
||||
@Slf4j
|
||||
public class NuConfigSuppliersApplyController extends JeecgController<NuConfigSuppliersApply, INuConfigSuppliersApplyService> {
|
||||
@Autowired
|
||||
private INuConfigSuppliersApplyService nuConfigSuppliersApplyService;
|
||||
|
||||
@Autowired
|
||||
private IConfigSuppliersInfoService configSuppliersInfoService;
|
||||
|
||||
@Autowired
|
||||
private RabbitMQUtil rabbitMQUtil;
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param nuConfigSuppliersApply
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "供应商入驻申请-分页列表查询")
|
||||
@ApiOperation(value="供应商入驻申请-分页列表查询", notes="供应商入驻申请-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<NuConfigSuppliersApply>> queryPageList(NuConfigSuppliersApply nuConfigSuppliersApply,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<NuConfigSuppliersApply> queryWrapper = QueryGenerator.initQueryWrapper(nuConfigSuppliersApply, req.getParameterMap());
|
||||
Page<NuConfigSuppliersApply> page = new Page<NuConfigSuppliersApply>(pageNo, pageSize);
|
||||
IPage<NuConfigSuppliersApply> pageList = nuConfigSuppliersApplyService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param nuConfigSuppliersApply
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "供应商入驻申请-添加")
|
||||
@ApiOperation(value="供应商入驻申请-添加", notes="供应商入驻申请-添加")
|
||||
@RequiresPermissions("configSuppliersApply:供应商入驻申请:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody NuConfigSuppliersApply nuConfigSuppliersApply) {
|
||||
nuConfigSuppliersApplyService.save(nuConfigSuppliersApply);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param nuConfigSuppliersApply
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "供应商入驻申请-编辑")
|
||||
@ApiOperation(value="供应商入驻申请-编辑", notes="供应商入驻申请-编辑")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody NuConfigSuppliersApply nuConfigSuppliersApply) {
|
||||
nuConfigSuppliersApplyService.updateById(nuConfigSuppliersApply);
|
||||
SuppliersInfoMQDto suppliersInfoMQDto = new SuppliersInfoMQDto();
|
||||
BeanUtils.copyProperties(nuConfigSuppliersApply, suppliersInfoMQDto);
|
||||
rabbitMQUtil.sendToExchange("nu.suppliers.suppliersApplyStatus", "nu.suppliers.suppliersApplyStatus", suppliersInfoMQDto);
|
||||
if(StringUtils.equals("2",nuConfigSuppliersApply.getApplyStatus())){
|
||||
ConfigSuppliersInfo configSuppliersInfo = new ConfigSuppliersInfo();
|
||||
BeanUtils.copyProperties(nuConfigSuppliersApply, configSuppliersInfo);
|
||||
configSuppliersInfo.setId(nuConfigSuppliersApply.getSuppliersId());
|
||||
configSuppliersInfoService.save(configSuppliersInfo);
|
||||
}
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "供应商入驻申请-通过id删除")
|
||||
@ApiOperation(value="供应商入驻申请-通过id删除", notes="供应商入驻申请-通过id删除")
|
||||
@RequiresPermissions("configSuppliersApply:供应商入驻申请:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
nuConfigSuppliersApplyService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "供应商入驻申请-批量删除")
|
||||
@ApiOperation(value="供应商入驻申请-批量删除", notes="供应商入驻申请-批量删除")
|
||||
@RequiresPermissions("configSuppliersApply:供应商入驻申请:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.nuConfigSuppliersApplyService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "供应商入驻申请-通过id查询")
|
||||
@ApiOperation(value="供应商入驻申请-通过id查询", notes="供应商入驻申请-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<NuConfigSuppliersApply> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
NuConfigSuppliersApply nuConfigSuppliersApply = nuConfigSuppliersApplyService.getById(id);
|
||||
if(nuConfigSuppliersApply==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(nuConfigSuppliersApply);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param nuConfigSuppliersApply
|
||||
*/
|
||||
@RequiresPermissions("configSuppliersApply:供应商入驻申请:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, NuConfigSuppliersApply nuConfigSuppliersApply) {
|
||||
return super.exportXls(request, nuConfigSuppliersApply, NuConfigSuppliersApply.class, "供应商入驻申请");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("configSuppliersApply:供应商入驻申请:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, NuConfigSuppliersApply.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,103 @@
|
|||
package com.nu.modules.configSuppliersApply.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import org.jeecg.common.constant.ProvinceCityArea;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @Description: nu_config_suppliers_apply
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-12-23
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("nu_config_suppliers_apply")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="nu_config_suppliers_apply对象", description="nu_config_suppliers_apply")
|
||||
public class NuConfigSuppliersApply implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**id*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "id")
|
||||
private java.lang.String id;
|
||||
/**供应商名称*/
|
||||
@Excel(name = "供应商名称", width = 15)
|
||||
@ApiModelProperty(value = "供应商名称")
|
||||
private java.lang.String suppliersName;
|
||||
/**供应商性质 1代理商 2批发商 3制造商*/
|
||||
@Excel(name = "供应商性质 1代理商 2批发商 3制造商", width = 15)
|
||||
@ApiModelProperty(value = "供应商性质 1代理商 2批发商 3制造商")
|
||||
@Dict(dicCode = "suppliers_nature")
|
||||
private java.lang.String suppliersNature;
|
||||
/**供应商地址*/
|
||||
@Excel(name = "供应商地址", width = 15)
|
||||
@ApiModelProperty(value = "供应商地址")
|
||||
private java.lang.String suppliersAddress;
|
||||
/**负责人*/
|
||||
@Excel(name = "负责人", width = 15)
|
||||
@ApiModelProperty(value = "负责人")
|
||||
private java.lang.String personInCharge;
|
||||
/**联系电话*/
|
||||
@Excel(name = "联系电话", width = 15)
|
||||
@ApiModelProperty(value = "联系电话")
|
||||
private java.lang.String contactNumber;
|
||||
/**供应状态 1正常供应 2暂停供应*/
|
||||
@Excel(name = "供应状态 1正常供应 2暂停供应", width = 15)
|
||||
@ApiModelProperty(value = "供应状态 1正常供应 2暂停供应")
|
||||
private java.lang.String supplyState;
|
||||
/**开户行*/
|
||||
@Excel(name = "开户行", width = 15)
|
||||
@ApiModelProperty(value = "开户行")
|
||||
private java.lang.String openingBank;
|
||||
/**开户行账号*/
|
||||
@Excel(name = "开户行账号", width = 15)
|
||||
@ApiModelProperty(value = "开户行账号")
|
||||
private java.lang.String openingBankNo;
|
||||
/**微信账号*/
|
||||
@Excel(name = "微信账号", width = 15)
|
||||
@ApiModelProperty(value = "微信账号")
|
||||
private java.lang.String wechartId;
|
||||
/**资质照片*/
|
||||
@Excel(name = "资质照片", width = 15)
|
||||
@ApiModelProperty(value = "资质照片")
|
||||
private java.lang.String imgPath;
|
||||
/**创建人*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private java.lang.String createBy;
|
||||
/**创建日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private java.util.Date createTime;
|
||||
/**所属部门*/
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
private java.lang.String sysOrgCode;
|
||||
/**审核状态*/
|
||||
@Excel(name = "审核状态", width = 15)
|
||||
@ApiModelProperty(value = "审核状态")
|
||||
private java.lang.String applyStatus;
|
||||
/**审核备注*/
|
||||
@Excel(name = "审核备注", width = 15)
|
||||
@ApiModelProperty(value = "审核备注")
|
||||
private java.lang.String applyContent;
|
||||
private java.lang.String applyId;
|
||||
private String suppliersId;
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package com.nu.modules.configSuppliersApply.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.nu.modules.configSuppliersApply.entity.NuConfigSuppliersApply;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: nu_config_suppliers_apply
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-12-23
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface NuConfigSuppliersApplyMapper extends BaseMapper<NuConfigSuppliersApply> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?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.nu.modules.configSuppliersApply.mapper.NuConfigSuppliersApplyMapper">
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.nu.modules.configSuppliersApply.service;
|
||||
|
||||
import com.nu.modules.configSuppliersApply.entity.NuConfigSuppliersApply;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: nu_config_suppliers_apply
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-12-23
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface INuConfigSuppliersApplyService extends IService<NuConfigSuppliersApply> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package com.nu.modules.configSuppliersApply.service.impl;
|
||||
|
||||
import com.nu.modules.configSuppliersApply.entity.NuConfigSuppliersApply;
|
||||
import com.nu.modules.configSuppliersApply.mapper.NuConfigSuppliersApplyMapper;
|
||||
import com.nu.modules.configSuppliersApply.service.INuConfigSuppliersApplyService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: nu_config_suppliers_apply
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-12-23
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class NuConfigSuppliersApplyServiceImpl extends ServiceImpl<NuConfigSuppliersApplyMapper, NuConfigSuppliersApply> implements INuConfigSuppliersApplyService {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
package com.nu.mq.suppliers.exceptionhandler;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.amqp.AmqpRejectAndDontRequeueException;
|
||||
import org.springframework.amqp.core.Message;
|
||||
import org.springframework.amqp.rabbit.listener.api.RabbitListenerErrorHandler;
|
||||
import org.springframework.amqp.rabbit.support.ListenerExecutionFailedException;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Slf4j
|
||||
@Component("suppliersMQExceptionHandler")
|
||||
public class SuppliersMQExceptionHandler implements RabbitListenerErrorHandler {
|
||||
|
||||
@Override
|
||||
public Object handleError(Message message, org.springframework.messaging.Message<?> message1, ListenerExecutionFailedException e) {
|
||||
log.error("MQ消息处理失败 | 消息体: {} | 异常原因: {}", new String(message.getBody()), e.getCause().getMessage());
|
||||
throw new AmqpRejectAndDontRequeueException("消息处理失败且禁止重试", e);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
package com.nu.mq.suppliers.listener;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component("suppliersDQNP")
|
||||
public class DynamicQueueNameProvider {
|
||||
|
||||
@Autowired
|
||||
private ISysBaseAPI sysBaseAPI;
|
||||
|
||||
public String getQueueName() {
|
||||
JSONObject deptInfo = sysBaseAPI.getDeptInfo();
|
||||
String orgCode = deptInfo.getString("code");
|
||||
if (StringUtils.isNotBlank(orgCode)) {
|
||||
return orgCode + ".suppliers.applyStatus";
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
public String getKeyName() {
|
||||
return getQueueName();
|
||||
}
|
||||
|
||||
public String getEditSuppliersApply() {
|
||||
JSONObject deptInfo = sysBaseAPI.getDeptInfo();
|
||||
String orgCode = deptInfo.getString("code");
|
||||
if (StringUtils.isNotBlank(orgCode)) {
|
||||
return orgCode + ".suppliers.editSuppliersApply";
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
public String getEditSuppApply() {
|
||||
return getEditSuppliersApply();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,89 @@
|
|||
package com.nu.mq.suppliers.listener;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.nu.dto.SuppliersInfoMQDto;
|
||||
import com.nu.modules.configSuppliersApply.entity.NuConfigSuppliersApply;
|
||||
import com.nu.modules.configSuppliersApply.service.INuConfigSuppliersApplyService;
|
||||
import com.nu.modules.configSuppliersInfo.entity.ConfigSuppliersInfo;
|
||||
import com.nu.modules.configSuppliersInfo.service.IConfigSuppliersInfoService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.springframework.amqp.core.ExchangeTypes;
|
||||
import org.springframework.amqp.rabbit.annotation.Exchange;
|
||||
import org.springframework.amqp.rabbit.annotation.Queue;
|
||||
import org.springframework.amqp.rabbit.annotation.QueueBinding;
|
||||
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class SuppliersMQListener {
|
||||
@Autowired
|
||||
private INuConfigSuppliersApplyService nuConfigSuppliersApplyService;
|
||||
@Autowired
|
||||
private IConfigSuppliersInfoService configSuppliersInfoService;
|
||||
/**
|
||||
* 供应商-供应商申请合作
|
||||
*/
|
||||
@AutoLog(value = "供应商-供应商申请合作")
|
||||
@RabbitListener(
|
||||
bindings = @QueueBinding(
|
||||
value = @Queue(name = "#{suppliersDQNP.getQueueName()}"),
|
||||
exchange = @Exchange(name = "nu.suppliers.applyStatus", type = ExchangeTypes.DIRECT),
|
||||
key = "#{suppliersDQNP.getKeyName()}"
|
||||
),
|
||||
errorHandler = "suppliersMQExceptionHandler"
|
||||
)
|
||||
public void applyStatus(SuppliersInfoMQDto suppliersInfoMQDto) {
|
||||
try {
|
||||
log.info("供应商申请");
|
||||
log.info("供应商申请: {}", suppliersInfoMQDto);
|
||||
log.info("业务处理");
|
||||
NuConfigSuppliersApply configSuppliersApply = new NuConfigSuppliersApply();
|
||||
BeanUtils.copyProperties(suppliersInfoMQDto, configSuppliersApply);
|
||||
nuConfigSuppliersApplyService.save(configSuppliersApply);
|
||||
System.out.println("保存成功");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 供应商-供应商申请合作
|
||||
*/
|
||||
@AutoLog(value = "供应商-供应商修改信息")
|
||||
@RabbitListener(
|
||||
bindings = @QueueBinding(
|
||||
value = @Queue(name = "#{suppliersDQNP.getEditSuppliersApply()}"),
|
||||
exchange = @Exchange(name = "nu.suppliers.editSuppliersApply", type = ExchangeTypes.DIRECT),
|
||||
key = "#{suppliersDQNP.getEditSuppApply()}"
|
||||
),
|
||||
errorHandler = "suppliersMQExceptionHandler"
|
||||
)
|
||||
public void editSuppliersApply(SuppliersInfoMQDto suppliersInfoMQDto) {
|
||||
try {
|
||||
log.info("供应商修改信息");
|
||||
log.info("供应商修改信息: {}", suppliersInfoMQDto);
|
||||
log.info("业务处理");
|
||||
|
||||
ConfigSuppliersInfo param = configSuppliersInfoService.getById(suppliersInfoMQDto.getSuppliersId());
|
||||
BeanUtils.copyProperties(suppliersInfoMQDto, param);
|
||||
param.setId(suppliersInfoMQDto.getSuppliersId());
|
||||
configSuppliersInfoService.updateById(param);
|
||||
|
||||
System.out.println("保存成功");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -2901,7 +2901,7 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
cameraInfo.setParentId(tplinkInfo.getParentId());
|
||||
cameraInfo.setFileName(fileName);
|
||||
cameraInfo.setVideoType("1");
|
||||
cameraInfo.setFtpUploadpath("/upload/"+year+month+day+"/fwxm/tplinkVideo");
|
||||
cameraInfo.setFtpUploadpath("/upFiles101/"+year+month+day+"/fwxm/tplinkVideo");
|
||||
cameraInfo.setStartTime(startTime);
|
||||
cameraInfo.setEndTime(endTime);
|
||||
try {
|
||||
|
|
@ -2968,10 +2968,10 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
Date date = sdf.parse(cameraInfo.getStartTime());
|
||||
Date date2 = sdf.parse(cameraInfo.getEndTime());
|
||||
long startTime = date.getTime();
|
||||
long endTime = date2.getTime();
|
||||
// long startTime = 1765993096;
|
||||
// long endTime = 1765993156;
|
||||
// long startTime = date.getTime();
|
||||
// long endTime = date2.getTime();
|
||||
long startTime = 1765993096;
|
||||
long endTime = 1765993156;
|
||||
sb.append("\"startTime\"").append(":").append(startTime).append(",");
|
||||
sb.append("\"endTime\"").append(":").append(endTime).append(",");
|
||||
sb.append("\"downloadInfo\"").append(":{");
|
||||
|
|
|
|||
Loading…
Reference in New Issue