添加平台构建工单
This commit is contained in:
parent
2927e92e02
commit
80e7a3058d
|
@ -51,4 +51,6 @@ public class WorkOrderEntity implements Serializable {
|
||||||
private String tel;
|
private String tel;
|
||||||
/**工单提交人邮件地址*/
|
/**工单提交人邮件地址*/
|
||||||
private String email;
|
private String email;
|
||||||
|
/**工单类型 1平台构建*/
|
||||||
|
private String workType;
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,10 +98,9 @@ public class WorkOrderController extends JeecgController<WorkOrder, IWorkOrderSe
|
||||||
*/
|
*/
|
||||||
@AutoLog(value = "工单表-编辑")
|
@AutoLog(value = "工单表-编辑")
|
||||||
@ApiOperation(value="工单表-编辑", notes="工单表-编辑")
|
@ApiOperation(value="工单表-编辑", notes="工单表-编辑")
|
||||||
@RequiresPermissions("workorder:nu_work_order:edit")
|
|
||||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||||
public Result<String> edit(@RequestBody WorkOrder workOrder) {
|
public Result<String> edit(@RequestBody WorkOrder workOrder) {
|
||||||
workOrderService.updateById(workOrder);
|
workOrderService.updateMqById(workOrder);
|
||||||
return Result.OK("编辑成功!");
|
return Result.OK("编辑成功!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -110,4 +110,10 @@ public class WorkOrder implements Serializable {
|
||||||
@Excel(name = "工单提交人邮件地址", width = 15)
|
@Excel(name = "工单提交人邮件地址", width = 15)
|
||||||
@ApiModelProperty(value = "工单提交人邮件地址")
|
@ApiModelProperty(value = "工单提交人邮件地址")
|
||||||
private java.lang.String email;
|
private java.lang.String email;
|
||||||
|
|
||||||
|
/**状态 1平台构建*/
|
||||||
|
@Dict(dicCode = "work_type")
|
||||||
|
@Excel(name = "工单类型", width = 15)
|
||||||
|
@ApiModelProperty(value = "工单类型")
|
||||||
|
private java.lang.String workType;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,4 +11,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
*/
|
*/
|
||||||
public interface IWorkOrderService extends IService<WorkOrder> {
|
public interface IWorkOrderService extends IService<WorkOrder> {
|
||||||
|
|
||||||
|
void updateMqById(WorkOrder workOrder);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,14 @@
|
||||||
package com.nu.modules.workorder.service.impl;
|
package com.nu.modules.workorder.service.impl;
|
||||||
|
|
||||||
|
import com.nu.dto.WorkOrderMQDto;
|
||||||
import com.nu.modules.workorder.api.IWorkOrderApi;
|
import com.nu.modules.workorder.api.IWorkOrderApi;
|
||||||
import com.nu.modules.workorder.entity.WorkOrder;
|
import com.nu.modules.workorder.entity.WorkOrder;
|
||||||
import com.nu.modules.workorder.entity.WorkOrderEntity;
|
import com.nu.modules.workorder.entity.WorkOrderEntity;
|
||||||
import com.nu.modules.workorder.mapper.WorkOrderMapper;
|
import com.nu.modules.workorder.mapper.WorkOrderMapper;
|
||||||
import com.nu.modules.workorder.service.IWorkOrderService;
|
import com.nu.modules.workorder.service.IWorkOrderService;
|
||||||
|
import com.nu.utils.RabbitMQUtil;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
@ -19,10 +22,22 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
@Service
|
@Service
|
||||||
public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder> implements IWorkOrderService, IWorkOrderApi {
|
public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder> implements IWorkOrderService, IWorkOrderApi {
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RabbitMQUtil rabbitMQUtil;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int createWorkOrder(WorkOrderEntity workOrderEntity) {
|
public int createWorkOrder(WorkOrderEntity workOrderEntity) {
|
||||||
WorkOrder workOrder = new WorkOrder();
|
WorkOrder workOrder = new WorkOrder();
|
||||||
BeanUtils.copyProperties(workOrderEntity,workOrder);
|
BeanUtils.copyProperties(workOrderEntity,workOrder);
|
||||||
return baseMapper.insert(workOrder);
|
return baseMapper.insert(workOrder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateMqById(WorkOrder workOrder) {
|
||||||
|
baseMapper.updateById(workOrder);
|
||||||
|
WorkOrderMQDto workOrderMQDto = new WorkOrderMQDto();
|
||||||
|
BeanUtils.copyProperties(workOrder,workOrderMQDto);
|
||||||
|
rabbitMQUtil.sendToExchange("nu.workOrder.reply", "nu.workOrder.reply", workOrderMQDto);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,8 +7,11 @@ import com.nu.modules.orginfo.service.IOrgInfoService;
|
||||||
import com.nu.modules.workorder.api.IWorkOrderApi;
|
import com.nu.modules.workorder.api.IWorkOrderApi;
|
||||||
import com.nu.modules.workorder.entity.WorkOrderEntity;
|
import com.nu.modules.workorder.entity.WorkOrderEntity;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
import org.jeecg.common.system.api.ISysBaseAPI;
|
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||||
import org.jeecg.common.system.entity.SysDepartEntity;
|
import org.jeecg.common.system.entity.SysDepartEntity;
|
||||||
|
import org.jeecg.common.system.vo.SysDepartModel;
|
||||||
import org.springframework.amqp.core.ExchangeTypes;
|
import org.springframework.amqp.core.ExchangeTypes;
|
||||||
import org.springframework.amqp.rabbit.annotation.Exchange;
|
import org.springframework.amqp.rabbit.annotation.Exchange;
|
||||||
import org.springframework.amqp.rabbit.annotation.Queue;
|
import org.springframework.amqp.rabbit.annotation.Queue;
|
||||||
|
@ -37,6 +40,7 @@ public class OrgInfoMQListener {
|
||||||
* 2、向机构附加信息表中插入数据
|
* 2、向机构附加信息表中插入数据
|
||||||
* @param dto
|
* @param dto
|
||||||
*/
|
*/
|
||||||
|
@AutoLog(value = "管理平台提取加盟审核工单")
|
||||||
@RabbitListener(
|
@RabbitListener(
|
||||||
bindings = @QueueBinding(
|
bindings = @QueueBinding(
|
||||||
value = @Queue(name = "hldy.orgApply.build"),
|
value = @Queue(name = "hldy.orgApply.build"),
|
||||||
|
@ -49,9 +53,19 @@ public class OrgInfoMQListener {
|
||||||
OrgInfo orgInfo = new OrgInfo();
|
OrgInfo orgInfo = new OrgInfo();
|
||||||
BeanUtils.copyProperties(dto,orgInfo);
|
BeanUtils.copyProperties(dto,orgInfo);
|
||||||
orgInfo.setPkId(dto.getId());
|
orgInfo.setPkId(dto.getId());
|
||||||
|
|
||||||
|
OrgInfo orgInfo1 = orgInfoService.getById(dto.getId());
|
||||||
|
//数据库没有值的时候才新增一条记录
|
||||||
|
if(orgInfo1==null || StringUtils.isBlank(orgInfo1.getId())){
|
||||||
//向机构附加信息表中插入数据
|
//向机构附加信息表中插入数据
|
||||||
orgInfoService.save(orgInfo);
|
orgInfoService.save(orgInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SysDepartModel departModel = sysBaseAPI.selectDepartById(dto.getId());
|
||||||
|
String orgCode = departModel.getOrgCode();
|
||||||
|
//数据库没有值的时候才新增一条记录
|
||||||
|
if(departModel==null || StringUtils.isBlank(departModel.getId())){
|
||||||
//在系统机构表中创建机构信息
|
//在系统机构表中创建机构信息
|
||||||
SysDepartEntity sysDepart = new SysDepartEntity();
|
SysDepartEntity sysDepart = new SysDepartEntity();
|
||||||
sysDepart.setId(dto.getId());
|
sysDepart.setId(dto.getId());
|
||||||
|
@ -63,7 +77,9 @@ public class OrgInfoMQListener {
|
||||||
sysDepart.setDelFlag("0");
|
sysDepart.setDelFlag("0");
|
||||||
sysDepart.setIzLeaf(1);
|
sysDepart.setIzLeaf(1);
|
||||||
sysDepart.setPlatType("ywjg");
|
sysDepart.setPlatType("ywjg");
|
||||||
String orgCode = sysBaseAPI.addOrg(sysDepart);
|
orgCode = sysBaseAPI.addOrg(sysDepart);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//新增工单
|
//新增工单
|
||||||
WorkOrderEntity workOrderEntity = new WorkOrderEntity();
|
WorkOrderEntity workOrderEntity = new WorkOrderEntity();
|
||||||
|
@ -81,6 +97,7 @@ public class OrgInfoMQListener {
|
||||||
workOrderEntity.setCreateTime(new Date());
|
workOrderEntity.setCreateTime(new Date());
|
||||||
workOrderEntity.setTel(dto.getOperateTelephone());
|
workOrderEntity.setTel(dto.getOperateTelephone());
|
||||||
workOrderEntity.setEmail(dto.getOperateEmail());
|
workOrderEntity.setEmail(dto.getOperateEmail());
|
||||||
|
workOrderEntity.setWorkType("1");//1平台构建
|
||||||
workOrderApi.createWorkOrder(workOrderEntity);
|
workOrderApi.createWorkOrder(workOrderEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -51,4 +51,6 @@ public class WorkOrderMQDto implements Serializable {
|
||||||
private String tel;
|
private String tel;
|
||||||
/**工单提交人邮件地址*/
|
/**工单提交人邮件地址*/
|
||||||
private String email;
|
private String email;
|
||||||
|
/**状态 1平台构建*/
|
||||||
|
private String workType;
|
||||||
}
|
}
|
||||||
|
|
|
@ -628,4 +628,13 @@ public interface ISysBaseAPI extends CommonAPI {
|
||||||
JSONObject getOrgInfo(String orgCode);
|
JSONObject getOrgInfo(String orgCode);
|
||||||
|
|
||||||
String addOrg(SysDepartEntity sysDepart);
|
String addOrg(SysDepartEntity sysDepart);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过部门id获取部门全部信息
|
||||||
|
*
|
||||||
|
* @param id 部门id
|
||||||
|
* @return SysDepartModel对象
|
||||||
|
*/
|
||||||
|
SysDepartModel selectDepartById(String id);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1923,6 +1923,16 @@ public class SysBaseApiImpl implements ISysBaseAPI {
|
||||||
return code+"";
|
return code+"";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SysDepartModel selectDepartById(String id) {
|
||||||
|
SysDepart depart = sysDepartService.getDepartById(id);
|
||||||
|
SysDepartModel sysDepartModel = new SysDepartModel();
|
||||||
|
if(depart!=null){
|
||||||
|
BeanUtils.copyProperties(depart, sysDepartModel);
|
||||||
|
}
|
||||||
|
return sysDepartModel;
|
||||||
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
private JSONObject queryOrgInfo(String orgCode) {
|
private JSONObject queryOrgInfo(String orgCode) {
|
||||||
QueryWrapper<SysDepart> qw = new QueryWrapper<>();
|
QueryWrapper<SysDepart> qw = new QueryWrapper<>();
|
||||||
|
|
Loading…
Reference in New Issue