系统管理的部门sql修改;工艺加是否需要首检;

highway
zhaoxiaolin 1 year ago
parent 0216a5d952
commit 9a62fbe233

@ -177,7 +177,7 @@ public class DataScopeAspect {
sqlString.append(StringUtils.format(" OR {}.dept_id = {} ", deptAlias, user.getDeptId()));
} else if (DATA_SCOPE_DEPT_AND_CHILD.equals(dataScope)) {
sqlString.append(StringUtils.format(
" OR {}.dept_id IN ( SELECT dept_id FROM sys_dept WHERE dept_id = {} or find_in_set( {} , ancestors ) )",
" OR {}.dept_id IN ( SELECT dept_id FROM sys_dept WHERE dept_id = {} or CHARINDEX(CONVERT (VARCHAR, {}), ancestors) > 0 )",
deptAlias, user.getDeptId(), user.getDeptId()));
} else if (DATA_SCOPE_SELF.equals(dataScope)) {
if (StringUtils.isNotBlank(userAlias)) {

@ -13,11 +13,13 @@ spring:
cloud:
nacos:
discovery:
namespace: zxl
namespace: lanju-op
group: zxl
# 服务注册地址
server-addr: 140.249.53.142:8848
config:
namespace: zxl
namespace: lanju-op
group: zxl
#命名空间
#group: local
# 配置中心地址

@ -35,8 +35,7 @@ import org.springframework.web.bind.annotation.RestController;
*/
@RestController
@RequestMapping("/pro/proroute")
public class ProRouteController extends BaseController
{
public class ProRouteController extends BaseController {
@Autowired
private IProRouteService proRouteService;
@ -49,8 +48,7 @@ public class ProRouteController extends BaseController
*/
@RequiresPermissions("mes:pro:process:add")
@GetMapping("/list")
public TableDataInfo list(ProRoute proRoute)
{
public TableDataInfo list(ProRoute proRoute) {
startPage();
List<ProRoute> list = proRouteService.selectProRouteList(proRoute);
return getDataTable(list);
@ -62,8 +60,7 @@ public class ProRouteController extends BaseController
@RequiresPermissions("mes:pro:proroute:export")
@Log(title = "工艺路线", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, ProRoute proRoute)
{
public void export(HttpServletResponse response, ProRoute proRoute) {
List<ProRoute> list = proRouteService.selectProRouteList(proRoute);
ExcelUtil<ProRoute> util = new ExcelUtil<ProRoute>(ProRoute.class);
util.exportExcel(response, list, "工艺路线数据");
@ -74,8 +71,7 @@ public class ProRouteController extends BaseController
*/
@RequiresPermissions("mes:pro:proroute:query")
@GetMapping(value = "/{routeId}")
public AjaxResult getInfo(@PathVariable("routeId") String routeId)
{
public AjaxResult getInfo(@PathVariable("routeId") String routeId) {
return AjaxResult.success(proRouteService.selectProRouteByRouteId(routeId));
}
@ -85,10 +81,9 @@ public class ProRouteController extends BaseController
@RequiresPermissions("mes:pro:proroute:add")
@Log(title = "工艺路线", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ProRoute proRoute)
{
public AjaxResult add(@RequestBody ProRoute proRoute) {
proRoute.setRouteId(IdUtils.fastSimpleUUID());
if(!proRouteService.checkRouteCodeUnique(proRoute)){
if (!proRouteService.checkRouteCodeUnique(proRoute)) {
return AjaxResult.error("工艺路线编号已存在!");
}
return toAjax(proRouteService.insertProRoute(proRoute));
@ -100,9 +95,8 @@ public class ProRouteController extends BaseController
@RequiresPermissions("mes:pro:proroute:edit")
@Log(title = "工艺路线", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ProRoute proRoute)
{
if(!proRouteService.checkRouteCodeUnique(proRoute)){
public AjaxResult edit(@RequestBody ProRoute proRoute) {
if (!proRouteService.checkRouteCodeUnique(proRoute)) {
return AjaxResult.error("工艺路线编号已存在!");
}
return toAjax(proRouteService.updateProRoute(proRoute));
@ -113,12 +107,10 @@ public class ProRouteController extends BaseController
*/
@RequiresPermissions("mes:pro:proroute:remove")
@Log(title = "工艺路线", businessType = BusinessType.DELETE)
@Transactional
@DeleteMapping("/{routeIds}")
public AjaxResult remove(@PathVariable String[] routeIds)
{
for (String routeId:routeIds
) {
//@Transactional
@DeleteMapping("/{routeIds}")
public AjaxResult remove(@PathVariable String[] routeIds) {
for (String routeId : routeIds) {
proRouteProcessService.deleteByRouteId(routeId);
//proRouteProductService.deleteByRouteId(routeId);
//proRouteProductBomService.deleteByRouteId(routeId);

@ -0,0 +1,222 @@
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;
import java.util.List;
/**
* pro_process
*
* @author yinjinlu
* @date 2022-05-12
*/
public class ProRecipe extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 工序ID */
private String processId;
/** 工序编码 */
@Excel(name = "工序编码")
private String processCode;
/** 工序名称 */
@Excel(name = "工序名称")
private String processName;
/** 工艺要求 */
@Excel(name = "工艺要求")
private String attention;
/** 是否启用 */
@Excel(name = "是否启用")
private String enableFlag;
/** 预留字段1 */
private String attr1;
/** 预留字段2 */
private String attr2;
/** 预留字段3 */
private Long attr3;
/** 预留字段4 */
private Long attr4;
private String fileList;
private List<BaseFile> files;
//s:拆分 m合并
private String splitMerge;
//拆分合并数量
private int splitMergNum;
//1允许多单并行
private String sync;
//工作中心
private String workCenter;
//工作时长
private Double workTime;
public List<BaseFile> getFiles() {
return files;
}
public void setFiles(List<BaseFile> files) {
this.files = files;
}
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;
}
public String getProcessId()
{
return processId;
}
public void setProcessCode(String processCode)
{
this.processCode = processCode;
}
public String getProcessCode()
{
return processCode;
}
public void setProcessName(String processName)
{
this.processName = processName;
}
public String getProcessName()
{
return processName;
}
public void setAttention(String attention)
{
this.attention = attention;
}
public String getAttention()
{
return attention;
}
public void setEnableFlag(String enableFlag)
{
this.enableFlag = enableFlag;
}
public String getEnableFlag()
{
return enableFlag;
}
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("processId", getProcessId())
.append("processCode", getProcessCode())
.append("processName", getProcessName())
.append("attention", getAttention())
.append("enableFlag", getEnableFlag())
.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();
}
}

@ -0,0 +1,178 @@
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;
/**
* pro_process_content
*
* @author yinjinlu
* @date 2022-05-12
*/
public class ProRecipeContent extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 内容ID */
private String contentId;
/** 工序ID */
@Excel(name = "工序ID")
private String processId;
/** 顺序编号 */
@Excel(name = "顺序编号")
private Integer orderNum;
/** 内容说明 */
@Excel(name = "内容说明")
private String contentText;
/** 辅助设备 */
@Excel(name = "辅助设备")
private String device;
/** 辅助材料 */
@Excel(name = "辅助材料")
private String material;
/** 材料URL */
@Excel(name = "材料URL")
private String docUrl;
/** 预留字段1 */
private String attr1;
/** 预留字段2 */
private String attr2;
/** 预留字段3 */
private Long attr3;
/** 预留字段4 */
private Long attr4;
public void setContentId(String contentId)
{
this.contentId = contentId;
}
public String getContentId()
{
return contentId;
}
public void setProcessId(String processId)
{
this.processId = processId;
}
public String getProcessId()
{
return processId;
}
public void setOrderNum(Integer orderNum)
{
this.orderNum = orderNum;
}
public Integer getOrderNum()
{
return orderNum;
}
public void setContentText(String contentText)
{
this.contentText = contentText;
}
public String getContentText()
{
return contentText;
}
public void setDevice(String device)
{
this.device = device;
}
public String getDevice()
{
return device;
}
public void setMaterial(String material)
{
this.material = material;
}
public String getMaterial()
{
return material;
}
public void setDocUrl(String docUrl)
{
this.docUrl = docUrl;
}
public String getDocUrl()
{
return docUrl;
}
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("contentId", getContentId())
.append("processId", getProcessId())
.append("orderNum", getOrderNum())
.append("contentText", getContentText())
.append("device", getDevice())
.append("material", getMaterial())
.append("docUrl", getDocUrl())
.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();
}
}

@ -37,6 +37,10 @@ public class ProRoute extends BaseEntity
@Excel(name = "是否启用")
private String enableFlag;
/** 是否需要首检 */
@Excel(name = "是否需要首检")
private String needCheck;
/** 预留字段1 */
private String attr1;
@ -160,6 +164,14 @@ public class ProRoute extends BaseEntity
return attr4;
}
public String getNeedCheck() {
return needCheck;
}
public void setNeedCheck(String needCheck) {
this.needCheck = needCheck;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -29,8 +29,7 @@ import java.util.List;
* @date 2022-05-11
*/
@Service
public class ProProcessServiceImpl implements IProProcessService
{
public class ProProcessServiceImpl implements IProProcessService {
@Autowired
private ProProcessMapper proProcessMapper;
@ -45,11 +44,10 @@ public class ProProcessServiceImpl implements IProProcessService
*/
@Override
@DS("#header.poolName")
public ProProcess selectProProcessByProcessId(String processId)
{
public ProProcess selectProProcessByProcessId(String processId) {
ProProcess p = proProcessMapper.selectProProcessByProcessId(processId);
List<BaseFile> files = baseFileMapper.getBaseFileBatch(processId);
if(!CollectionUtils.isEmpty(files)){
List<BaseFile> files = baseFileMapper.getBaseFileBatch(processId);
if (!CollectionUtils.isEmpty(files)) {
p.setFiles(files);
}
return p;
@ -63,13 +61,13 @@ public class ProProcessServiceImpl implements IProProcessService
*/
@Override
@DS("#header.poolName")
public List<ProProcess> selectProProcessList(ProProcess proProcess)
{
public List<ProProcess> selectProProcessList(ProProcess proProcess) {
return proProcessMapper.selectProProcessList(proProcess);
}
/**
*
*
* @param proProcess
* @return
*/
@ -77,7 +75,7 @@ public class ProProcessServiceImpl implements IProProcessService
@DS("#header.poolName")
public Boolean checkProcessCodeUnique(ProProcess proProcess) {
ProProcess process = proProcessMapper.checkProcessCodeUnique(proProcess);
if(StringUtils.isNotNull(process) && !process.getProcessId().equals(proProcess.getProcessId())){
if (StringUtils.isNotNull(process) && !process.getProcessId().equals(proProcess.getProcessId())) {
return UserConstants.NOT_UNIQUE;
}
return UserConstants.UNIQUE;
@ -86,6 +84,7 @@ public class ProProcessServiceImpl implements IProProcessService
/**
*
*
* @param proProcess
* @return
*/
@ -94,7 +93,7 @@ public class ProProcessServiceImpl implements IProProcessService
public Boolean checkProcessNameUnique(ProProcess proProcess) {
ProProcess process = proProcessMapper.checkProcessNameUnique(proProcess);
if(StringUtils.isNotNull(process) && !process.getProcessId().equals(proProcess.getProcessId())){
if (StringUtils.isNotNull(process) && !process.getProcessId().equals(proProcess.getProcessId())) {
return UserConstants.NOT_UNIQUE;
}
return UserConstants.UNIQUE;
@ -108,17 +107,16 @@ public class ProProcessServiceImpl implements IProProcessService
*/
@Override
@DS("#header.poolName")
public int insertProProcess(ProProcess proProcess)
{
public int insertProProcess(ProProcess proProcess) {
proProcess.setProcessId(IdUtils.fastSimpleUUID());
proProcess.setCreateTime(DateUtils.getNowDate());
//上传附件
if(StringUtils.isNotEmpty(proProcess.getFileList())){
if (StringUtils.isNotEmpty(proProcess.getFileList())) {
String[] ids = proProcess.getFileList().split(",");
List<BaseFileData> files = new ArrayList<>();
BaseFileData file = null;
for(String id:ids){
for (String id : ids) {
file = new BaseFileData();
file.setFileId(IdUtils.fastSimpleUUID());
file.setFileName(id.split("&fileName=")[1]);
@ -142,16 +140,15 @@ public class ProProcessServiceImpl implements IProProcessService
*/
@Override
@DS("#header.poolName")
public int updateProProcess(ProProcess proProcess)
{
public int updateProProcess(ProProcess proProcess) {
//上传附件
if(StringUtils.isNotEmpty(proProcess.getFileList())){
if (StringUtils.isNotEmpty(proProcess.getFileList())) {
baseFileMapper.deleteBaseFileBySourceId(proProcess.getProcessId());
String[] ids = proProcess.getFileList().split(",");
List<BaseFileData> files = new ArrayList<>();
BaseFileData file = null;
for(String id:ids){
for (String id : ids) {
file = new BaseFileData();
file.setFileId(IdUtils.fastSimpleUUID());
file.setFileAddress(id);
@ -176,8 +173,7 @@ public class ProProcessServiceImpl implements IProProcessService
*/
@Override
@DS("#header.poolName")
public int deleteProProcessByProcessIds(String[] processIds)
{
public int deleteProProcessByProcessIds(String[] processIds) {
return proProcessMapper.deleteProProcessByProcessIds(processIds);
}
@ -189,8 +185,7 @@ public class ProProcessServiceImpl implements IProProcessService
*/
@Override
@DS("#header.poolName")
public int deleteProProcessByProcessId(String processId)
{
public int deleteProProcessByProcessId(String processId) {
return proProcessMapper.deleteProProcessByProcessId(processId);
}
}

@ -20,12 +20,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="routeVersion" column="route_version" />
<result property="needCheck" column="need_check" />
</resultMap>
<sql id="selectProRouteVo">
select route_id, route_code, route_name, route_desc, enable_flag, remark,
attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time,
route_version
route_version,need_check
from pro_route
</sql>
@ -57,7 +59,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="checkRouteCodeUnique" parameterType="ProRoute" resultMap="ProRouteResult">
select top 1 route_id, route_code, route_name, route_desc,
enable_flag, remark, attr1, attr2, attr3, attr4,
create_by, create_time, update_by, update_time
create_by, create_time, update_by, update_time,need_check
from pro_route
where route_code = #{routeCode}
</select>
@ -80,6 +82,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="routeVersion != null">route_version,</if>
<if test="needCheck != null">need_check,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="routeId != null and routeId != ''">#{routeId},</if>
@ -96,7 +100,8 @@ 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="routeVersion != null">#{updateTime},</if>
<if test="routeVersion != null">#{routeVersion},</if>
<if test="needCheck != null">#{needCheck},</if>
</trim>
</insert>
@ -117,6 +122,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="routeVersion != null">route_version = #{routeVersion},</if>
<if test="needCheck != null">#{needCheck},</if>
</trim>
where route_id = #{routeId}
</update>

@ -223,9 +223,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{recordId}
</foreach>
</delete>
<delete id="deleteByRouteId" parameterType="String">
delete from pro_route_process where route_id = #{routeId}
</delete>
</mapper>

@ -73,11 +73,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectChildrenDeptById" parameterType="Long" resultMap="SysDeptResult">
select * from sys_dept where find_in_set(#{deptId}, ancestors)
select * from sys_dept where CHARINDEX(CONVERT (VARCHAR, #{deptId}), ancestors) > 0
</select>
<select id="selectNormalChildrenDeptById" parameterType="Long" resultType="int">
select count(*) from sys_dept where status = 0 and del_flag = '0' and find_in_set(#{deptId}, ancestors)
select count(*) from sys_dept where status = 0 and del_flag = '0' and
CHARINDEX(CONVERT (VARCHAR, #{deptId}), ancestors) > 0
</select>
<select id="checkDeptNameUnique" resultMap="SysDeptResult">

@ -79,7 +79,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND date_format(u.create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
</if>
<if test="deptId != null and deptId != 0">
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId}, ancestors) ))
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t
WHERE CHARINDEX(CONVERT (VARCHAR, #{deptId}), ancestors) > 0
))
</if>
<!-- 数据范围过滤 -->
${params.dataScope}

@ -79,7 +79,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND date_format(u.create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
</if>
<if test="deptId != null and deptId != 0">
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId}, ancestors) ))
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE CHARINDEX(','+ '0' +#{deptId} , ','+ancestors+',') >0
))
</if>
<!-- 数据范围过滤 -->
${params.dataScope}

Loading…
Cancel
Save