Commit 4a321273 authored by 温志超's avatar 温志超

Merge remote-tracking branch 'origin/master'

parents d4434d96 cfa6dfbb
......@@ -111,6 +111,13 @@ cal.error.error18=\u521B\u5EFA\u6570\u636E\u72B6\u6001\u5F02\u5E38
cal.error.error19=\u5DE5\u4F5C\u5355\u5143\u4E3A\u7A7A,\u65E0\u6CD5\u6392\u73ED
cal.error.error20=\u6CA1\u6709\u6307\u5B9A\u653E\u5047\u5BF9\u8C61
cal.error.error21=\u975E\u6CD5\u7684\u66F4\u65B0\u6570\u636E
cal.error.error22=\u73ED\u6B21\u5F00\u59CB\u65F6\u95F4\u65E9\u4E8E\u8BA1\u5212\u5DE5\u4F5C\u5F00\u59CB\u65F6\u95F4
cal.error.error23=\u73ED\u6B21\u7ED3\u675F\u65F6\u95F4\u665A\u4E8E\u4E8E\u8BA1\u5212\u5DE5\u4F5C\u7ED3\u675F\u65F6\u95F4
cal.error.error24=\u73ED\u6B21\u7ED3\u675F\u65F6\u95F4\u65E9\u4E8E\u73ED\u6B21\u5DE5\u4F5C\u5F00\u59CB\u65F6\u95F4
cal.error.error25=\u4F11\u606F\u5F00\u59CB\u7ED3\u675F\u65F6\u95F4\u914D\u7F6E\u76F8\u7B49,\u4E0D\u53EF\u63D0\u4EA4
cal.error.error26=\u4F11\u606F\u5F00\u59CB\u65F6\u95F4\u65E9\u4E8E\u8BA1\u5212\u5DE5\u4F5C\u5F00\u59CB\u65F6\u95F4
cal.error.error27=\u4F11\u606F\u7ED3\u675F\u65F6\u95F4\u665A\u4E8E\u4E8E\u8BA1\u5212\u5DE5\u4F5C\u7ED3\u675F\u65F6\u95F4
cal.error.error28=\u73ED\u6B21\u6DFB\u52A0\u4F11\u606F\u65F6\u95F4\u98A0\u5012,\u9700\u8981\u6309\u7167\u65F6\u95F4\u987A\u5E8F\u5F55\u5165
#pro.tool
pro.tool.error.error_1=\u5200\u6A21\u7248\u5177\u5E76\u672A\u5168\u90E8\u4E0A\u673A
pro.tool.error.error_4=\u5200\u6A21\u7248\u5177\u5E76\u672A\u5168\u90E8\u4E0A\u673A
......@@ -216,5 +223,5 @@ qc.error.error7=\u68C0\u6D4B\u9879\u540D\u79F0\u5DF2\u5B58\u5728
#system.printer
system.printer.error.repeat.bind=\u8BE5\u6253\u5370\u673A\u5DF2\u7ED1\u5B9A\u4E86
rule.currentSerial.error= \u8BE5\u4EA7\u54C1\u5E8F\u5217\u53F7\u5269\u4F59:{0}\u4E0D\u6EE1\u8DB3\u5DE5\u5355\u6570\u91CF:{1}
#工作单元编不唯一
md.workUnit.error.workunitCode.unique = \u5de5\u5355\u5355\u5143\u7f16\u7801\u5df2\u5b58\u5728
\ No newline at end of file
#\u5DE5\u4F5C\u5355\u5143\u7F16\u4E0D\u552F\u4E00
md.workUnit.error.workunitCode.unique = \u5DE5\u5355\u5355\u5143\u7F16\u7801\u5DF2\u5B58\u5728
\ No newline at end of file
......@@ -66,6 +66,13 @@ public class BaseEntity implements Serializable {
return (T) o;
}
public <T extends BaseEntity> T deepSetObjParameter(T t) {
Object o = t.deepCopyObj();
DataUtil.copyFieldsAndSetValues(this, o);
return (T) o;
}
public <T> T deepSetObj(Class<T> tClass) {
T target = this.deepCopyObj(tClass);
DataUtil.copyFieldsAndSetValues(this, target);
......
......@@ -7,13 +7,11 @@ import com.ximai.common.core.controller.BaseController;
import com.ximai.common.core.domain.AjaxResult;
import com.ximai.common.core.page.TableDataInfo;
import com.ximai.common.enums.BusinessType;
import com.ximai.common.utils.MessageUtils;
import com.ximai.common.utils.data.ExceptionUtil;
import com.ximai.mes.cal.domain.CalPlanWorkunit;
import com.ximai.mes.cal.service.ICalPlanWorkunitService;
import com.ximai.mes.constant.CalPlanWorkunitEnum;
import io.swagger.annotations.ApiOperation;
import org.aspectj.bridge.Message;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
......@@ -97,14 +95,14 @@ public class CalPlanWorkunitController extends BaseController {
@Log(title = "计划工作单元", businessType = BusinessType.UPDATE)
@PutMapping(value = "/editList")
public AjaxResult editList(@RequestBody List<CalPlanWorkunit> calPlanWorkunits) {
ExceptionUtil.checkTrueThrowException(CollectionUtil.isEmpty(calPlanWorkunits), MessageUtils.message("cal.error.error20"));
ExceptionUtil.checkTrueThrowException(CollectionUtil.isEmpty(calPlanWorkunits), "没有指定放假对象");
long count = calPlanWorkunits.stream().filter(
x -> x.getWorkunitId() == null ||
x.getTheDay() == null ||
x.getShiftName() == null ||
x.getIsWork() == null).count();
ExceptionUtil.checkTrueThrowException(count > 0, MessageUtils.message("cal.error.error21"));
ExceptionUtil.checkTrueThrowException(count > 0, "非法的更新数据");
// workunit_id,the_day,shift_name
for (CalPlanWorkunit calPlanWorkunit : calPlanWorkunits) {
......@@ -132,6 +130,6 @@ public class CalPlanWorkunitController extends BaseController {
@Log(title = "计划工作单元删除", businessType = BusinessType.DELETE)
@DeleteMapping("/{planWorkunitIds}")
public AjaxResult remove(@PathVariable Long[] planWorkunitIds) {
return toAjax(calPlanWorkunitService.deleteCalPlanWorkunitByPlanWorkunitIds(planWorkunitIds));
return toAjax(calPlanWorkunitService.deleteListByIds(planWorkunitIds));
}
}
......@@ -82,10 +82,10 @@ public class CalShiftController extends BaseController {
calShiftVoQueryWrapper.eq(StringUtils.isNotEmpty(calPlanWorkunit.getWorkunitId()), "cpw.workunit_id", calPlanWorkunit.getWorkunitId());
calShiftVoQueryWrapper.eq(StringUtils.isNotEmpty(calPlanWorkunit.getTheDay()), "cpw.the_day", calPlanWorkunit.getTheDay());
calShiftVoQueryWrapper.eq(StringUtils.isNotEmpty(calPlanWorkunit.getShiftName()), "ash.shift_name", calPlanWorkunit.getShiftName());
calShiftVoQueryWrapper.like(StringUtils.isNotEmpty(calPlanWorkunit.getWorkunitCode()), "cpw.workunit_code", calPlanWorkunit.getWorkunitCode());
calShiftVoQueryWrapper.apply(StringUtils.isNotEmpty(calPlanWorkunit.getWorkstationName()), "LOWER(mws.workstation_name) like CONCAT('%',LOWER({0}),'%')", calPlanWorkunit.getWorkstationName());
calShiftVoQueryWrapper.apply(StringUtils.isNotEmpty(calPlanWorkunit.getWorkshopName()), "LOWER(mws.workshop_name) like CONCAT('%',LOWER({0}),'%')", calPlanWorkunit.getWorkshopName());
calShiftVoQueryWrapper.like(StringUtils.isNotEmpty(calPlanWorkunit.getWorkstationName()), "mws.workstation_name", calPlanWorkunit.getWorkstationName());
calShiftVoQueryWrapper.like(StringUtils.isNotEmpty(calPlanWorkunit.getWorkshopName()), "mws.workshop_name", calPlanWorkunit.getWorkshopName());
return getDataTable(calShiftMapper.selectOnWorkShiftByQw(calShiftVoQueryWrapper));
}
......
......@@ -8,7 +8,6 @@ import com.ximai.common.enums.BusinessType;
import com.ximai.mes.cal.domain.CalWorkunit;
import com.ximai.mes.cal.service.ICalWorkunitService;
import com.ximai.mes.md.domain.MdWorkunit;
import com.ximai.mes.md.service.IMdWorkunitService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
......@@ -33,8 +32,6 @@ public class CalWorkunitController extends BaseController {
@Autowired
private ICalWorkunitService calWorkunitService;
@Autowired
private IMdWorkunitService mdWorkunitService;
/**
* 查询计划工作单元列表
......@@ -58,6 +55,26 @@ public class CalWorkunitController extends BaseController {
return getDataTable(list);
}
/**
* 查询计划勾选的工作单元之外的所有工作的单元
*/
// @PreAuthorize("@ss.hasPermi('md:workunit:list')")
@GetMapping("/getWorkunitByPlanId")
public TableDataInfo getWorkunitByPlanId(CalWorkunit calWorkunit) {
List<CalWorkunit> calWorkunits = new ArrayList<>();
if (calWorkunit.getPlanId() != null) {
CalWorkunit checkAll = new CalWorkunit();
checkAll.setPlanId(calWorkunit.getPlanId());
calWorkunits = calWorkunitService.selectCalWorkunitList(checkAll);
}
startPage();
List<MdWorkunit> mdWorkunits = calWorkunitService.getWorkunitByPlanId(calWorkunit,calWorkunits);
return getDataTable(mdWorkunits);
}
@GetMapping("/calWorkunitList")
public AjaxResult calWorkunitList() {
List<CalWorkunit> list = calWorkunitService.selectCalWorkunitList(new CalWorkunit());
......@@ -85,7 +102,7 @@ public class CalWorkunitController extends BaseController {
@PreAuthorize("@ss.hasPermi('md:workunit:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return AjaxResult.success(calWorkunitService.selectCalWorkunitById(id));
return AjaxResult.success(calWorkunitService.getObjById(id));
}
/**
......
......@@ -6,6 +6,8 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ximai.common.annotation.Excel;
import com.ximai.common.core.domain.BaseEntity;
......
......@@ -106,7 +106,6 @@ public class CalPlan extends BaseEntity {
* 预留字段4
*/
private Long attr4;
@ApiModelProperty(value = "轮班班次列表")
private List<CalShift> calShifts;
......
......@@ -35,7 +35,20 @@ public class CalPlanWorkunit extends BaseEntity {
@ApiModelProperty(value = "计划id")
@Excel(name = "计划ID")
private Long planId;
/**
* 计划ID
*/
@ApiModelProperty(value = "计划id")
@Excel(name = "计划ID")
private String planCode;
/**
* 计划ID
*/
@ApiModelProperty(value = "计划id")
@Excel(name = "计划ID")
private String planName;
@ApiModelProperty(value = "班次类型")
private String shiftType;
......@@ -121,6 +134,12 @@ public class CalPlanWorkunit extends BaseEntity {
@Excel(name = "结束时间")
private Date endDate;
/**
* 开始数据和结束时间
*/
@TableField(exist = false)
private String workDate;
// /**
// * 开始时间
......
......@@ -26,6 +26,8 @@ public class CalShift extends BaseEntity {
@TableField(exist = false)
private int restFlag = 0;
@TableField(exist = false)
private Integer nextDay;
/**
......@@ -43,6 +45,7 @@ public class CalShift extends BaseEntity {
private Long planId;
private String planCode;
private String planName;
@ApiModelProperty(value = "排列顺序")
/**
......@@ -76,20 +79,20 @@ public class CalShift extends BaseEntity {
@Excel(name = "结束时间")
private String endTime;
/**
* 开始时间
*/
@ApiModelProperty(value = "开始时间")
@Excel(name = "开始时间")
private Date startDate;
/**
* 结束时间
*/
@ApiModelProperty(value = "结束时间")
@Excel(name = "结束时间")
private Date endDate;
//
// /**
// * 开始时间
// */
// @ApiModelProperty(value = "开始时间")
// @Excel(name = "开始时间")
// private Date startDate;
//
// /**
// * 结束时间
// */
// @ApiModelProperty(value = "结束时间")
// @Excel(name = "结束时间")
// private Date endDate;
@ApiModelProperty(value = "休息开始时间")
private String breakStartTime;
......@@ -121,4 +124,7 @@ public class CalShift extends BaseEntity {
private List<CalShift> breakTimeList = new ArrayList<>();
private Date execStartTime;
private Date execEndTime;
}
......@@ -66,7 +66,7 @@ public class CalWorkunit extends BaseEntity {
@TableField(exist = false)
private String workstationCode;
@TableField(exist = false)
private String workstationName;
......
......@@ -40,6 +40,7 @@ public class CalShiftVo extends BaseEntity implements Comparable<CalShiftVo> {
*/
private Long planId;
private String planCode;
private String planName;
/**
* 序号
......@@ -116,5 +117,6 @@ public class CalShiftVo extends BaseEntity implements Comparable<CalShiftVo> {
private String workstationName;
private String workshopName;
private Integer nextDay;
private List<CalShiftVo> breakTimeList = new ArrayList<>();
}
......@@ -3,6 +3,7 @@ package com.ximai.mes.cal.mapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ximai.mes.cal.domain.CalPlanWorkunit;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
......@@ -53,6 +54,11 @@ public interface CalPlanWorkunitMapper extends BaseMapper<CalPlanWorkunit> {
*/
int deleteCalPlanWorkunitByid(Long planWorkunitId);
@Delete("delete from cal_plan_workunit where plan_code = #{planCode}")
int deleteByPlanCode(@Param("planCode") String planCode);
/**
* 批量删除计划工作单元
*
......
......@@ -3,8 +3,10 @@ package com.ximai.mes.cal.mapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ximai.mes.cal.domain.CalWorkunit;
import com.ximai.mes.md.domain.MdWorkunit;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.security.core.parameters.P;
import java.util.List;
......@@ -41,6 +43,17 @@ public interface CalWorkunitMapper extends BaseMapper<CalWorkunit> {
@Select("select t1.*,t2.workstation_id,t2.workstation_code,t3.workstation_name,t4.workshop_id,t4.workshop_code,t4.workshop_name,t5.factory_id,t5.factory_code,t5.factory_name from cal_workunit t1 inner join md_workunit t2 on t1.workunit_id = t2.workunit_id inner join md_workstation t3 on t2.workstation_id = t3.workstation_id inner join md_workshop t4 on t4.workshop_id = t3.workshop_id inner join md_factory t5 on t5.factory_id = t4.factory_id ${ew.customSqlSegment}")
List<CalWorkunit> selectListByQw(@Param("ew") QueryWrapper<CalWorkunit> query);
/**
* 关联工作中心查询作业单元列表
*
* @param query
* @return
*/
@Select("select distinct t1.*,t2.workstation_id,t2.workstation_code,t3.workstation_name,t4.workshop_id,t4.workshop_code,t4.workshop_name,t5.factory_id,t5.factory_code,t5.factory_name from cal_workunit t1 inner join md_workunit t2 on t1.workunit_id = t2.workunit_id inner join md_workstation t3 on t2.workstation_id = t3.workstation_id inner join md_workshop t4 on t4.workshop_id = t3.workshop_id inner join md_factory t5 on t5.factory_id = t4.factory_id ${ew.customSqlSegment}")
List<MdWorkunit> selectListByQwV2(@Param("ew") QueryWrapper<CalWorkunit> query);
/**
* 新增计划工作单元
*
......@@ -76,4 +89,10 @@ public interface CalWorkunitMapper extends BaseMapper<CalWorkunit> {
int deleteCalWorkunitByPlanId(Long planId);
int deleteCalWorkunitByPlanCode(String planCode);
List<MdWorkunit> selectMdworkunitList(@Param("workunitCode") String workunitCode,
@Param("workunitName") String workunitName,
@Param("workstationName")String workstationName,
@Param("workshopName")String workshopName,
@Param("workunitCodes")List<String> workunitCodes);
}
......@@ -70,7 +70,7 @@ public interface ICalPlanWorkunitService {
* @param planWorkunitIds 需要删除的计划工作单元主键集合
* @return 结果
*/
int deleteCalPlanWorkunitByPlanWorkunitIds(Long[] planWorkunitIds);
int deleteListByIds(Long[] planWorkunitIds);
/**
* 删除计划工作单元信息
......
......@@ -2,6 +2,7 @@ package com.ximai.mes.cal.service;
import java.util.List;
import com.ximai.mes.cal.domain.CalPlan;
import com.ximai.mes.cal.domain.CalTeamshift;
import org.springframework.scheduling.annotation.Async;
......
package com.ximai.mes.cal.service;
import com.ximai.common.core.page.TableDataInfo;
import com.ximai.mes.cal.domain.CalWorkunit;
import com.ximai.mes.md.domain.MdWorkunit;
......@@ -18,7 +19,7 @@ public interface ICalWorkunitService {
* @param id 计划工作单元主键
* @return 计划工作单元
*/
CalWorkunit selectCalWorkunitById(Long id);
CalWorkunit getObjById(Long id);
/**
* 查询计划工作单元列表
......@@ -66,4 +67,6 @@ public interface ICalWorkunitService {
void deleteCalWorkunitByPlanCode(String planCode);
List<MdWorkunit> getWorkunitByPlanId(CalWorkunit calWorkunit,List<CalWorkunit> calWorkunits);
}
......@@ -14,10 +14,13 @@ import com.ximai.mes.cal.mapper.CalTeamMemberMapper;
import com.ximai.mes.cal.mapper.CalTeamshiftMapper;
import com.ximai.mes.cal.service.ICalCalendarService;
import com.ximai.mes.cal.utils.MesCalendarUtil;
import com.ximai.mes.md.domain.MdWorkunit;
import com.ximai.mes.md.mapper.MdWorkunitMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
......@@ -34,6 +37,9 @@ public class CalCalendarServiceImpl implements ICalCalendarService {
@Autowired
private CalTeamMemberMapper calTeamMemberMapper;
@Autowired
private MdWorkunitMapper mdWorkunitMapper;
@Autowired
private CalPlanWorkunitMapper calPlanWorkunitMapper;
......@@ -123,6 +129,23 @@ public class CalCalendarServiceImpl implements ICalCalendarService {
List<CalPlanWorkunit> resultCalPlanWorkunits = new ArrayList<>();
for (Map.Entry<String, List<CalPlanWorkunit>> entry : groupBy.entrySet()) {
//获取当天的时间
switch ( entry.getValue().get(0).getShiftName()){
case "白班":
String s = CalPlanWorkunitUp(entry);
entry.getValue().get(0).setWorkDate(s);
break;
case "中班":
String s1 = CalPlanWorkunitCentre(entry);
entry.getValue().get(0).setWorkDate(s1);
break;
case "夜班":
String s2 = CalPlanWorkunitCentre(entry);
entry.getValue().get(0).setWorkDate(s2);
break;
default:
break;
}
resultCalPlanWorkunits.add(entry.getValue().get(0));
}
if (CollUtil.isNotEmpty(resultCalPlanWorkunits)) {
......@@ -167,11 +190,15 @@ public class CalCalendarServiceImpl implements ICalCalendarService {
public List<CalCalendar> getCalendarByWorkunit(Date day, CalCalendar calCalendar) {
List<CalCalendar> calendars = MesCalendarUtil.getDays(day);
for (CalCalendar cal : calendars) {
MdWorkunit mdWorkunit1 = new MdWorkunit();
mdWorkunit1.setWorkunitId(calCalendar.getWorkunitId());
mdWorkunitMapper.selectMdWorkunitLists(mdWorkunit1);
CalPlanWorkunit param = new CalPlanWorkunit();
param.setIsWork(calCalendar.getIsWork());
param.setTheDay(cal.getTheDay());
if (calCalendar.getWorkunitName() != null) {
if (calCalendar.getWorkunitName() != null && calCalendar.getWorkunitId() != null) {
param.setWorkunitName(calCalendar.getWorkunitName());
param.setWorkunitId(calCalendar.getWorkunitId());
}
List<CalPlanWorkunit> calPlanWorkunits = calPlanWorkunitMapper.selectCalPlanWorkunitListV2(param);
......@@ -179,7 +206,25 @@ public class CalCalendarServiceImpl implements ICalCalendarService {
List<CalPlanWorkunit> resultCalPlanWorkunits = new ArrayList<>();
for (Map.Entry<String, List<CalPlanWorkunit>> entry : groupBy.entrySet()) {
resultCalPlanWorkunits.add(entry.getValue().get(0));
//获取当天的时间
switch ( entry.getValue().get(0).getShiftName()){
case "白班":
String s = CalPlanWorkunitUp(entry);
entry.getValue().get(0).setWorkDate(s);
break;
case "中班":
String s1 = CalPlanWorkunitCentre(entry);
entry.getValue().get(0).setWorkDate(s1);
break;
case "夜班":
String s2 = CalPlanWorkunitCentre(entry);
entry.getValue().get(0).setWorkDate(s2);
break;
default:
break;
}
resultCalPlanWorkunits.add(entry.getValue().get(0));
}
if (CollUtil.isNotEmpty(resultCalPlanWorkunits)) {
......@@ -194,6 +239,38 @@ public class CalCalendarServiceImpl implements ICalCalendarService {
}
//白天的时间拼接
public String CalPlanWorkunitUp(Map.Entry<String, List<CalPlanWorkunit>> entry){
Date startDate = entry.getValue().get(0).getStartDate();
Date endDate = entry.getValue().get(0).getEndDate();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String startDates= formatter.format(startDate);
String endDates = formatter.format(endDate);
String a=startDates+"--"+endDates+"\n";
Date startDate1 = entry.getValue().get(1).getStartDate();
Date endDate1 = entry.getValue().get(1).getEndDate();
String startDates1= formatter.format(startDate1);
String endDates1 = formatter.format(endDate1);
String b=startDates1+"--"+endDates1+"\n";
Date startDate2 = entry.getValue().get(2).getStartDate();
Date endDate2 = entry.getValue().get(2).getEndDate();
String startDates2= formatter.format(startDate2);
String endDates2 = formatter.format(endDate2);
String c=startDates2+"--"+endDates2;
return a+b+c;
}
//中班和中班
public String CalPlanWorkunitCentre(Map.Entry<String, List<CalPlanWorkunit>> entry){
Date startDate = entry.getValue().get(0).getStartDate();
Date endDate = entry.getValue().get(0).getEndDate();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String startDates= formatter.format(startDate);
String endDates = formatter.format(endDate);
String a=startDates+"--"+endDates;
return a;
}
private List<CalPlanWorkunit> queryCalendarMountData(CalPlanWorkunit calPlanWorkunit) {
List<CalPlanWorkunit> calPlanWorkunits = calPlanWorkunitMapper.selectCalPlanWorkunitListV2(calPlanWorkunit);
Map<String, List<CalPlanWorkunit>> groupBy = calPlanWorkunits.stream().collect(Collectors.groupingBy(x -> x.getWorkunitId() + ":" + x.getShiftName()));
......
......@@ -111,7 +111,7 @@ public class CalPlanWorkunitServiceImpl implements ICalPlanWorkunitService {
* @return 结果
*/
@Override
public int deleteCalPlanWorkunitByPlanWorkunitIds(Long[] planWorkunitIds) {
public int deleteListByIds(Long[] planWorkunitIds) {
return calPlanWorkunitMapper.deleteCalPlanWorkunitByids(planWorkunitIds);
}
......
......@@ -8,9 +8,9 @@ import com.ximai.mes.cal.domain.CalShift;
import com.ximai.mes.cal.domain.vo.CalShiftVo;
import com.ximai.mes.cal.mapper.CalShiftMapper;
import com.ximai.mes.cal.service.ICalShiftService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
......@@ -24,7 +24,7 @@ import java.util.stream.Collectors;
*/
@Service
public class CalShiftServiceImpl implements ICalShiftService {
@Autowired
@Resource
private CalShiftMapper calShiftMapper;
/**
......@@ -188,6 +188,7 @@ public class CalShiftServiceImpl implements ICalShiftService {
breakShift2.setStartTime(null);
breakShift2.setEndTime(null);
breakShift2.setOrderNum(1);
breakShift2.setNextDay(1);
list2.add(breakShift2);
shiftNight.setBreakTimeList(list2);
......@@ -228,9 +229,9 @@ public class CalShiftServiceImpl implements ICalShiftService {
List<CalShiftVo> list3 = new ArrayList<>();
CalShiftVo breakShift3 = new CalShiftVo();
breakShift3.setBreakStartTime("00:00");
breakShift3.setBreakEndTime("1:00");
breakShift3.setNextDay(1);
breakShift3.setStartTime(null);
breakShift3.setEndTime(null);
breakShift3.setOrderNum(1);
......
......@@ -7,6 +7,7 @@ import com.ximai.mes.cal.domain.CalWorkunit;
import com.ximai.mes.cal.mapper.CalWorkunitMapper;
import com.ximai.mes.cal.service.ICalWorkunitService;
import com.ximai.mes.md.domain.MdWorkunit;
import com.ximai.mes.md.mapper.MdWorkunitMapper;
import com.ximai.mes.md.service.IMdWorkunitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -27,10 +28,12 @@ public class CalWorkunitServiceImpl implements ICalWorkunitService {
@Resource
private CalWorkunitMapper calWorkunitMapper;
@Resource
private MdWorkunitMapper mdWorkunitMapper;
@Autowired
private IMdWorkunitService mdWorkunitService;
/**
* 查询计划工作单元
*
......@@ -38,7 +41,7 @@ public class CalWorkunitServiceImpl implements ICalWorkunitService {
* @return 计划工作单元
*/
@Override
public CalWorkunit selectCalWorkunitById(Long id) {
public CalWorkunit getObjById(Long id) {
return calWorkunitMapper.selectCalWorkunitById(id);
}
......@@ -162,14 +165,34 @@ public class CalWorkunitServiceImpl implements ICalWorkunitService {
@Override
public List<MdWorkunit> selectUnSelectList(CalWorkunit calWorkunit) {
QueryWrapper<MdWorkunit> qw = new QueryWrapper<>();
qw.eq(StringUtils.isNotEmpty(calWorkunit.getWorkunitCode()), "t1.workunit_code", calWorkunit.getWorkunitCode());
qw.like(StringUtils.isNotEmpty(calWorkunit.getWorkunitName()), "t1.workunit_name", calWorkunit.getWorkunitName());
qw.like(StringUtils.isNotEmpty(calWorkunit.getWorkstationName()), "mws.workstation_name", calWorkunit.getWorkstationName());
qw.like(StringUtils.isNotEmpty(calWorkunit.getWorkshopName()), "mws.workshop_name", calWorkunit.getWorkshopName());
List<MdWorkunit> mdWorkunits = mdWorkunitService.selectListByQw(qw);
Long planId = calWorkunit.getPlanId();
String workunitCode = calWorkunit.getWorkunitCode();
String workunitName = calWorkunit.getWorkunitName();
String workstationName = calWorkunit.getWorkstationName();
String workshopName = calWorkunit.getWorkshopName();
QueryWrapper<CalWorkunit> queryWrapper = new QueryWrapper<>();
queryWrapper.eq(StringUtils.isNotEmpty(planId), "t1.plan_id", planId);
queryWrapper.eq(StringUtils.isNotEmpty(workunitCode), "t2.workunit_code", workunitCode);
queryWrapper.like(StringUtils.isNotEmpty(workunitName), "t2.workunit_name", workunitName);
queryWrapper.like(StringUtils.isNotEmpty(workstationName), "t3.workstation_name", workstationName);
queryWrapper.like(StringUtils.isNotEmpty(workshopName), "t4.workshop_name", workshopName);
queryWrapper.isNotNull("t2.workunit_name");
List<MdWorkunit> calWorkunits = calWorkunitMapper.selectListByQwV2(queryWrapper);
return calWorkunits;
}
@Override
public List<MdWorkunit> getWorkunitByPlanId(CalWorkunit calWorkunit,List<CalWorkunit> calWorkunits) {
String workunitCode = calWorkunit.getWorkunitCode();
String workunitName = calWorkunit.getWorkunitName();
String workstationName = calWorkunit.getWorkstationName();
String workshopName = calWorkunit.getWorkshopName();
List<String> workunitCodes = calWorkunits.stream().map(calWorkunit1 -> calWorkunit1.getWorkunitCode()).collect(Collectors.toList());
List<MdWorkunit> mdWorkunits = calWorkunitMapper.selectMdworkunitList(workunitCode,workunitName,workstationName,workshopName,workunitCodes.size() > 0 ? workunitCodes : null);
return mdWorkunits;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment