highway
zhaoxiaolin 1 year ago
parent 309f2c2999
commit 2dbf3601f6

@ -12,6 +12,7 @@ import com.op.system.api.domain.SysFile;
import com.op.system.api.factory.RemoteFileFallbackFactory;
import java.io.InputStream;
import java.util.List;
/**
*
@ -31,4 +32,5 @@ public interface RemoteFileService {
@PostMapping(value = "/getFile/{id}")
public InputStream getFile(@PathVariable("id") String id);
}

@ -0,0 +1,22 @@
package com.op.system.api;
import com.op.common.core.constant.ServiceNameConstants;
import com.op.common.core.domain.BaseFileData;
import com.op.common.core.domain.R;
import com.op.system.api.factory.RemoteMesFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
*
*
* @author OP
*/
@FeignClient(contextId = "remoteMesService", value = ServiceNameConstants.MES_SERVICE, fallbackFactory = RemoteMesFallbackFactory.class)
public interface RemoteMesService {
@PostMapping("/file/upLoadFile")
public R<Boolean> upLoadFile(@RequestBody List<BaseFileData> files);
}

@ -1,5 +1,7 @@
package com.op.system.api;
import com.op.common.core.domain.BaseFileData;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
@ -13,9 +15,11 @@ import com.op.system.api.domain.SysUser;
import com.op.system.api.factory.RemoteUserFallbackFactory;
import com.op.system.api.model.LoginUser;
import java.util.List;
/**
*
*
*
* @author OP
*/
@FeignClient(contextId = "remoteUserService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteUserFallbackFactory.class)
@ -41,4 +45,7 @@ public interface RemoteUserService {
@PostMapping("/user/register")
public R<Boolean> registerUserInfo(@RequestBody SysUser sysUser,
@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
@PostMapping("/file/upLoadFile")
public R<Boolean> upLoadFile(@RequestBody List<BaseFileData> files);
}

@ -0,0 +1,35 @@
package com.op.system.api.factory;
import com.op.common.core.domain.BaseFileData;
import com.op.common.core.domain.R;
import com.op.system.api.RemoteMesService;
import com.op.system.api.RemoteUserService;
import com.op.system.api.domain.SysUser;
import com.op.system.api.model.LoginUser;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
import java.util.List;
/**
*
*
* @author OP
*/
@Component
public class RemoteMesFallbackFactory implements FallbackFactory<RemoteMesService> {
private static final Logger log = LoggerFactory.getLogger(RemoteMesFallbackFactory.class);
@Override
public RemoteMesService create(Throwable throwable) {
log.error("Mes服务调用失败:{}", throwable.getMessage());
return new RemoteMesService() {
@Override
public R<Boolean> upLoadFile(List<BaseFileData> files) {
return R.fail("上传失败:" + throwable.getMessage());
}
};
}
}

@ -1,5 +1,6 @@
package com.op.system.api.factory;
import com.op.common.core.domain.BaseFileData;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
@ -9,9 +10,11 @@ import com.op.system.api.RemoteUserService;
import com.op.system.api.domain.SysUser;
import com.op.system.api.model.LoginUser;
import java.util.List;
/**
*
*
*
* @author OP
*/
@Component
@ -31,6 +34,11 @@ public class RemoteUserFallbackFactory implements FallbackFactory<RemoteUserServ
public R<Boolean> registerUserInfo(SysUser sysUser, String source) {
return R.fail("注册用户失败:" + throwable.getMessage());
}
@Override
public R<Boolean> upLoadFile(List<BaseFileData> files) {
return R.fail("上传失败:" + throwable.getMessage());
}
};
}
}

@ -2,7 +2,7 @@ package com.op.common.core.constant;
/**
*
*
*
* @author OP
*/
public class ServiceNameConstants {
@ -20,4 +20,14 @@ public class ServiceNameConstants {
* serviceid
*/
public static final String FILE_SERVICE = "op-file";
/**
* serviceid
*/
public static final String MES_SERVICE = "op-mes";
/**
* serviceid
*/
public static final String WMS_SERVICE = "op-wms";
}

@ -0,0 +1,123 @@
package com.op.common.core.domain;
import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* base_file
*
* @author Open Platform
* @date 2023-07-10
*/
public class BaseFileData extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 附件ID */
private String fileId;
/** 附件名称 */
@Excel(name = "附件名称")
private String fileName;
/** 附件地址 */
@Excel(name = "附件地址")
private String fileAddress;
/** 数据来源 */
@Excel(name = "数据来源")
private String sourceId;
/** 预留字段1 */
@Excel(name = "预留字段1")
private String attr1;
/** 预留字段2 */
@Excel(name = "预留字段2")
private String attr2;
/** 预留字段3 */
@Excel(name = "预留字段3")
private Long attr3;
/** 预留字段4 */
@Excel(name = "预留字段4")
private Long attr4;
public void setFileId(String fileId) {
this.fileId = fileId;
}
public String getFileId() {
return fileId;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
public String getFileName() {
return fileName;
}
public void setFileAddress(String fileAddress) {
this.fileAddress = fileAddress;
}
public String getFileAddress() {
return fileAddress;
}
public void setSourceId(String sourceId) {
this.sourceId = sourceId;
}
public String getSourceId() {
return sourceId;
}
public void setAttr1(String attr1) {
this.attr1 = attr1;
}
public String getAttr1() {
return attr1;
}
public void setAttr2(String attr2) {
this.attr2 = attr2;
}
public String getAttr2() {
return attr2;
}
public void setAttr3(Long attr3) {
this.attr3 = attr3;
}
public Long getAttr3() {
return attr3;
}
public void setAttr4(Long attr4) {
this.attr4 = attr4;
}
public Long getAttr4() {
return attr4;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("fileId", getFileId())
.append("fileName", getFileName())
.append("fileAddress", getFileAddress())
.append("sourceId", getSourceId())
.append("remark", getRemark())
.append("attr1", getAttr1())
.append("attr2", getAttr2())
.append("attr3", getAttr3())
.append("attr4", getAttr4())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

@ -34,7 +34,7 @@ public class SysFileController {
private ISysFileService sysFileService;
/**
*
*
*/
@PostMapping("upload")
public R<SysFile> upload(MultipartFile file) {
@ -42,7 +42,7 @@ public class SysFileController {
// 上传并返回访问地址
String url = sysFileService.uploadFile(file);
SysFile sysFile = new SysFile();
sysFile.setName(FileUtils.getName(url));
sysFile.setName(file.getOriginalFilename());//sysFile.setName(FileUtils.getName(url));
sysFile.setUrl(url);
return R.ok(sysFile);
} catch (Exception e) {
@ -57,7 +57,7 @@ public class SysFileController {
// 上传并返回访问地址
String url = sysFileService.uploadFile(file);
SysFile sysFile = new SysFile();
sysFile.setName(FileUtils.getName(url));
sysFile.setName(file.getOriginalFilename());//sysFile.setName(FileUtils.getName(url));
sysFile.setUrl(url);
return R.ok(sysFile);
} catch (Exception e) {

@ -82,8 +82,7 @@ public class MongoFileImpl implements ISysFileService {
*
*
* @param file
* @param userId
* @param fsgisOneMapMacroAnalysis
* @param
* @return
* @throws Exception
*/

@ -0,0 +1,101 @@
package com.op.mes.controller;
import com.op.common.core.domain.BaseFileData;
import com.op.common.core.utils.poi.ExcelUtil;
import com.op.common.core.web.controller.BaseController;
import com.op.common.core.web.domain.AjaxResult;
import com.op.common.core.web.page.TableDataInfo;
import com.op.common.log.annotation.Log;
import com.op.common.log.enums.BusinessType;
import com.op.common.security.annotation.RequiresPermissions;
import com.op.mes.domain.BaseFile;
import com.op.mes.service.IBaseFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* Controller
*
* @author Open Platform
* @date 2023-07-10
*/
@RestController
@RequestMapping("/file")
public class BaseFileController extends BaseController {
@Autowired
private IBaseFileService baseFileService;
/**
*
*/
@RequiresPermissions("system:file:list")
@GetMapping("/list")
public TableDataInfo list(BaseFile baseFile) {
startPage();
List<BaseFile> list = baseFileService.selectBaseFileList(baseFile);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("system:file:export")
@Log(title = "附件", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, BaseFile baseFile) {
List<BaseFile> list = baseFileService.selectBaseFileList(baseFile);
ExcelUtil<BaseFile> util = new ExcelUtil<BaseFile>(BaseFile.class);
util.exportExcel(response, list, "附件数据");
}
/**
*
*/
@RequiresPermissions("system:file:query")
@GetMapping(value = "/{fileId}")
public AjaxResult getInfo(@PathVariable("fileId") String fileId) {
return success(baseFileService.selectBaseFileByFileId(fileId));
}
/**
*
*/
@RequiresPermissions("system:file:add")
@Log(title = "附件", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody BaseFile baseFile) {
return toAjax(baseFileService.insertBaseFile(baseFile));
}
/**
*
*/
@RequiresPermissions("system:file:edit")
@Log(title = "附件", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody BaseFile baseFile) {
return toAjax(baseFileService.updateBaseFile(baseFile));
}
/**
*
*/
@RequiresPermissions("system:file:remove")
@Log(title = "附件", businessType = BusinessType.DELETE)
@DeleteMapping("/{fileIds}")
public AjaxResult remove(@PathVariable String[] fileIds) {
return toAjax(baseFileService.deleteBaseFileByFileIds(fileIds));
}
@Log(title = "批量上传附件", businessType = BusinessType.INSERT)
@PostMapping("/upLoadFile")
public Boolean add(@RequestBody List<BaseFileData> baseFiles) {
return baseFileService.insertBaseFileBatch(baseFiles);
}
}

@ -1,16 +1,22 @@
package com.op.mes.controller;
import java.security.Security;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.alibaba.nacos.client.constant.Constants;
import com.op.common.core.constant.UserConstants;
import com.op.common.core.utils.StringUtils;
import com.op.common.core.utils.poi.ExcelUtil;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.core.web.controller.BaseController;
import com.op.common.core.web.domain.AjaxResult;
import com.op.common.core.web.page.TableDataInfo;
import com.op.common.log.annotation.Log;
import com.op.common.log.enums.BusinessType;
import com.op.common.security.annotation.RequiresPermissions;
import com.op.common.security.utils.SecurityUtils;
import com.op.mes.domain.ProProcess;
import com.op.mes.service.IProProcessService;
import org.springframework.beans.factory.annotation.Autowired;

@ -0,0 +1,123 @@
package com.op.mes.domain;
import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* base_file
*
* @author Open Platform
* @date 2023-07-10
*/
public class BaseFile extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 附件ID */
private String fileId;
/** 附件名称 */
@Excel(name = "附件名称")
private String fileName;
/** 附件地址 */
@Excel(name = "附件地址")
private String fileAddress;
/** 数据来源 */
@Excel(name = "数据来源")
private String sourceId;
/** 预留字段1 */
@Excel(name = "预留字段1")
private String attr1;
/** 预留字段2 */
@Excel(name = "预留字段2")
private String attr2;
/** 预留字段3 */
@Excel(name = "预留字段3")
private Long attr3;
/** 预留字段4 */
@Excel(name = "预留字段4")
private Long attr4;
public void setFileId(String fileId) {
this.fileId = fileId;
}
public String getFileId() {
return fileId;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
public String getFileName() {
return fileName;
}
public void setFileAddress(String fileAddress) {
this.fileAddress = fileAddress;
}
public String getFileAddress() {
return fileAddress;
}
public void setSourceId(String sourceId) {
this.sourceId = sourceId;
}
public String getSourceId() {
return sourceId;
}
public void setAttr1(String attr1) {
this.attr1 = attr1;
}
public String getAttr1() {
return attr1;
}
public void setAttr2(String attr2) {
this.attr2 = attr2;
}
public String getAttr2() {
return attr2;
}
public void setAttr3(Long attr3) {
this.attr3 = attr3;
}
public Long getAttr3() {
return attr3;
}
public void setAttr4(Long attr4) {
this.attr4 = attr4;
}
public Long getAttr4() {
return attr4;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("fileId", getFileId())
.append("fileName", getFileName())
.append("fileAddress", getFileAddress())
.append("sourceId", getSourceId())
.append("remark", getRemark())
.append("attr1", getAttr1())
.append("attr2", getAttr2())
.append("attr3", getAttr3())
.append("attr4", getAttr4())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

@ -47,6 +47,66 @@ public class ProProcess extends BaseEntity
/** 预留字段4 */
private Long attr4;
private String fileList;
//s:拆分 m合并
private String splitMerge;
//拆分合并数量
private int splitMergNum;
//1允许多单并行
private String sync;
//工作中心
private String workCenter;
//工作时长
private Double workTime;
public String getWorkCenter() {
return workCenter;
}
public void setWorkCenter(String workCenter) {
this.workCenter = workCenter;
}
public Double getWorkTime() {
return workTime;
}
public void setWorkTime(Double workTime) {
this.workTime = workTime;
}
public String getSplitMerge() {
return splitMerge;
}
public void setSplitMerge(String splitMerge) {
this.splitMerge = splitMerge;
}
public int getSplitMergNum() {
return splitMergNum;
}
public void setSplitMergNum(int splitMergNum) {
this.splitMergNum = splitMergNum;
}
public String getSync() {
return sync;
}
public void setSync(String sync) {
this.sync = sync;
}
public String getFileList() {
return fileList;
}
public void setFileList(String fileList) {
this.fileList = fileList;
}
public void setProcessId(String processId)
{
this.processId = processId;

@ -0,0 +1,67 @@
package com.op.mes.mapper;
import com.op.common.core.domain.BaseFileData;
import com.op.mes.domain.BaseFile;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Mapper
*
* @author Open Platform
* @date 2023-07-10
*/
@Mapper
public interface BaseFileMapper {
/**
*
*
* @param fileId
* @return
*/
public BaseFile selectBaseFileByFileId(String fileId);
/**
*
*
* @param baseFile
* @return
*/
public List<BaseFile> selectBaseFileList(BaseFile baseFile);
/**
*
*
* @param baseFile
* @return
*/
public int insertBaseFile(BaseFile baseFile);
/**
*
*
* @param baseFile
* @return
*/
public int updateBaseFile(BaseFile baseFile);
/**
*
*
* @param fileId
* @return
*/
public int deleteBaseFileByFileId(String fileId);
/**
*
*
* @param fileIds
* @return
*/
public int deleteBaseFileByFileIds(String[] fileIds);
Boolean insertBaseFileBatch(@Param("baseFiles") List<BaseFileData> baseFiles);
}

@ -0,0 +1,64 @@
package com.op.mes.service;
import com.op.common.core.domain.BaseFileData;
import com.op.mes.domain.BaseFile;
import java.util.List;
/**
* Service
*
* @author Open Platform
* @date 2023-07-10
*/
public interface IBaseFileService {
/**
*
*
* @param fileId
* @return
*/
public BaseFile selectBaseFileByFileId(String fileId);
/**
*
*
* @param baseFile
* @return
*/
public List<BaseFile> selectBaseFileList(BaseFile baseFile);
/**
*
*
* @param baseFile
* @return
*/
public int insertBaseFile(BaseFile baseFile);
/**
*
*
* @param baseFile
* @return
*/
public int updateBaseFile(BaseFile baseFile);
/**
*
*
* @param fileIds
* @return
*/
public int deleteBaseFileByFileIds(String[] fileIds);
/**
*
*
* @param fileId
* @return
*/
public int deleteBaseFileByFileId(String fileId);
public Boolean insertBaseFileBatch(List<BaseFileData> baseFiles);
}

@ -0,0 +1,102 @@
package com.op.mes.service.impl;
import com.op.common.core.domain.BaseFileData;
import com.op.common.core.utils.DateUtils;
import com.op.mes.domain.BaseFile;
import com.op.mes.mapper.BaseFileMapper;
import com.op.mes.service.IBaseFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Service
*
* @author Open Platform
* @date 2023-07-10
*/
@Service
public class BaseFileServiceImpl implements IBaseFileService {
@Autowired
private BaseFileMapper baseFileMapper;
/**
*
*
* @param fileId
* @return
*/
@Override
public BaseFile selectBaseFileByFileId(String fileId) {
return baseFileMapper.selectBaseFileByFileId(fileId);
}
/**
*
*
* @param baseFile
* @return
*/
@Override
public List<BaseFile> selectBaseFileList(BaseFile baseFile) {
return baseFileMapper.selectBaseFileList(baseFile);
}
/**
*
*
* @param baseFile
* @return
*/
@Override
public int insertBaseFile(BaseFile baseFile) {
baseFile.setCreateTime(DateUtils.getNowDate());
return baseFileMapper.insertBaseFile(baseFile);
}
/**
*
*
* @param baseFile
* @return
*/
@Override
public int updateBaseFile(BaseFile baseFile) {
baseFile.setUpdateTime(DateUtils.getNowDate());
return baseFileMapper.updateBaseFile(baseFile);
}
/**
*
*
* @param fileIds
* @return
*/
@Override
public int deleteBaseFileByFileIds(String[] fileIds) {
return baseFileMapper.deleteBaseFileByFileIds(fileIds);
}
/**
*
*
* @param fileId
* @return
*/
@Override
public int deleteBaseFileByFileId(String fileId) {
return baseFileMapper.deleteBaseFileByFileId(fileId);
}
/**
*
*
* @param baseFiles
* @return
*/
@Override
public Boolean insertBaseFileBatch(List<BaseFileData> baseFiles) {
return baseFileMapper.insertBaseFileBatch(baseFiles);
}
}

@ -1,15 +1,22 @@
package com.op.mes.service.impl;
import com.op.common.core.constant.UserConstants;
import com.op.common.core.domain.BaseFileData;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.StringUtils;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.security.utils.SecurityUtils;
import com.op.mes.domain.ProProcess;
import com.op.mes.mapper.BaseFileMapper;
import com.op.mes.mapper.ProProcessMapper;
import com.op.mes.service.IProProcessService;
import com.op.system.api.RemoteUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
@ -24,6 +31,9 @@ public class ProProcessServiceImpl implements IProProcessService
@Autowired
private ProProcessMapper proProcessMapper;
@Autowired
private BaseFileMapper baseFileMapper;
/**
*
*
@ -89,6 +99,24 @@ public class ProProcessServiceImpl implements IProProcessService
{
proProcess.setProcessId(IdUtils.fastSimpleUUID());
proProcess.setCreateTime(DateUtils.getNowDate());
//上传附件
if(StringUtils.isNotEmpty(proProcess.getFileList())){
String[] ids = proProcess.getFileList().split(",");
List<BaseFileData> files = new ArrayList<>();
BaseFileData file = null;
for(String id:ids){
file = new BaseFileData();
file.setFileId(IdUtils.fastSimpleUUID());
file.setFileAddress(id);
file.setSourceId(proProcess.getProcessId());
file.setCreateBy(SecurityUtils.getUsername());
file.setCreateTime(new Date());
files.add(file);
}
baseFileMapper.insertBaseFileBatch(files);
}
return proProcessMapper.insertProProcess(proProcess);
}

@ -0,0 +1,123 @@
<?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.op.mes.mapper.BaseFileMapper">
<resultMap type="BaseFile" id="BaseFileResult">
<result property="fileId" column="file_id" />
<result property="fileName" column="file_name" />
<result property="fileAddress" column="file_address" />
<result property="sourceId" column="source_id" />
<result property="remark" column="remark" />
<result property="attr1" column="attr1" />
<result property="attr2" column="attr2" />
<result property="attr3" column="attr3" />
<result property="attr4" column="attr4" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectBaseFileVo">
select file_id, file_name, file_address, source_id, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from base_file
</sql>
<select id="selectBaseFileList" parameterType="BaseFile" resultMap="BaseFileResult">
<include refid="selectBaseFileVo"/>
<where>
<if test="fileName != null and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if>
<if test="fileAddress != null and fileAddress != ''"> and file_address = #{fileAddress}</if>
<if test="sourceId != null and sourceId != ''"> and source_id = #{sourceId}</if>
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
<if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if>
<if test="attr3 != null "> and attr3 = #{attr3}</if>
<if test="attr4 != null "> and attr4 = #{attr4}</if>
</where>
</select>
<select id="selectBaseFileByFileId" parameterType="String" resultMap="BaseFileResult">
<include refid="selectBaseFileVo"/>
where file_id = #{fileId}
</select>
<insert id="insertBaseFile" parameterType="BaseFile">
insert into base_file
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="fileId != null">file_id,</if>
<if test="fileName != null">file_name,</if>
<if test="fileAddress != null">file_address,</if>
<if test="sourceId != null">source_id,</if>
<if test="remark != null">remark,</if>
<if test="attr1 != null">attr1,</if>
<if test="attr2 != null">attr2,</if>
<if test="attr3 != null">attr3,</if>
<if test="attr4 != null">attr4,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="fileId != null">#{fileId},</if>
<if test="fileName != null">#{fileName},</if>
<if test="fileAddress != null">#{fileAddress},</if>
<if test="sourceId != null">#{sourceId},</if>
<if test="remark != null">#{remark},</if>
<if test="attr1 != null">#{attr1},</if>
<if test="attr2 != null">#{attr2},</if>
<if test="attr3 != null">#{attr3},</if>
<if test="attr4 != null">#{attr4},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<insert id="insertBaseFileBatch">
INSERT INTO base_file(file_id, file_name, file_address, source_id, remark, create_by, create_time)
VALUES
<foreach collection="baseFiles" index="" item="baseFile" separator=",">
(
#{baseFile.fileId},
#{baseFile.fileName},
#{baseFile.fileAddress},
#{baseFile.sourceId},
#{baseFile.remark},
#{baseFile.createBy},
#{baseFile.createTime}
)
</foreach>
</insert>
<update id="updateBaseFile" parameterType="BaseFile">
update base_file
<trim prefix="SET" suffixOverrides=",">
<if test="fileName != null">file_name = #{fileName},</if>
<if test="fileAddress != null">file_address = #{fileAddress},</if>
<if test="sourceId != null">source_id = #{sourceId},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="attr1 != null">attr1 = #{attr1},</if>
<if test="attr2 != null">attr2 = #{attr2},</if>
<if test="attr3 != null">attr3 = #{attr3},</if>
<if test="attr4 != null">attr4 = #{attr4},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where file_id = #{fileId}
</update>
<delete id="deleteBaseFileByFileId" parameterType="String">
delete from base_file where file_id = #{fileId}
</delete>
<delete id="deleteBaseFileByFileIds" parameterType="String">
delete from base_file where file_id in
<foreach item="fileId" collection="array" open="(" separator="," close=")">
#{fileId}
</foreach>
</delete>
</mapper>

@ -19,10 +19,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="splitMerge" column="split_merge" />
<result property="splitMergNum" column="split_merg_num" />
<result property="sync" column="sync"/>
<result property="workCenter" column="work_center"/>
<result property="workTime" column="work_time"/>
</resultMap>
<sql id="selectProProcessVo">
select process_id, process_code, process_name, attention, enable_flag, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from pro_process
select process_id, process_code, process_name, attention,
enable_flag, remark, attr1, attr2, attr3, attr4, create_by, create_time,
update_by, update_time,split_merge,split_merg_num,sync,work_center,work_time
from pro_process
</sql>
<select id="selectProProcessList" parameterType="ProProcess" resultMap="ProProcessResult">
@ -72,6 +80,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="splitMerge != null">split_merge,</if>
<if test="splitMergNum != null">split_merg_num,</if>
<if test="sync != null">sync,</if>
<if test="workCenter != null">work_center,</if>
<if test="workTime != null">work_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
#{processId},
@ -88,9 +101,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="splitMerge != null">#{splitMerge},</if>
<if test="splitMergNum != null">#{splitMergNum},</if>
<if test="sync != null">#{sync},</if>
<if test="workCenter != null">#{workCenter},</if>
<if test="workTime != null">#{workTime},</if>
</trim>
</insert>
<update id="updateProProcess" parameterType="ProProcess">
update pro_process
<trim prefix="SET" suffixOverrides=",">
@ -107,6 +124,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="splitMerge != null">split_merge = #{splitMerge},</if>
<if test="splitMergNum != null">split_merg_num = #{splitMergNum},</if>
<if test="sync != null">sync = #{sync},</if>
<if test="workCenter != null">work_center = #{workCenter},</if>
<if test="workTime != null">work_time = #{workTime},</if>
</trim>
where process_id = #{processId}
</update>

@ -1,4 +1,4 @@
package com.op.mes.controller;
package com.op.wms.controller;
import java.io.IOException;
import java.util.List;

Loading…
Cancel
Save