Merge branch 'master' of http://42.192.7.176:3000/suojin/jonhon-mes-svr into liweidong
commit
84267e50e4
49 changed files with 1219 additions and 212 deletions
@ -0,0 +1,53 @@ |
||||
package org.springblade.desk.oem.pojo.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import io.swagger.v3.oas.annotations.media.Schema; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import org.springblade.core.mp.base.BaseEntity; |
||||
|
||||
import java.io.Serial; |
||||
|
||||
/** |
||||
* 外协标准工序代码 实体类 |
||||
* |
||||
* @author maxg |
||||
* @since 2026-04-29 |
||||
*/ |
||||
@Data |
||||
@TableName("MES_OEM_STANDARD_PROCESS") |
||||
@Schema(description = "OemStandardProcess对象") |
||||
@EqualsAndHashCode(callSuper = true) |
||||
public class OemStandardProcessEntity extends BaseEntity { |
||||
|
||||
@Serial |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/** |
||||
* 工序ID |
||||
*/ |
||||
@Schema(description = "工序ID") |
||||
private Long processId; |
||||
/** |
||||
* 镀种 |
||||
*/ |
||||
@Schema(description = "镀种") |
||||
private String plate; |
||||
/** |
||||
* 镀层厚度 |
||||
*/ |
||||
@Schema(description = "镀层厚度") |
||||
private String plateThickness; |
||||
/** |
||||
* 零件名称 |
||||
*/ |
||||
@Schema(description = "零件名称") |
||||
private String partName; |
||||
/** |
||||
* 标准工序代码 |
||||
*/ |
||||
@Schema(description = "标准工序代码") |
||||
private String standardProcessCode; |
||||
|
||||
|
||||
} |
||||
@ -0,0 +1,47 @@ |
||||
package org.springblade.desk.oem.pojo.excel; |
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty; |
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth; |
||||
import com.alibaba.excel.annotation.write.style.ContentRowHeight; |
||||
import com.alibaba.excel.annotation.write.style.HeadRowHeight; |
||||
import io.swagger.v3.oas.annotations.media.Schema; |
||||
import lombok.Data; |
||||
|
||||
import java.io.Serial; |
||||
import java.io.Serializable; |
||||
|
||||
/** |
||||
* 外协标准工序代码模板导入 |
||||
* |
||||
* @author maxg |
||||
* @since 2026-04-29 |
||||
*/ |
||||
@Data |
||||
@ColumnWidth(25) |
||||
@HeadRowHeight(20) |
||||
@ContentRowHeight(18) |
||||
public class OemStandardProcessExcel implements Serializable { |
||||
|
||||
@Serial |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
@ColumnWidth(20) |
||||
@ExcelProperty("工序") |
||||
private String processName; |
||||
|
||||
@ColumnWidth(20) |
||||
@ExcelProperty("镀种") |
||||
private String plate; |
||||
|
||||
@ColumnWidth(20) |
||||
@ExcelProperty("镀层厚度") |
||||
private String plateThickness; |
||||
|
||||
@ColumnWidth(20) |
||||
@ExcelProperty("零件名称") |
||||
private String partName; |
||||
|
||||
@ColumnWidth(20) |
||||
@ExcelProperty("标准工序代码") |
||||
private String standardProcessCode; |
||||
} |
||||
@ -0,0 +1,38 @@ |
||||
package org.springblade.desk.oem.pojo.vo; |
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import org.springblade.desk.oem.pojo.entity.OemStandardProcessEntity; |
||||
|
||||
import java.io.Serial; |
||||
|
||||
/** |
||||
* 外协标准工序代码 视图实体类 |
||||
* |
||||
* @author maxg |
||||
* @since 2026-04-29 |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = true) |
||||
public class OemStandardProcessVO extends OemStandardProcessEntity { |
||||
|
||||
@Serial |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
@Schema(description = "工序名称") |
||||
private String processName; |
||||
|
||||
@Schema(description = "维护人") |
||||
private String updateUserName; |
||||
|
||||
/** |
||||
* 排序字段 |
||||
*/ |
||||
private String orderByField; |
||||
/** |
||||
* true: 升序,false: 降序 |
||||
*/ |
||||
private boolean isAsc; |
||||
|
||||
} |
||||
@ -0,0 +1,31 @@ |
||||
package org.springblade.erpdata.feign; |
||||
|
||||
import org.springblade.common.constant.LauncherConstant; |
||||
import org.springblade.erpdata.pojo.dto.view.MesRbSply; |
||||
import org.springframework.cloud.openfeign.FeignClient; |
||||
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* ERP供应商数据Feign客户端 |
||||
* |
||||
* @author BladeX |
||||
* @since 2026-04-29 |
||||
*/ |
||||
@FeignClient( |
||||
value = LauncherConstant.APPLICATION_ERP_DATA_NAME |
||||
) |
||||
public interface IErpMesRbSplyClient { |
||||
|
||||
String API_PREFIX = "/feign/erpdata/supply"; |
||||
String GET_SPLY_LIST = API_PREFIX + "/getSplyList"; |
||||
|
||||
/** |
||||
* 从ERP获取供应商列表 |
||||
* |
||||
* @return 供应商列表 |
||||
*/ |
||||
@GetMapping(GET_SPLY_LIST) |
||||
List<MesRbSply> getSplyList(); |
||||
} |
||||
@ -0,0 +1,58 @@ |
||||
package org.springblade.erpdata.pojo.dto.view; |
||||
|
||||
import lombok.Data; |
||||
|
||||
/** |
||||
* 对应ERP中视图 V_MES_RB_SPLY - 供应商/客户信息 |
||||
* |
||||
* @author BladeX |
||||
* @since 2026-04-29 |
||||
*/ |
||||
@Data |
||||
public class MesRbSply { |
||||
|
||||
/** |
||||
* 供应商编码 |
||||
*/ |
||||
private String splycode; |
||||
|
||||
/** |
||||
* 供应商名称 |
||||
*/ |
||||
private String splyname; |
||||
|
||||
/** |
||||
* 省份/地区 |
||||
*/ |
||||
private String province; |
||||
|
||||
/** |
||||
* 供应商地址 |
||||
*/ |
||||
private String splyadd; |
||||
|
||||
/** |
||||
* 产品类型/资质 |
||||
*/ |
||||
private String producttype; |
||||
|
||||
/** |
||||
* 供应商状态 |
||||
*/ |
||||
private Integer splystat; |
||||
|
||||
/** |
||||
* 联系人 |
||||
*/ |
||||
private String linkman; |
||||
|
||||
/** |
||||
* 邮箱 |
||||
*/ |
||||
private String email; |
||||
|
||||
/** |
||||
* 联系电话 |
||||
*/ |
||||
private String ctactqumd; |
||||
} |
||||
@ -0,0 +1,86 @@ |
||||
package org.springblade.desk.basic.util;/** |
||||
* @date : 2026/4/28 13:27 |
||||
*/ |
||||
|
||||
import org.springblade.core.mp.support.Query; |
||||
import org.springblade.core.tool.utils.Func; |
||||
import org.springblade.desk.basic.controller.BatConfigController; |
||||
|
||||
/** |
||||
* 文件名称 |
||||
* @module 归属项目 |
||||
* @author *** |
||||
* @date 2025/11/26 10:27 |
||||
*/ |
||||
public class QueryUtils { |
||||
/** |
||||
* 转换排序字段:将前端虚拟字段名转换为数据库实际字段名 |
||||
* 例如:OP_USER_REAL_NAME -> UPDATE_TIME |
||||
*/ |
||||
public static void convertSortField(Query query) { |
||||
if (query == null) { |
||||
return; |
||||
} |
||||
|
||||
// 处理降序排序字段
|
||||
if (Func.isNotEmpty(query.getDescs())) { |
||||
String descs = query.getDescs(); |
||||
descs = convertSingleSortField(descs); |
||||
query.setDescs(descs); |
||||
} |
||||
|
||||
// 处理升序排序字段
|
||||
if (Func.isNotEmpty(query.getAscs())) { |
||||
String ascs = query.getAscs(); |
||||
ascs = convertSingleSortField(ascs); |
||||
query.setAscs(ascs); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 转换单个排序字段 |
||||
* @param sortField 排序字段字符串(可能包含多个字段,逗号分隔) |
||||
* @return 转换后的排序字段 |
||||
*/ |
||||
public static String convertSingleSortField(String sortField) { |
||||
if (Func.isEmpty(sortField)) { |
||||
return sortField; |
||||
} |
||||
|
||||
// 定义字段映射关系:前端字段名 -> 数据库字段名
|
||||
String[] fields = sortField.split(","); |
||||
StringBuilder result = new StringBuilder(); |
||||
|
||||
for (int i = 0; i < fields.length; i++) { |
||||
String field = fields[i].trim(); |
||||
String convertedField = switch (field.toUpperCase()) { |
||||
// 操作人姓名转换为更新时间排序
|
||||
case "OP_USER_REAL_NAME" -> "UPDATE_USER"; |
||||
/** |
||||
* {@link org.springblade.desk.basic.controller.OemController.list} |
||||
* */ |
||||
case "CUR_STATUS_TEXT" -> "status"; |
||||
/** |
||||
* {@link BatConfigController#page(org.springblade.desk.basic.pojo.vo.BatConfigVO, org.springblade.core.mp.support.Query)} |
||||
* */ |
||||
case "UPDATE_USER_NAME" -> "UPDATE_USER"; |
||||
/** |
||||
* {@link org.springblade.desk.basic.controller.WorkCenterController#list(java.util.Map, org.springblade.core.mp.support.Query)} |
||||
* */ |
||||
case "LEADER_USER_NAME" -> "LEADER_USER"; |
||||
/** |
||||
* {@link } |
||||
* */ |
||||
case "CREATE_USER_NAME" -> "CREATE_USER"; |
||||
default -> field; |
||||
}; |
||||
|
||||
result.append(convertedField); |
||||
if (i < fields.length - 1) { |
||||
result.append(","); |
||||
} |
||||
} |
||||
|
||||
return result.toString(); |
||||
} |
||||
} |
||||
@ -0,0 +1,146 @@ |
||||
package org.springblade.desk.oem.controller; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import io.swagger.v3.oas.annotations.Operation; |
||||
import io.swagger.v3.oas.annotations.Parameter; |
||||
import io.swagger.v3.oas.annotations.tags.Tag; |
||||
import jakarta.validation.Valid; |
||||
import lombok.AllArgsConstructor; |
||||
import org.apache.commons.lang3.StringUtils; |
||||
import org.springblade.core.excel.util.ExcelUtil; |
||||
import org.springblade.core.mp.support.Condition; |
||||
import org.springblade.core.mp.support.Query; |
||||
import org.springblade.core.tool.api.R; |
||||
import org.springblade.core.tool.utils.Func; |
||||
import org.springblade.desk.basic.util.ExcelExtUtil; |
||||
import org.springblade.desk.dashboard.pojo.entity.BsProcessSetEntity; |
||||
import org.springblade.desk.dashboard.service.IBsProcessSetService; |
||||
import org.springblade.desk.oem.pojo.entity.OemStandardProcessEntity; |
||||
import org.springblade.desk.oem.pojo.excel.OemStandardProcessExcel; |
||||
import org.springblade.desk.oem.pojo.vo.OemStandardProcessVO; |
||||
import org.springblade.desk.oem.service.IOemStandardProcessService; |
||||
import org.springframework.beans.BeanUtils; |
||||
import org.springframework.core.io.Resource; |
||||
import org.springframework.http.ResponseEntity; |
||||
import org.springframework.util.CollectionUtils; |
||||
import org.springframework.web.bind.annotation.*; |
||||
import org.springframework.web.multipart.MultipartFile; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.HashSet; |
||||
import java.util.List; |
||||
import java.util.Set; |
||||
|
||||
/** |
||||
* 外协标准工序代码 控制器 |
||||
* |
||||
* @author maxg |
||||
* @since 2026-04-29 |
||||
*/ |
||||
@RestController |
||||
@AllArgsConstructor |
||||
@RequestMapping("/mesOemStandardProcess") |
||||
@Tag(name = "外协标准工序代码", description = "外协标准工序代码接口") |
||||
public class OemStandardProcessController { |
||||
|
||||
private final IOemStandardProcessService oemStandardProcessService; |
||||
|
||||
private final IBsProcessSetService bsProcessSetService; |
||||
|
||||
/** |
||||
* 外协标准工序代码 自定义分页 |
||||
*/ |
||||
@GetMapping("/page") |
||||
@Operation(summary = "分页", description = "传入oemStandardProcess") |
||||
public R<IPage<OemStandardProcessVO>> page(OemStandardProcessVO oemStandardProcess, Query query) { |
||||
IPage<OemStandardProcessVO> pages = oemStandardProcessService.selectOemStandardProcessPage(Condition.getPage(query), oemStandardProcess); |
||||
return R.data(pages); |
||||
} |
||||
|
||||
/** |
||||
* 外协标准工序代码 新增或修改 |
||||
* |
||||
* @param oemStandardProcessList |
||||
* @return |
||||
*/ |
||||
@PostMapping("/submit") |
||||
@Operation(summary = "新增或修改", description = "传入bsEfficiencyTempList") |
||||
public R submit(@Valid @RequestBody List<OemStandardProcessEntity> oemStandardProcessList) { |
||||
for (OemStandardProcessEntity oemStandardProcessEntity : oemStandardProcessList) { |
||||
LambdaQueryWrapper<OemStandardProcessEntity> wrapper = new LambdaQueryWrapper<OemStandardProcessEntity>().eq(OemStandardProcessEntity::getProcessId, oemStandardProcessEntity.getProcessId()).eq(OemStandardProcessEntity::getPlate, oemStandardProcessEntity.getPlate()).eq(OemStandardProcessEntity::getPlateThickness, oemStandardProcessEntity.getPlateThickness()).eq(OemStandardProcessEntity::getPartName, oemStandardProcessEntity.getPartName()); |
||||
if (oemStandardProcessEntity.getId() != null) { |
||||
wrapper.ne(OemStandardProcessEntity::getId, oemStandardProcessEntity.getId()); |
||||
} |
||||
List<OemStandardProcessEntity> list = oemStandardProcessService.list(wrapper); |
||||
if (!CollectionUtils.isEmpty(list)) { |
||||
return R.fail("数据已存在"); |
||||
} |
||||
} |
||||
return R.status(oemStandardProcessService.saveOrUpdateBatch(oemStandardProcessList)); |
||||
} |
||||
|
||||
/** |
||||
* 外协标准工序代码 删除 |
||||
*/ |
||||
@PostMapping("/remove") |
||||
@Operation(summary = "逻辑删除", description = "传入ids") |
||||
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) { |
||||
return R.status(oemStandardProcessService.deleteLogic(Func.toLongList(ids))); |
||||
} |
||||
|
||||
/** |
||||
* 外协标准工序代码 下载模板 |
||||
* @return |
||||
*/ |
||||
@GetMapping("/download-excel-template") |
||||
@Operation(summary = "下载Excel模板", description = "") |
||||
public ResponseEntity<Resource> downloadExcelTemplate() { |
||||
return ExcelExtUtil.downloadXlsTemplate("Excel/oem/标准工序代码.xls", "导入模版-标准工序代码.xls"); |
||||
} |
||||
|
||||
/** |
||||
* 外协标准工序代码 导入Excel |
||||
* @param file |
||||
* @return |
||||
*/ |
||||
@PostMapping("/import-excel") |
||||
@Operation(summary = "导入Excel", description = "MultipartFile") |
||||
public R importExcel(@RequestParam("file") MultipartFile file) { |
||||
R checkR = ExcelExtUtil.importExcelCheck(file); |
||||
if (checkR != null) { |
||||
return checkR; |
||||
} |
||||
List<OemStandardProcessExcel> importList = ExcelUtil.read(file, 0, 1, OemStandardProcessExcel.class); |
||||
Set<String> uniqueSet = new HashSet<>(); |
||||
List<OemStandardProcessEntity> entityList = new ArrayList<>(); |
||||
for (int i = 0; i < importList.size(); i++) { |
||||
int rowNum = i + 2; |
||||
OemStandardProcessExcel row = importList.get(i); |
||||
if (StringUtils.isEmpty(row.getProcessName())) { |
||||
return R.fail(rowNum + "行工序未填写"); |
||||
} |
||||
if(StringUtils.isEmpty(row.getStandardProcessCode())){ |
||||
return R.fail(rowNum + "行标准工序代码未填写"); |
||||
} |
||||
String uniqueStr = StringUtils.joinWith("|", row.getProcessName(), row.getPlate(), row.getPlateThickness(), row.getPartName()); |
||||
if (!uniqueSet.add(uniqueStr)) { |
||||
return R.fail(rowNum + "行在Excel中重复"); |
||||
} |
||||
BsProcessSetEntity processSet = bsProcessSetService.getOne(new LambdaQueryWrapper<BsProcessSetEntity>().eq(BsProcessSetEntity::getName, row.getProcessName())); |
||||
if (processSet == null) { |
||||
return R.fail(rowNum + "行错误,系统无此工序"); |
||||
} |
||||
OemStandardProcessEntity exist = oemStandardProcessService.getOne(new LambdaQueryWrapper<OemStandardProcessEntity>().eq(OemStandardProcessEntity::getProcessId, processSet.getId()).eq(OemStandardProcessEntity::getPlate, row.getPlate()).eq(OemStandardProcessEntity::getPlateThickness, row.getPlateThickness()).eq(OemStandardProcessEntity::getPartName, row.getPartName())); |
||||
if (exist != null) { |
||||
return R.fail(rowNum + "行错误,数据已存在"); |
||||
} |
||||
OemStandardProcessEntity entity = new OemStandardProcessEntity(); |
||||
BeanUtils.copyProperties(row, entity); |
||||
entity.setProcessId(processSet.getId()); |
||||
entityList.add(entity); |
||||
} |
||||
return R.status(oemStandardProcessService.saveBatch(entityList)); |
||||
} |
||||
|
||||
} |
||||
@ -0,0 +1,27 @@ |
||||
package org.springblade.desk.oem.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import org.springblade.desk.efficiency.pojo.vo.BsEfficiencyTaskVO; |
||||
import org.springblade.desk.oem.pojo.entity.OemStandardProcessEntity; |
||||
import org.springblade.desk.oem.pojo.vo.OemStandardProcessVO; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 外协标准工序代码 Mapper接口 |
||||
* |
||||
* @author maxg |
||||
* @since 2026-04-29 |
||||
*/ |
||||
public interface OemStandardProcessMapper extends BaseMapper<OemStandardProcessEntity> { |
||||
|
||||
/** |
||||
* 自定义分页 |
||||
* |
||||
* @param page 分页参数 |
||||
* @param oemStandardProcess 查询参数 |
||||
* @return List<BsEfficiencyTaskVO> |
||||
*/ |
||||
List<OemStandardProcessVO> selectOemStandardProcessPage(IPage page, OemStandardProcessVO oemStandardProcess); |
||||
} |
||||
@ -0,0 +1,63 @@ |
||||
<?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="org.springblade.desk.oem.mapper.OemStandardProcessMapper"> |
||||
|
||||
<!-- 通用查询映射结果 --> |
||||
<resultMap id="mesOemStandardProcessVOResultMap" type="org.springblade.desk.oem.pojo.vo.OemStandardProcessVO"> |
||||
<result column="ID" property="id"/> |
||||
<result column="PROCESS_ID" property="processId"/> |
||||
<result column="PLATE" property="plate"/> |
||||
<result column="PLATE_THICKNESS" property="plateThickness"/> |
||||
<result column="PART_NAME" property="partName"/> |
||||
<result column="STANDARD_PROCESS_CODE" property="standardProcessCode"/> |
||||
<result column="CREATE_USER" property="createUser"/> |
||||
<result column="CREATE_TIME" property="createTime"/> |
||||
<result column="CREATE_DEPT" property="createDept"/> |
||||
<result column="UPDATE_USER" property="updateUser"/> |
||||
<result column="UPDATE_TIME" property="updateTime"/> |
||||
<result column="STATUS" property="status"/> |
||||
<result column="IS_DELETED" property="isDeleted"/> |
||||
<result column="PROCESS_NAME" property="processName"/> |
||||
<result column="UPDATE_USER_NAME" property="updateUserName"/> |
||||
</resultMap> |
||||
|
||||
<select id="selectOemStandardProcessPage" resultMap="mesOemStandardProcessVOResultMap"> |
||||
SELECT * FROM ( |
||||
SELECT t.*, |
||||
p.NAME as PROCESS_NAME, |
||||
bu.REAL_NAME as UPDATE_USER_NAME |
||||
FROM MES_OEM_STANDARD_PROCESS t |
||||
INNER JOIN BS_PROCESS_SET p ON t.PROCESS_ID = p.ID AND p.IS_DELETED = 0 |
||||
LEFT JOIN BLADE_USER bu ON t.update_user = bu.id |
||||
<where> |
||||
t.IS_DELETED = 0 |
||||
<if test="oemStandardProcess.processName != null"> |
||||
AND p.NAME like concat(concat('%', #{oemStandardProcess.processName}),'%') |
||||
</if> |
||||
<if test="oemStandardProcess.plate != null"> |
||||
AND t.PLATE like concat(concat('%', #{oemStandardProcess.plate}),'%') |
||||
</if> |
||||
<if test="oemStandardProcess.plateThickness != null"> |
||||
AND t.PLATE_THICKNESS like concat(concat('%', #{oemStandardProcess.plateThickness}),'%') |
||||
</if> |
||||
<if test="oemStandardProcess.partName != null"> |
||||
AND t.PART_NAME like concat(concat('%', #{oemStandardProcess.partName}),'%') |
||||
</if> |
||||
<if test="oemStandardProcess.standardProcessCode != null"> |
||||
AND t.STANDARD_PROCESS_CODE like concat(concat('%', #{oemStandardProcess.standardProcessCode}),'%') |
||||
</if> |
||||
</where> |
||||
) |
||||
<choose> |
||||
<when test="oemStandardProcess.orderByField != null and oemStandardProcess.orderByField != ''"> |
||||
ORDER BY ${oemStandardProcess.orderByField} |
||||
<if test="oemStandardProcess.isAsc">ASC</if> |
||||
<if test="!oemStandardProcess.isAsc">DESC</if> |
||||
</when> |
||||
<otherwise> |
||||
ORDER BY CREATE_TIME DESC |
||||
</otherwise> |
||||
</choose> |
||||
</select> |
||||
|
||||
</mapper> |
||||
@ -0,0 +1,25 @@ |
||||
package org.springblade.desk.oem.service; |
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import org.springblade.core.mp.base.BaseService; |
||||
import org.springblade.desk.efficiency.pojo.vo.BsEfficiencyTaskParamVO; |
||||
import org.springblade.desk.oem.pojo.entity.OemStandardProcessEntity; |
||||
import org.springblade.desk.oem.pojo.vo.OemStandardProcessVO; |
||||
|
||||
/** |
||||
* 外协标准工序代码 服务类 |
||||
* |
||||
* @author maxg |
||||
* @since 2026-04-29 |
||||
*/ |
||||
public interface IOemStandardProcessService extends BaseService<OemStandardProcessEntity> { |
||||
|
||||
/** |
||||
* 自定义分页 |
||||
* |
||||
* @param page 分页参数 |
||||
* @param oemStandardProcess 查询参数 |
||||
* @return IPage<OemStandardProcessVO> |
||||
*/ |
||||
IPage<OemStandardProcessVO> selectOemStandardProcessPage(IPage<OemStandardProcessVO> page, OemStandardProcessVO oemStandardProcess); |
||||
} |
||||
@ -0,0 +1,25 @@ |
||||
package org.springblade.desk.oem.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import org.springblade.core.mp.base.BaseServiceImpl; |
||||
import org.springblade.desk.oem.mapper.OemStandardProcessMapper; |
||||
import org.springblade.desk.oem.pojo.entity.OemStandardProcessEntity; |
||||
import org.springblade.desk.oem.pojo.vo.OemStandardProcessVO; |
||||
import org.springblade.desk.oem.service.IOemStandardProcessService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
/** |
||||
* 外协标准工序代码 服务实现类 |
||||
* |
||||
* @author maxg |
||||
* @since 2026-04-29 |
||||
*/ |
||||
@Service |
||||
public class OemStandardProcessServiceImpl extends BaseServiceImpl<OemStandardProcessMapper, OemStandardProcessEntity> implements IOemStandardProcessService { |
||||
|
||||
@Override |
||||
public IPage<OemStandardProcessVO> selectOemStandardProcessPage(IPage<OemStandardProcessVO> page, OemStandardProcessVO oemStandardProcess) { |
||||
return page.setRecords(baseMapper.selectOemStandardProcessPage(page, oemStandardProcess)); |
||||
} |
||||
|
||||
} |
||||
@ -0,0 +1,32 @@ |
||||
package org.springblade.erpdata.feign; |
||||
|
||||
import io.swagger.v3.oas.annotations.Hidden; |
||||
import lombok.AllArgsConstructor; |
||||
import org.springblade.core.tenant.annotation.NonDS; |
||||
import org.springblade.erpdata.pojo.dto.view.MesRbSply; |
||||
import org.springblade.erpdata.service.IErpMesRbSplyService; |
||||
import org.springframework.web.bind.annotation.GetMapping; |
||||
import org.springframework.web.bind.annotation.RestController; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* |
||||
* |
||||
* @author BladeX |
||||
* @since 2026-04-29 |
||||
*/ |
||||
@NonDS |
||||
@Hidden |
||||
@RestController |
||||
@AllArgsConstructor |
||||
public class ErpMesRbSplyClientImpl implements IErpMesRbSplyClient { |
||||
|
||||
private final IErpMesRbSplyService erpMesRbSplyService; |
||||
|
||||
@Override |
||||
@GetMapping(GET_SPLY_LIST) |
||||
public List<MesRbSply> getSplyList() { |
||||
return erpMesRbSplyService.getSplyListFromErp(); |
||||
} |
||||
} |
||||
@ -0,0 +1,23 @@ |
||||
package org.springblade.erpdata.mapper; |
||||
|
||||
import org.apache.ibatis.annotations.Mapper; |
||||
import org.springblade.erpdata.pojo.dto.view.MesRbSply; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* ERP供应商数据Mapper接口 |
||||
* |
||||
* @author BladeX |
||||
* @since 2026-04-29 |
||||
*/ |
||||
@Mapper |
||||
public interface ErpMesRbSplyMapper { |
||||
|
||||
/** |
||||
* 从ERP视图 V_MES_RB_SPLY 获取所有供应商数据 |
||||
* |
||||
* @return 供应商列表 |
||||
*/ |
||||
List<MesRbSply> getSplyListFromErp(); |
||||
} |
||||
@ -0,0 +1,20 @@ |
||||
<?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="org.springblade.erpdata.mapper.ErpMesRbSplyMapper"> |
||||
|
||||
<!-- 从ERP视图获取供应商数据 --> |
||||
<select id="getSplyListFromErp" resultType="org.springblade.erpdata.pojo.dto.view.MesRbSply"> |
||||
SELECT |
||||
splycode, |
||||
splyname, |
||||
province, |
||||
splyadd, |
||||
producttype, |
||||
splystat, |
||||
linkman, |
||||
email, |
||||
ctactqumd |
||||
FROM dba_mgr.V_MES_RB_SPLY@erp_mes_link |
||||
</select> |
||||
|
||||
</mapper> |
||||
@ -0,0 +1,21 @@ |
||||
package org.springblade.erpdata.service; |
||||
|
||||
import org.springblade.erpdata.pojo.dto.view.MesRbSply; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* ERP供应商数据服务接口 |
||||
* |
||||
* @author BladeX |
||||
* @since 2026-04-29 |
||||
*/ |
||||
public interface IErpMesRbSplyService { |
||||
|
||||
/** |
||||
* 从ERP视图获取所有供应商数据 |
||||
* |
||||
* @return 供应商列表 |
||||
*/ |
||||
List<MesRbSply> getSplyListFromErp(); |
||||
} |
||||
@ -0,0 +1,34 @@ |
||||
package org.springblade.erpdata.service.impl; |
||||
|
||||
import lombok.AllArgsConstructor; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springblade.core.tenant.annotation.NonDS; |
||||
import org.springblade.erpdata.mapper.ErpMesRbSplyMapper; |
||||
import org.springblade.erpdata.pojo.dto.view.MesRbSply; |
||||
import org.springblade.erpdata.service.IErpMesRbSplyService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* ERP供应商数据服务实现类 |
||||
* |
||||
* @author BladeX |
||||
* @since 2026-04-29 |
||||
*/ |
||||
@NonDS |
||||
@Slf4j |
||||
@Service |
||||
@AllArgsConstructor |
||||
public class ErpMesRbSplyServiceImpl implements IErpMesRbSplyService { |
||||
|
||||
private final ErpMesRbSplyMapper erpMesRbSplyMapper; |
||||
|
||||
@Override |
||||
public List<MesRbSply> getSplyListFromErp() { |
||||
log.info("开始从ERP视图 V_MES_RB_SPLY 获取供应商数据"); |
||||
List<MesRbSply> splyList = erpMesRbSplyMapper.getSplyListFromErp(); |
||||
log.info("从ERP获取到 {} 条供应商数据", splyList != null ? splyList.size() : 0); |
||||
return splyList; |
||||
} |
||||
} |
||||
Loading…
Reference in new issue