添加供应商功能及修改员工头像问题
This commit is contained in:
parent
1559b6a234
commit
ae9c1ec397
|
|
@ -0,0 +1,79 @@
|
|||
package com.nu.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description: 供应商可提供的物料信息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2026-02-28
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class SuppliersMaterialInfoDto implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**id*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "id")
|
||||
private String id;
|
||||
/**创建人*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createBy;
|
||||
/**创建日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private Date createTime;
|
||||
/**更新人*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private String updateBy;
|
||||
/**更新日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新日期")
|
||||
private Date updateTime;
|
||||
/**供应商*/
|
||||
@Excel(name = "供应商", width = 15, dictTable = "nu_biz_suppliers_info", dicText = "suppliers_name", dicCode = "id")
|
||||
@Dict(dictTable = "nu_biz_suppliers_info", dicText = "suppliers_name", dicCode = "id")
|
||||
@ApiModelProperty(value = "供应商")
|
||||
private String suppliersId;
|
||||
/**货品名称*/
|
||||
@Excel(name = "货品名称", width = 15)
|
||||
@ApiModelProperty(value = "货品名称")
|
||||
private String materialName;
|
||||
/**规格型号*/
|
||||
@Excel(name = "规格型号", width = 15)
|
||||
@ApiModelProperty(value = "规格型号")
|
||||
private String specificationModel;
|
||||
/**品牌型号*/
|
||||
@Excel(name = "品牌型号", width = 15)
|
||||
@ApiModelProperty(value = "品牌型号")
|
||||
private String brandType;
|
||||
/**生产厂家*/
|
||||
@Excel(name = "生产厂家", width = 15)
|
||||
@ApiModelProperty(value = "生产厂家")
|
||||
private String manufacturer;
|
||||
/**销售单价*/
|
||||
@Excel(name = "销售单价", width = 15)
|
||||
@ApiModelProperty(value = "销售单价")
|
||||
private BigDecimal salesUnitPrice;
|
||||
/**销售单位*/
|
||||
@Excel(name = "销售单位", width = 15)
|
||||
@ApiModelProperty(value = "销售单位")
|
||||
private String salesUnit;
|
||||
}
|
||||
|
|
@ -115,7 +115,6 @@ public class EmployeesApplyController extends JeecgController<EmployeesApply, IE
|
|||
*/
|
||||
@AutoLog(value = "员工申请-编辑")
|
||||
@ApiOperation(value = "员工申请-编辑", notes = "员工申请-编辑")
|
||||
@RequiresPermissions("employeesapply:nu_biz_employees_apply:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody EmployeesApply employeesApply) {
|
||||
if (StringUtils.isNotBlank(employeesApply.getStatus())) {
|
||||
|
|
@ -131,6 +130,7 @@ public class EmployeesApplyController extends JeecgController<EmployeesApply, IE
|
|||
//入职时间
|
||||
Date entryTime = new Date();
|
||||
|
||||
EmployeesApply apply = employeesApplyService.getById(employeesApply.getId());
|
||||
//审批通过后将员工信息插入到员工表中
|
||||
BizEmployeesInfo employeesInfo = new BizEmployeesInfo();
|
||||
if ("2".equals(employeesApply.getStatus())) {
|
||||
|
|
@ -143,6 +143,7 @@ public class EmployeesApplyController extends JeecgController<EmployeesApply, IE
|
|||
employeesInfo.setSysOrgCode(deptInfo.getString("code"));
|
||||
employeesInfo.setEntryTime(entryTime);
|
||||
employeesInfo.setIzInvited("0".equals(employeesApply.getApplyType()) ? "Y" : "N");
|
||||
employeesInfo.setHeadPath(apply.getHeadPath());
|
||||
employeesInfoService.save(employeesInfo);
|
||||
}
|
||||
}
|
||||
|
|
@ -156,7 +157,6 @@ public class EmployeesApplyController extends JeecgController<EmployeesApply, IE
|
|||
mqdto.setOpenId(employeesApply.getOpenId());//openId
|
||||
if ("2".equals(employeesApply.getStatus())) {
|
||||
mqdto.setEntryTime(entryTime);//入驻时间
|
||||
EmployeesApply apply = employeesApplyService.getById(employeesApply.getId());
|
||||
mqdto.setTel(apply.getTel());
|
||||
mqdto.setName(apply.getName());
|
||||
mqdto.setSex(apply.getSex());
|
||||
|
|
|
|||
|
|
@ -37,7 +37,8 @@
|
|||
b.apply_type,
|
||||
b.audit_content,
|
||||
b.iz_history,
|
||||
b.open_id
|
||||
b.open_id,
|
||||
b.head_path
|
||||
FROM nu_biz_employees_apply b
|
||||
) sup
|
||||
${ew.customSqlSegment}
|
||||
|
|
@ -165,7 +166,8 @@
|
|||
b.apply_type,
|
||||
b.audit_content,
|
||||
b.iz_history,
|
||||
b.open_id
|
||||
b.open_id,
|
||||
b.head_path
|
||||
FROM nu_biz_employees_apply b
|
||||
where b.id = #{id}
|
||||
</select>
|
||||
|
|
@ -204,7 +206,8 @@
|
|||
b.apply_type,
|
||||
b.audit_content,
|
||||
b.iz_history,
|
||||
b.open_id
|
||||
b.open_id,
|
||||
b.head_path
|
||||
FROM nu_biz_employees_apply b
|
||||
where b.employee_id = #{employeeId}
|
||||
and b.status = #{status}
|
||||
|
|
@ -250,7 +253,8 @@
|
|||
b.apply_type,
|
||||
b.audit_content,
|
||||
b.iz_history,
|
||||
b.open_id
|
||||
b.open_id,
|
||||
b.head_path
|
||||
FROM nu_biz_employees_apply b
|
||||
where b.employee_id = #{employeeId}
|
||||
and b.status = #{status}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
package com.nu.modules.bizSuppliers.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.nu.modules.bizSuppliers.entity.NuBizSuppliersMaterialInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 供应商可提供的物料信息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2026-02-28
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IBizSuppliersMaterialInfoService extends IService<NuBizSuppliersMaterialInfo> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.nu.modules.bizSuppliers.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nu.modules.bizSuppliers.entity.NuBizSuppliersMaterialInfo;
|
||||
import com.nu.modules.bizSuppliers.mapper.NuBizSuppliersMaterialInfoMapper;
|
||||
import com.nu.modules.bizSuppliers.service.IBizSuppliersMaterialInfoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @Description: 供应商可提供的物料信息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2026-02-28
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class BizSuppliersMaterialInfoServiceImpl extends ServiceImpl<NuBizSuppliersMaterialInfoMapper, NuBizSuppliersMaterialInfo> implements IBizSuppliersMaterialInfoService {
|
||||
|
||||
}
|
||||
|
|
@ -229,4 +229,27 @@ public class ConfigSuppliersInfoController extends JeecgController<ConfigSupplie
|
|||
|
||||
|
||||
|
||||
@AutoLog(value = "供应商合作")
|
||||
@ApiOperation(value="供应商合作", notes="供应商合作")
|
||||
@PostMapping(value = "/cooperationSupp")
|
||||
public void cooperationSupp(@RequestBody ConfigSuppliersInfo configSuppliersInfo) {
|
||||
//判断是否在本地有数据
|
||||
ConfigSuppliersInfo configSuppliersInfoOld = configSuppliersInfoService.getById(configSuppliersInfo.getId());
|
||||
if(configSuppliersInfoOld == null){
|
||||
//查询机构信息
|
||||
NuBizSuppliersInfo nuBizSuppliersInfo = nuBizSuppliersInfoService.getById(configSuppliersInfo.getId());
|
||||
|
||||
BeanUtils.copyProperties(nuBizSuppliersInfo,configSuppliersInfo);
|
||||
//将供应商拉取到本地
|
||||
List<ConfigSuppliersInfo> configSuppliersInfoList = new ArrayList<>();
|
||||
configSuppliersInfo.setWlType("1");
|
||||
configSuppliersInfoList.add(configSuppliersInfo);
|
||||
|
||||
configSuppliersInfoService.addBatch(configSuppliersInfoList);
|
||||
}
|
||||
//拉取供应商物料
|
||||
configSuppliersInfoService.cooperationSupp(configSuppliersInfo);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,4 +19,6 @@ public interface IConfigSuppliersInfoService extends IService<ConfigSuppliersInf
|
|||
void addBatch(List<ConfigSuppliersInfo> configSuppliersInfo);
|
||||
|
||||
void updateWlType(ConfigSuppliersInfo configSuppliersInfo);
|
||||
|
||||
void cooperationSupp(ConfigSuppliersInfo configSuppliersInfo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,12 @@
|
|||
package com.nu.modules.configSuppliersInfo.service.impl;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nu.dto.SuppliersInfoMQDto;
|
||||
import com.nu.modules.ConfigMaterial.entity.ConfigMaterialInfo;
|
||||
import com.nu.modules.ConfigMaterial.service.IConfigMaterialInfoService;
|
||||
import com.nu.modules.bizSuppliers.entity.NuBizSuppliersMaterialInfo;
|
||||
import com.nu.modules.bizSuppliers.service.INuBizSuppliersInfoService;
|
||||
import com.nu.modules.bizSuppliers.service.IBizSuppliersMaterialInfoService;
|
||||
import com.nu.modules.bizSuppliers.service.INuBizSuppliersMaterialInfoService;
|
||||
import com.nu.modules.configSuppliersInfo.entity.ConfigSuppliersInfo;
|
||||
import com.nu.modules.configSuppliersInfo.mapper.ConfigSuppliersInfoMapper;
|
||||
|
|
@ -20,13 +19,10 @@ import org.springframework.context.annotation.Lazy;
|
|||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description: 供应商
|
||||
|
|
@ -40,6 +36,9 @@ public class ConfigSuppliersInfoServiceImpl extends ServiceImpl<ConfigSuppliersI
|
|||
@Autowired
|
||||
@Lazy
|
||||
private INuBizSuppliersMaterialInfoService nuBizSuppliersMaterialInfoService;
|
||||
@Autowired
|
||||
@Lazy
|
||||
private IBizSuppliersMaterialInfoService bizSuppliersMaterialInfoService;
|
||||
|
||||
@Autowired
|
||||
private IConfigMaterialInfoService configMaterialInfoService;
|
||||
|
|
@ -70,6 +69,24 @@ public class ConfigSuppliersInfoServiceImpl extends ServiceImpl<ConfigSuppliersI
|
|||
updateMaterialInfo(wlList,configSuppliersInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cooperationSupp(ConfigSuppliersInfo configSuppliersInfo) {
|
||||
// 查询供应商对应的物料
|
||||
List<NuBizSuppliersMaterialInfo> xsList = nuBizSuppliersMaterialInfoService.list( new QueryWrapper<NuBizSuppliersMaterialInfo>().eq("suppliers_id", configSuppliersInfo.getId()) );
|
||||
// 如果xsList为空,跳过当前循环
|
||||
if (xsList == null || xsList.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
updateSupInfo(xsList,configSuppliersInfo);
|
||||
}
|
||||
|
||||
@DS("master")
|
||||
private void updateSupInfo(List<NuBizSuppliersMaterialInfo> wlList, ConfigSuppliersInfo configSuppliersInfo) {
|
||||
//先删除后插入
|
||||
bizSuppliersMaterialInfoService.remove(new QueryWrapper<NuBizSuppliersMaterialInfo>().eq("suppliers_id", configSuppliersInfo.getId()));
|
||||
bizSuppliersMaterialInfoService.saveBatch(wlList);
|
||||
}
|
||||
|
||||
private void updateMaterialInfo( List<ConfigMaterialInfo> wlList, ConfigSuppliersInfo configSuppliersInfo) {
|
||||
|
||||
if(wlList.size()==0){
|
||||
|
|
|
|||
|
|
@ -53,4 +53,20 @@ public class DynamicQueueNameProvider {
|
|||
public String getUpSuppApplyInfoKey() {
|
||||
return getUpSuppliersInfo();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getUpdateMaterialInfo() {
|
||||
JSONObject deptInfo = sysBaseAPI.getDeptInfo();
|
||||
String orgCode = deptInfo.getString("code");
|
||||
if (StringUtils.isNotBlank(orgCode)) {
|
||||
return orgCode + ".suppliers.updateMaterialInfo";
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
public String getUpdateMaterialInfoKey() {
|
||||
return getUpdateMaterialInfo();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,9 @@ package com.nu.mq.suppliers.listener;
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.nu.dto.SuppliersInfoMQDto;
|
||||
import com.nu.dto.SuppliersMaterialInfoDto;
|
||||
import com.nu.modules.bizSuppliers.entity.NuBizSuppliersMaterialInfo;
|
||||
import com.nu.modules.bizSuppliers.service.IBizSuppliersMaterialInfoService;
|
||||
import com.nu.modules.configSuppliersApply.entity.NuConfigSuppliersApply;
|
||||
import com.nu.modules.configSuppliersApply.service.INuConfigSuppliersApplyService;
|
||||
import com.nu.modules.configSuppliersInfo.entity.ConfigSuppliersInfo;
|
||||
|
|
@ -27,6 +30,8 @@ public class SuppliersMQListener {
|
|||
private INuConfigSuppliersApplyService nuConfigSuppliersApplyService;
|
||||
@Autowired
|
||||
private IConfigSuppliersInfoService configSuppliersInfoService;
|
||||
@Autowired
|
||||
private IBizSuppliersMaterialInfoService bizSuppliersMaterialInfoService;
|
||||
|
||||
/**
|
||||
* 供应商-供应商申请合作
|
||||
|
|
@ -162,4 +167,31 @@ public class SuppliersMQListener {
|
|||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 供应商-供应商申请合作
|
||||
*/
|
||||
@AutoLog(value = "供应商-供应商申请合作")
|
||||
@RabbitListener(
|
||||
bindings = @QueueBinding(
|
||||
value = @Queue(name = "#{suppliersDQNP.getUpdateMaterialInfo()}"),
|
||||
exchange = @Exchange(name = "nu.suppliers.applyStatus", type = ExchangeTypes.DIRECT),
|
||||
key = "#{suppliersDQNP.getUpdateMaterialInfoKey()}"
|
||||
),
|
||||
errorHandler = "suppliersMQExceptionHandler"
|
||||
)
|
||||
public void updateMaterialInfo(SuppliersMaterialInfoDto suppliersMaterialInfoDto) {
|
||||
try {
|
||||
NuBizSuppliersMaterialInfo bizSuppliersMaterialInfo = new NuBizSuppliersMaterialInfo();
|
||||
BeanUtils.copyProperties(suppliersMaterialInfoDto, bizSuppliersMaterialInfo);
|
||||
bizSuppliersMaterialInfoService.updateById(bizSuppliersMaterialInfo);
|
||||
|
||||
System.out.println("保存成功");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue