Merge remote-tracking branch 'mesnac/master'

master
Leon 3 years ago
commit eae2dfd36a

@ -76,7 +76,8 @@ public class PrintLogServiceImpl extends ServiceImpl<PrintLogMapper, PrintLog> i
* {"msg":"打印成功","code":0}
* {"msg":"打印失败","code":500}
* -printNameisPrint
*/
* */
JSONObject jsonObject = JSONObject.parseObject(post);
Integer code = jsonObject.getInteger("code");
String msg = jsonObject.getString("msg");
@ -89,7 +90,12 @@ public class PrintLogServiceImpl extends ServiceImpl<PrintLogMapper, PrintLog> i
PrintLog printLogOne = new PrintLog();
printLogOne.setHandle(printLog.getHandle());
printLogOne.setIsPrint("true");
printLogOne.setPrintNum(printLog.getPrintNum()+1);
Integer printNum = printLog.getPrintNum();
if (printNum == null){
printLogOne.setPrintNum(1);
}else {
printLogOne.setPrintNum(printNum+1);
}
if (!printLog.getCategory().equals(Constants.PRINT_TYPE_SFC)){
printLogOne.setPrintName(printLog.getPrintName());
}

@ -20,6 +20,24 @@ public class SfcDto extends Sfc {
private String plannedCompDate;
//工作令号
private String workOrder;
private String employeeDescription;
private String lastOperationStatus;
public String getEmployeeDescription() {
return employeeDescription;
}
public void setEmployeeDescription(String employeeDescription) {
this.employeeDescription = employeeDescription;
}
public String getLastOperationStatus() {
return lastOperationStatus;
}
public void setLastOperationStatus(String lastOperationStatus) {
this.lastOperationStatus = lastOperationStatus;
}
public String getAbnormalNo() {
return abnormalNo;

@ -44,6 +44,9 @@
<result column="OPERATION_DESCRIPTION" property="operationDescription" />
<result column="PREPOSITION_OPERATION" property="prepositionOperation" />
<result column="RESRCE" property="resrce" />
<result column="EMPLOYEE_DESCRIPTION" property="employeeDescription" />
<result column="LAST_OPERATION_STATUS" property="lastOperationStatus" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
@ -636,7 +639,7 @@
SELECT IW.DATE_STARTED
FROM SFC S
INNER JOIN SFC_ROUTING SR ON SR.SFC_BO = S.HANDLE
INNER JOIN SFC_ROUTER SRO ON SRO.SFC_ROUTING_BO = SR.HANDLE
INNER JOIN SFC_ROUTER SRO ON SRO.SFC_ROUTING_BO = SR.HANDLE AND SRSRO.IN_USE = 'true'
INNER JOIN SFC_STEP SS ON SS.SFC_ROUTER_BO = SRO.HANDLE
INNER JOIN SFC_IN_WORK IW ON SS.HANDLE = IW.SFC_STEP_BO
INNER JOIN STATUS ST ON ST.HANDLE = S.STATUS_BO AND ST.STATUS ='403'
@ -663,12 +666,20 @@
</select>
<select id="pageByResrce" resultMap="FullResultMap">
SELECT S.SFC,S.QTY,IT.DESCRIPTION ITEM_DESCRIPTION FROM SFC S
SELECT PREZSD.EMPLOYEE_DESCRIPTION,CASE WHEN TO_NUMBER(zsd.DISPATCH_SEQ)=1 THEN NULL
WHEN SS.STEP_SEQUENCE>TO_NUMBER(zsd.DISPATCH_SEQ)-1 THEN '完成'
ELSE '未完成' END LAST_OPERATION_STATUS,
S.SFC,S.QTY,IT.DESCRIPTION ITEM_DESCRIPTION FROM SFC S
LEFT JOIN ITEM_T IT ON S.ITEM_BO=IT.ITEM_BO AND IT.LOCALE=#{locale}
JOIN Z_SFC_DISPATCH zsd ON S.SFC=zsd.SFC AND S.SITE=zsd.SITE
LEFT JOIN Z_SFC_DISPATCH PREZSD ON zsd.SFC=PREZSD.SFC AND PREZSD.DISPATCH_SEQ=TO_NUMBER(zsd.DISPATCH_SEQ)-1
JOIN Z_PROD_READY_TASK zprt ON ZPRT.SFC_DISPATCH_BO=zsd.HANDLE
JOIN SFC S ON S.SFC=ZSD.SFC AND S.SITE=ZSD.SITE
JOIN SFC_ROUTING SR ON SR.SFC_BO=S.HANDLE
JOIN SFC_ROUTER SR2 ON SR.HANDLE =SR2.SFC_ROUTING_BO AND SR2.IN_USE = 'true'
LEFT JOIN SFC_STEP SS ON SR2.HANDLE =SS.SFC_ROUTER_BO AND (SS.QTY_IN_QUEUE>0 or SS.QTY_IN_WORK>0)
WHERE S.SITE=#{ew.entity.site} AND ZSD.RESRCE=#{ew.entity.resrce} AND ZSD.DISPATCH_STATUS!='CANCEL' AND ZSD.DISPATCH_STATUS!='COMPLETE'
AND S.STATUS_BO IN ('StatusBO:'||#{ew.entity.site}||',401','StatusBO:'||#{ew.entity.site}||',402','StatusBO:'||#{ew.entity.site}||',403')
AND S.STATUS_BO IN ('StatusBO:'||#{ew.entity.site}||',401','StatusBO:'||#{ew.entity.site}||',402','StatusBO:'||#{ew.entity.site}||',403','StatusBO:'||#{ew.entity.site}||',404')
AND zprt.STATUS='FINISH' AND ZPRT."RESULT"='OK'
</select>

@ -373,10 +373,10 @@
<!--自定义sql查询用户是否在指定用户组-->
<select id="findUserGroupByUser" resultType="Integer">
SELECT COUNT(*) FROM WIP.Z_NWA_USER ZNU
INNER JOIN WIP.USER_GROUP_MEMBER UGM ON UGM.USER_OR_GROUP_GBO = ZNU.HANDLE
SELECT COUNT(*) FROM WIP.USR U
INNER JOIN WIP.USER_GROUP_MEMBER UGM ON UGM.USER_OR_GROUP_GBO = U.HANDLE
INNER JOIN WIP.USER_GROUP UG ON UG.HANDLE = UGM.USER_GROUP_BO
WHERE ZNU.SITE = #{site} AND ZNU.USER_NAME = #{user}
WHERE U.SITE = #{site} AND U.USER_ID = #{user}
AND UG.USER_GROUP IN
<foreach item="item" index="index" collection="list" open="(" close=")" separator=",">UPPER(#{item})
</foreach>

@ -0,0 +1,141 @@
package com.foreverwin.mesnac.production.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.foreverwin.mesnac.production.model.SfcHoldLog;
import com.foreverwin.mesnac.production.service.SfcHoldLogService;
import com.foreverwin.modular.core.util.FrontPage;
import com.foreverwin.modular.core.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
*
* @author Philip
* @since 2021-08-19
*/
@RestController
@RequestMapping("/Z-SFC-HOLD-LOG")
public class SfcHoldLogController {
@Autowired
public SfcHoldLogService sfcHoldLogService;
/**
*
*
* @return
*/
@ResponseBody
@PostMapping("/sfcHold")
public R sfcHold(@RequestBody Map<String,Object> map){
List<SfcHoldLog> sfcHoldLogList = (List<SfcHoldLog>) map.get("sfcHoldLogList");
ObjectMapper mapper = new ObjectMapper();
sfcHoldLogList = mapper.convertValue(sfcHoldLogList, new TypeReference<List<SfcHoldLog>>() {
});
sfcHoldLogService.sfcHold(sfcHoldLogList);
return R.ok();
}
/**
* id
*
* @param id
* @return
*/
@ResponseBody
@GetMapping("/{id:.+}")
public R getSfcHoldLogById(@PathVariable String id) {
return R.ok( sfcHoldLogService.getById(id));
}
/**
*
*
* @return
*/
@ResponseBody
@GetMapping("")
public R getSfcHoldLogList(SfcHoldLog sfcHoldLog){
List<SfcHoldLog> result;
QueryWrapper<SfcHoldLog> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(sfcHoldLog);
result = sfcHoldLogService.list(queryWrapper);
return R.ok(result);
}
/**
*
*
* @param frontPage
* @return
*/
@ResponseBody
@GetMapping("/page")
public R page(FrontPage<SfcHoldLog> frontPage, SfcHoldLog sfcHoldLog){
IPage result;
QueryWrapper<SfcHoldLog> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(sfcHoldLog);
if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) {
//TODO modify global query
queryWrapper.lambda().and(wrapper -> wrapper
.like(SfcHoldLog::getHandle, frontPage.getGlobalQuery())
.or().like(SfcHoldLog::getSite, frontPage.getGlobalQuery())
.or().like(SfcHoldLog::getSfcDispatchBo, frontPage.getGlobalQuery())
.or().like(SfcHoldLog::getSfc, frontPage.getGlobalQuery())
.or().like(SfcHoldLog::getStepId, frontPage.getGlobalQuery())
.or().like(SfcHoldLog::getOperation, frontPage.getGlobalQuery())
.or().like(SfcHoldLog::getType, frontPage.getGlobalQuery())
.or().like(SfcHoldLog::getCreateUser, frontPage.getGlobalQuery())
);
}
result = sfcHoldLogService.page(frontPage.getPagePlus(), queryWrapper);
return R.ok(result);
}
/**
*
* @param sfcHoldLog
* @return null
*/
@PostMapping
public R save(@RequestBody SfcHoldLog sfcHoldLog) {
return R.ok(sfcHoldLogService.save(sfcHoldLog));
}
/**
*
* @param sfcHoldLog
* @return null
*/
@PutMapping
public R updateById(@RequestBody SfcHoldLog sfcHoldLog) {
return R.ok(sfcHoldLogService.updateById(sfcHoldLog));
}
/**
* id
* @param id ID
* @return 0 1
*/
@ResponseBody
@RequestMapping(method = RequestMethod.DELETE, value = "/{id:.+}")
public R removeById(@PathVariable("id") String id){
return R.ok(sfcHoldLogService.removeById(id));
}
/**
*
* @param ids ID
* @return 0 1
*/
@ResponseBody
@RequestMapping(method = RequestMethod.POST, value = "/delete-batch")
public R removeByIds(List<String> ids){
return R.ok(sfcHoldLogService.removeByIds(ids));
}
}

@ -0,0 +1,18 @@
package com.foreverwin.mesnac.production.mapper;
import com.foreverwin.mesnac.production.model.SfcHoldLog;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* <p>
* Mapper
* </p>
*
* @author Philip
* @since 2021-08-19
*/
@Repository
public interface SfcHoldLogMapper extends BaseMapper<SfcHoldLog> {
}

@ -0,0 +1,201 @@
package com.foreverwin.mesnac.production.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* <p>
*
* </p>
*
* @author Philip
* @since 2021-08-19
*/
@TableName("Z_SFC_HOLD_LOG")
public class SfcHoldLog extends Model<SfcHoldLog> {
private static final long serialVersionUID = 1L;
/**
*
*/
@TableId(value = "HANDLE", type = IdType.INPUT)
private String handle;
/**
*
*/
@TableField("SITE")
private String site;
/**
*
*/
@TableField("SFC_DISPATCH_BO")
private String sfcDispatchBo;
/**
*
*/
@TableField("SFC")
private String sfc;
/**
*
*/
@TableField("STEP_ID")
private String stepId;
/**
*
*/
@TableField("OPERATION")
private String operation;
/**
*
*/
@TableField("HOLD_DURATION")
private BigDecimal holdDuration;
/**
* :
*/
@TableField("TYPE")
private String type;
/**
*
*/
@TableField("CREATE_USER")
private String createUser;
/**
*
*/
@TableField("CREATED_DATE_TIME")
private LocalDateTime createdDateTime;
public String getHandle() {
return handle;
}
public void setHandle(String handle) {
this.handle = handle;
}
public String getSite() {
return site;
}
public void setSite(String site) {
this.site = site;
}
public String getSfcDispatchBo() {
return sfcDispatchBo;
}
public void setSfcDispatchBo(String sfcDispatchBo) {
this.sfcDispatchBo = sfcDispatchBo;
}
public String getSfc() {
return sfc;
}
public void setSfc(String sfc) {
this.sfc = sfc;
}
public String getStepId() {
return stepId;
}
public void setStepId(String stepId) {
this.stepId = stepId;
}
public String getOperation() {
return operation;
}
public void setOperation(String operation) {
this.operation = operation;
}
public BigDecimal getHoldDuration() {
return holdDuration;
}
public void setHoldDuration(BigDecimal holdDuration) {
this.holdDuration = holdDuration;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getCreateUser() {
return createUser;
}
public void setCreateUser(String createUser) {
this.createUser = createUser;
}
public LocalDateTime getCreatedDateTime() {
return createdDateTime;
}
public void setCreatedDateTime(LocalDateTime createdDateTime) {
this.createdDateTime = createdDateTime;
}
public static final String HANDLE = "HANDLE";
public static final String SITE = "SITE";
public static final String SFC_DISPATCH_BO = "SFC_DISPATCH_BO";
public static final String SFC = "SFC";
public static final String STEP_ID = "STEP_ID";
public static final String OPERATION = "OPERATION";
public static final String HOLD_DURATION = "HOLD_DURATION";
public static final String TYPE = "TYPE";
public static final String CREATE_USER = "CREATE_USER";
public static final String CREATED_DATE_TIME = "CREATED_DATE_TIME";
@Override
protected Serializable pkVal() {
return this.handle;
}
@Override
public String toString() {
return "SfcHoldLog{" +
"handle = " + handle +
", site = " + site +
", sfcDispatchBo = " + sfcDispatchBo +
", sfc = " + sfc +
", stepId = " + stepId +
", operation = " + operation +
", holdDuration = " + holdDuration +
", type = " + type +
", createUser = " + createUser +
", createdDateTime = " + createdDateTime +
"}";
}
}

@ -0,0 +1,30 @@
package com.foreverwin.mesnac.production.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.production.model.SfcHoldLog;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.modular.core.util.FrontPage;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author Philip
* @since 2021-08-19
*/
public interface SfcHoldLogService extends IService<SfcHoldLog> {
/**
*
* @param frontPage
* @return
*/
IPage<SfcHoldLog> selectPage(FrontPage<SfcHoldLog> frontPage, SfcHoldLog sfcHoldLog);
List<SfcHoldLog> selectList(SfcHoldLog sfcHoldLog);
void sfcHold(List<SfcHoldLog> sfcHoldLogList);
}

@ -126,14 +126,11 @@ public class PodTemplateServiceImpl implements PodTemplateService {
throw new BaseException("产品条码" + sfc + "不存在");
}
String status = StringUtil.trimHandle(sfcById.getStatusBo());
if (!status.equals("403") && !status.equals("401") && !status.equals("402")) {
if (!status.equals("404")&&!status.equals("403") && !status.equals("401") && !status.equals("402")) {
throw new BaseException("产品条码" + sfc + "不在工作中或排队中");
}
//校验产品条码是否在当前工序排队
Operation operationBySfcBo = commonService.getOperationBySfcBo(sfcById.getHandle());
/* if (StringUtil.notBlank(operation)&&!operationBySfcBo.getOperation().equals(operation)){
throw new BaseException("产品条码"+sfc+"在"+operationBySfcBo.getOperation()+"/"+operationBySfcBo.getDescription()+"工序");
}*/
//校验SFC+工序+设备+STEP_ID是否与当前设备确认的派工单匹配
String sfcDispatchStatus = sfcCrossMapper.getSfcDispatch(site, sfc, operationBySfcBo.getOperation(), operationBySfcBo.getStepId(), resrce);
if (StringUtil.isBlank(sfcDispatchStatus)) {

@ -0,0 +1,127 @@
package com.foreverwin.mesnac.production.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.foreverwin.mesnac.common.dto.SfcDispatchDto;
import com.foreverwin.mesnac.common.enums.HandleEnum;
import com.foreverwin.mesnac.common.service.SfcDispatchCommonService;
import com.foreverwin.mesnac.common.util.ExceptionUtil;
import com.foreverwin.mesnac.meapi.dto.SfcDto;
import com.foreverwin.mesnac.production.mapper.SfcHoldLogMapper;
import com.foreverwin.mesnac.production.mapper.SplitSfcMapper;
import com.foreverwin.mesnac.production.model.SfcHoldLog;
import com.foreverwin.mesnac.production.service.SfcHoldLogService;
import com.foreverwin.modular.core.exception.BaseException;
import com.foreverwin.modular.core.meext.MEServices;
import com.foreverwin.modular.core.util.CommonMethods;
import com.foreverwin.modular.core.util.FrontPage;
import com.sap.me.production.SfcStateServiceInterface;
import com.sap.me.production.UpdateSfcStatusRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.time.Duration;
import java.time.LocalDateTime;
import java.util.List;
import java.util.UUID;
/**
* <p>
*
* </p>
*
* @author Philip
* @since 2021-08-19
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class SfcHoldLogServiceImpl extends ServiceImpl<SfcHoldLogMapper, SfcHoldLog> implements SfcHoldLogService {
@Autowired
private SfcDispatchCommonService sfcDispatchCommonService;
@Autowired
private SfcHoldLogMapper sfcHoldLogMapper;
@Autowired
private SplitSfcMapper splitSfcMapper;
@Override
public IPage<SfcHoldLog> selectPage(FrontPage<SfcHoldLog> frontPage, SfcHoldLog sfcHoldLog) {
QueryWrapper<SfcHoldLog> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(sfcHoldLog);
return super.page(frontPage.getPagePlus(), queryWrapper);
}
@Override
public List<SfcHoldLog> selectList(SfcHoldLog sfcHoldLog) {
QueryWrapper<SfcHoldLog> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(sfcHoldLog);
return super.list(queryWrapper);
}
@Override
public void sfcHold(List<SfcHoldLog> sfcHoldLogList) {
for (SfcHoldLog sfcHoldLog:sfcHoldLogList){
String site = CommonMethods.getSite();
LocalDateTime now = LocalDateTime.now();
String sfc = sfcHoldLog.getSfc();
String type = sfcHoldLog.getType();
String sfcBo = HandleEnum.SFC.getHandle(site, sfc);
SfcDto sfcData = splitSfcMapper.getSfcData(sfcBo);
if (sfcData==null){
throw new BaseException("未找到产品条码信息");
}
if (sfcHoldLog.getType().equals("HOLD")&&!sfcData.getStatus().equals("403")){
throw new BaseException("产品状态不可暂停");
}
if (sfcHoldLog.getType().equals("CANCEL")&&!sfcData.getStatus().equals("404")){
throw new BaseException("产品状态不可取消暂停");
}
String stepId = sfcData.getStepId();
String operation = sfcData.getOperation();
SfcDispatchDto sfcDispatchDto = new SfcDispatchDto();
sfcDispatchDto.setSfc(sfc);
sfcDispatchDto.setStepId(stepId);
sfcDispatchDto.setOperation(operation);
SfcDispatchDto sfcDispatchBySfc = sfcDispatchCommonService.findSfcDispatchBySfc(sfcDispatchDto);
SfcStateServiceInterface sfcStateServiceInterface = null;
BigDecimal holdDuration=null;
try {
sfcStateServiceInterface = MEServices.create("com.sap.me.production", "SfcStateService", CommonMethods.getSite());
UpdateSfcStatusRequest updateSfcStatusRequest = new UpdateSfcStatusRequest();
updateSfcStatusRequest.setSfcRef(sfcBo);
if (type.equals("HOLD")){
updateSfcStatusRequest.setStatusRef(HandleEnum.STATUS.getHandle(site,"404"));
}else {
updateSfcStatusRequest.setStatusRef(HandleEnum.STATUS.getHandle(site,"403"));
//计算保留时长
QueryWrapper<SfcHoldLog> ueryWrapper=new QueryWrapper<>();
ueryWrapper.eq(SfcHoldLog.STEP_ID,stepId);
ueryWrapper.eq(SfcHoldLog.SFC,sfc);
List<SfcHoldLog> list = list(ueryWrapper);
LocalDateTime holdTime = list.get(0).getCreatedDateTime();
long workHourSeconds = Duration.between(holdTime, now).getSeconds();
holdDuration = new BigDecimal(workHourSeconds).divide(BigDecimal.valueOf(3600), 2, RoundingMode.HALF_UP);
}
sfcStateServiceInterface.updateSfcStatus(updateSfcStatusRequest);
} catch (Exception e) {
ExceptionUtil.throwException(e);
}
sfcHoldLog.setHandle(UUID.randomUUID().toString());
sfcHoldLog.setSite(site);
sfcHoldLog.setSfcDispatchBo(sfcDispatchBySfc.getHandle());
sfcHoldLog.setStepId(stepId);
sfcHoldLog.setOperation(operation);
sfcHoldLog.setHoldDuration(holdDuration);
sfcHoldLog.setCreateUser(CommonMethods.getUser());
sfcHoldLog.setCreatedDateTime(now);
save(sfcHoldLog);
}
}
}

@ -0,0 +1,402 @@
<?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.foreverwin.mesnac.production.mapper.SfcHoldLogMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.production.model.SfcHoldLog">
<id column="HANDLE" property="handle" />
<result column="SITE" property="site" />
<result column="SFC_DISPATCH_BO" property="sfcDispatchBo" />
<result column="SFC" property="sfc" />
<result column="STEP_ID" property="stepId" />
<result column="OPERATION" property="operation" />
<result column="HOLD_DURATION" property="holdDuration" />
<result column="TYPE" property="type" />
<result column="CREATE_USER" property="createUser" />
<result column="CREATED_DATE_TIME" property="createdDateTime" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
HANDLE, SITE, SFC_DISPATCH_BO, SFC, STEP_ID, OPERATION, HOLD_DURATION, TYPE, CREATE_USER, CREATED_DATE_TIME
</sql>
<!-- BaseMapper标准查询/修改/删除 -->
<select id="selectById" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM Z_SFC_HOLD_LOG WHERE HANDLE=#{handle}
</select>
<select id="selectByMap" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
FROM Z_SFC_HOLD_LOG
<if test="cm!=null and !cm.isEmpty">
<where>
<foreach collection="cm.keys" item="k" separator="AND">
<if test="cm[k] != null">
${k} = #{cm[${k}]}
</if>
</foreach>
</where>
</if>
</select>
<select id="selectBatchIds" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
FROM Z_SFC_HOLD_LOG WHERE HANDLE IN (
<foreach item="item" index="index" collection="coll" separator=",">#{item}
</foreach>)
</select>
<select id="selectOne" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM Z_SFC_HOLD_LOG
<where>
<if test="ew.entity.handle!=null">
HANDLE=#{ew.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.sfcDispatchBo!=null"> AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.holdDuration!=null"> AND HOLD_DURATION=#{ew.entity.holdDuration}</if>
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
</where>
</select>
<select id="selectCount" resultType="Integer">
SELECT COUNT(1) FROM Z_SFC_HOLD_LOG
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.sfcDispatchBo!=null"> AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.holdDuration!=null"> AND HOLD_DURATION=#{ew.entity.holdDuration}</if>
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectList" resultMap="BaseResultMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_SFC_HOLD_LOG
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.sfcDispatchBo!=null"> AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.holdDuration!=null"> AND HOLD_DURATION=#{ew.entity.holdDuration}</if>
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectMaps" resultType="HashMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_SFC_HOLD_LOG
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.sfcDispatchBo!=null"> AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.holdDuration!=null"> AND HOLD_DURATION=#{ew.entity.holdDuration}</if>
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectObjs" resultType="Object">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_SFC_HOLD_LOG
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.sfcDispatchBo!=null"> AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.holdDuration!=null"> AND HOLD_DURATION=#{ew.entity.holdDuration}</if>
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectPage" resultMap="BaseResultMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_SFC_HOLD_LOG
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.sfcDispatchBo!=null"> AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.holdDuration!=null"> AND HOLD_DURATION=#{ew.entity.holdDuration}</if>
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectMapsPage" resultType="HashMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_SFC_HOLD_LOG
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.sfcDispatchBo!=null"> AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.holdDuration!=null"> AND HOLD_DURATION=#{ew.entity.holdDuration}</if>
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<insert id="insert" parameterType="com.foreverwin.mesnac.production.model.SfcHoldLog">
INSERT INTO Z_SFC_HOLD_LOG
<trim prefix="(" suffix=")" suffixOverrides=",">
HANDLE,
<if test="site!=null">SITE,</if>
<if test="sfcDispatchBo!=null">SFC_DISPATCH_BO,</if>
<if test="sfc!=null">SFC,</if>
<if test="stepId!=null">STEP_ID,</if>
<if test="operation!=null">OPERATION,</if>
<if test="holdDuration!=null">HOLD_DURATION,</if>
<if test="type!=null">TYPE,</if>
<if test="createUser!=null">CREATE_USER,</if>
<if test="createdDateTime!=null">CREATED_DATE_TIME,</if>
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
<if test="site!=null">#{site},</if>
<if test="sfcDispatchBo!=null">#{sfcDispatchBo},</if>
<if test="sfc!=null">#{sfc},</if>
<if test="stepId!=null">#{stepId},</if>
<if test="operation!=null">#{operation},</if>
<if test="holdDuration!=null">#{holdDuration},</if>
<if test="type!=null">#{type},</if>
<if test="createUser!=null">#{createUser},</if>
<if test="createdDateTime!=null">#{createdDateTime},</if>
</trim>
</insert>
<insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.production.model.SfcHoldLog">
INSERT INTO Z_SFC_HOLD_LOG
<trim prefix="(" suffix=")" suffixOverrides=",">
<include refid="Base_Column_List"></include>
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
#{site},
#{sfcDispatchBo},
#{sfc},
#{stepId},
#{operation},
#{holdDuration},
#{type},
#{createUser},
#{createdDateTime},
</trim>
</insert>
<update id="updateById">
UPDATE Z_SFC_HOLD_LOG <trim prefix="SET" suffixOverrides=",">
<if test="et.site!=null">SITE=#{et.site},</if>
<if test="et.sfcDispatchBo!=null">SFC_DISPATCH_BO=#{et.sfcDispatchBo},</if>
<if test="et.sfc!=null">SFC=#{et.sfc},</if>
<if test="et.stepId!=null">STEP_ID=#{et.stepId},</if>
<if test="et.operation!=null">OPERATION=#{et.operation},</if>
<if test="et.holdDuration!=null">HOLD_DURATION=#{et.holdDuration},</if>
<if test="et.type!=null">TYPE=#{et.type},</if>
<if test="et.createUser!=null">CREATE_USER=#{et.createUser},</if>
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
</update>
<update id="updateAllColumnById">
UPDATE Z_SFC_HOLD_LOG <trim prefix="SET" suffixOverrides=",">
SITE=#{et.site},
SFC_DISPATCH_BO=#{et.sfcDispatchBo},
SFC=#{et.sfc},
STEP_ID=#{et.stepId},
OPERATION=#{et.operation},
HOLD_DURATION=#{et.holdDuration},
TYPE=#{et.type},
CREATE_USER=#{et.createUser},
CREATED_DATE_TIME=#{et.createdDateTime},
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
</update>
<update id="update">
UPDATE Z_SFC_HOLD_LOG <trim prefix="SET" suffixOverrides=",">
<if test="et.site!=null">SITE=#{et.site},</if>
<if test="et.sfcDispatchBo!=null">SFC_DISPATCH_BO=#{et.sfcDispatchBo},</if>
<if test="et.sfc!=null">SFC=#{et.sfc},</if>
<if test="et.stepId!=null">STEP_ID=#{et.stepId},</if>
<if test="et.operation!=null">OPERATION=#{et.operation},</if>
<if test="et.holdDuration!=null">HOLD_DURATION=#{et.holdDuration},</if>
<if test="et.type!=null">TYPE=#{et.type},</if>
<if test="et.createUser!=null">CREATE_USER=#{et.createUser},</if>
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
</trim>
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
HANDLE=#{ew.entity.handle}
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.sfcDispatchBo!=null"> AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.holdDuration!=null"> AND HOLD_DURATION=#{ew.entity.holdDuration}</if>
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</update>
<delete id="deleteById">
DELETE FROM Z_SFC_HOLD_LOG WHERE HANDLE=#{handle}
</delete>
<delete id="deleteByMap">
DELETE FROM Z_SFC_HOLD_LOG
<if test="cm!=null and !cm.isEmpty">
<where>
<foreach collection="cm.keys" item="k" separator="AND">
<if test="cm[k] != null">
${k} = #{cm[${k}]}
</if>
</foreach>
</where>
</if>
</delete>
<delete id="delete">
DELETE FROM Z_SFC_HOLD_LOG
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.sfcDispatchBo!=null"> AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.holdDuration!=null"> AND HOLD_DURATION=#{ew.entity.holdDuration}</if>
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</delete>
<delete id="deleteBatchIds">
DELETE FROM Z_SFC_HOLD_LOG WHERE HANDLE IN (
<foreach item="item" index="index" collection="coll" separator=",">#{item}
</foreach>)
</delete>
<!-- BaseMapper标准查询/修改/删除 -->
</mapper>

@ -18,7 +18,7 @@ import java.util.Map;
/**
*
* @author Philip
* @since 2021-06-17
* @since 2021-08-20
*/
@RestController
@RequestMapping("/Z-SELF-REPORT")
@ -99,6 +99,8 @@ public class SelfReportController {
.or().like(SelfReport::getRemark, frontPage.getGlobalQuery())
.or().like(SelfReport::getCreateUser, frontPage.getGlobalQuery())
.or().like(SelfReport::getModifyUser, frontPage.getGlobalQuery())
.or().like(SelfReport::getNcCodeDesc, frontPage.getGlobalQuery())
.or().like(SelfReport::getReportUserGroup, frontPage.getGlobalQuery())
);
}
result = selfReportService.page(frontPage.getPagePlus(), queryWrapper);

@ -1,8 +1,8 @@
package com.foreverwin.mesnac.quality.mapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.foreverwin.mesnac.quality.model.SelfReport;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.foreverwin.mesnac.quality.model.SelfReport;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
@ -15,10 +15,10 @@ import java.util.List;
* </p>
*
* @author Philip
* @since 2021-06-17
* @since 2021-08-20
*/
@Repository
public interface SelfReportMapper extends BaseMapper<SelfReport> {
List<SelfReport> selectListByCondition(@Param("ew") QueryWrapper<SelfReport> ew, @Param("locale") String locale,@Param("startTime") LocalDate startTime,@Param("endTime") LocalDate endTime);
List<SelfReport> selectListByCondition(@Param("ew") QueryWrapper<SelfReport> ew, @Param("locale") String locale, @Param("startTime") LocalDate startTime, @Param("endTime") LocalDate endTime);
}

@ -17,7 +17,7 @@ import java.time.LocalDateTime;
* </p>
*
* @author Philip
* @since 2021-08-16
* @since 2021-08-20
*/
@TableName("Z_SELF_REPORT")
@ -121,6 +121,11 @@ public class SelfReport extends Model<SelfReport> {
*/
@TableField("NC_CODE_DESC")
private String ncCodeDesc;
/**
*
*/
@TableField("REPORT_USER_GROUP")
private String reportUserGroup;
/**
*
@ -140,29 +145,7 @@ public class SelfReport extends Model<SelfReport> {
@TableField(exist = false)
private String description;
public LocalDate getStartTime() {
return startTime;
}
public void setStartTime(LocalDate startTime) {
this.startTime = startTime;
}
public LocalDate getEndTime() {
return endTime;
}
public void setEndTime(LocalDate endTime) {
this.endTime = endTime;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getHandle() {
return handle;
@ -316,7 +299,39 @@ public class SelfReport extends Model<SelfReport> {
this.ncCodeDesc = ncCodeDesc;
}
public static final String HANDLE = "HANDLE";
public String getReportUserGroup() {
return reportUserGroup;
}
public void setReportUserGroup(String reportUserGroup) {
this.reportUserGroup = reportUserGroup;
}
public LocalDate getStartTime() {
return startTime;
}
public void setStartTime(LocalDate startTime) {
this.startTime = startTime;
}
public LocalDate getEndTime() {
return endTime;
}
public void setEndTime(LocalDate endTime) {
this.endTime = endTime;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public static final String HANDLE = "HANDLE";
public static final String SITE = "SITE";
@ -354,6 +369,8 @@ public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME";
public static final String NC_CODE_DESC = "NC_CODE_DESC";
public static final String REPORT_USER_GROUP = "REPORT_USER_GROUP";
@Override
protected Serializable pkVal() {
@ -382,6 +399,7 @@ public static final String NC_CODE_DESC = "NC_CODE_DESC";
", modifyUser = " + modifyUser +
", modifiedDateTime = " + modifiedDateTime +
", ncCodeDesc = " + ncCodeDesc +
", reportUserGroup = " + reportUserGroup +
"}";
}
}

@ -2,8 +2,8 @@ package com.foreverwin.mesnac.quality.service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.quality.model.SelfReport;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.mesnac.quality.model.SelfReport;
import com.foreverwin.modular.core.util.FrontPage;
import java.time.LocalDate;
@ -16,7 +16,7 @@ import java.util.Map;
* </p>
*
* @author Philip
* @since 2021-06-17
* @since 2021-08-20
*/
public interface SelfReportService extends IService<SelfReport> {

@ -36,13 +36,14 @@ import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* <p>
*
* </p>
*
* @author Philip
* @since 2021-06-17
* @since 2021-08-20
*/
@Service
@Transactional(rollbackFor = Exception.class)
@ -60,7 +61,6 @@ public class SelfReportServiceImpl extends ServiceImpl<SelfReportMapper, SelfRep
@Autowired
private NcCodeService ncCodeService;
@Override
public IPage<SelfReport> selectPage(FrontPage<SelfReport> frontPage, SelfReport selfReport) {
QueryWrapper<SelfReport> queryWrapper = new QueryWrapper<>();
@ -175,6 +175,7 @@ public class SelfReportServiceImpl extends ServiceImpl<SelfReportMapper, SelfRep
selfReport.setCreatedDateTime(LocalDateTime.now());
selfReport.setModifyUser(user);
selfReport.setModifiedDateTime(LocalDateTime.now());
selfReport.setReportUserGroup(userGroup);
save(selfReport);
}
}
@ -191,4 +192,6 @@ public class SelfReportServiceImpl extends ServiceImpl<SelfReportMapper, SelfRep
return updateById(selfReport);
}
}

@ -23,11 +23,12 @@
<result column="MODIFY_USER" property="modifyUser" />
<result column="MODIFIED_DATE_TIME" property="modifiedDateTime" />
<result column="NC_CODE_DESC" property="ncCodeDesc" />
<result column="REPORT_USER_GROUP" property="reportUserGroup" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
HANDLE, SITE, TASK_NO, WORK_CENTER, SHOP_ORDER, ITEM, OP_STEP, RESRCE, SFC, NC_CODE, NC_QTY, LOCATION, STATE, REMARK, CREATE_USER, CREATED_DATE_TIME, MODIFY_USER, MODIFIED_DATE_TIME, NC_CODE_DESC
HANDLE, SITE, TASK_NO, WORK_CENTER, SHOP_ORDER, ITEM, OP_STEP, RESRCE, SFC, NC_CODE, NC_QTY, LOCATION, STATE, REMARK, CREATE_USER, CREATED_DATE_TIME, MODIFY_USER, MODIFIED_DATE_TIME, NC_CODE_DESC, REPORT_USER_GROUP
</sql>
<!-- BaseMapper标准查询/修改/删除 -->
@ -80,6 +81,7 @@
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.ncCodeDesc!=null"> AND NC_CODE_DESC=#{ew.entity.ncCodeDesc}</if>
<if test="ew.entity.reportUserGroup!=null"> AND REPORT_USER_GROUP=#{ew.entity.reportUserGroup}</if>
</where>
</select>
@ -109,6 +111,7 @@
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.ncCodeDesc!=null"> AND NC_CODE_DESC=#{ew.entity.ncCodeDesc}</if>
<if test="ew.entity.reportUserGroup!=null"> AND REPORT_USER_GROUP=#{ew.entity.reportUserGroup}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
@ -146,6 +149,7 @@
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.ncCodeDesc!=null"> AND NC_CODE_DESC=#{ew.entity.ncCodeDesc}</if>
<if test="ew.entity.reportUserGroup!=null"> AND REPORT_USER_GROUP=#{ew.entity.reportUserGroup}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
@ -183,6 +187,7 @@
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.ncCodeDesc!=null"> AND NC_CODE_DESC=#{ew.entity.ncCodeDesc}</if>
<if test="ew.entity.reportUserGroup!=null"> AND REPORT_USER_GROUP=#{ew.entity.reportUserGroup}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
@ -220,6 +225,7 @@
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.ncCodeDesc!=null"> AND NC_CODE_DESC=#{ew.entity.ncCodeDesc}</if>
<if test="ew.entity.reportUserGroup!=null"> AND REPORT_USER_GROUP=#{ew.entity.reportUserGroup}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
@ -257,6 +263,7 @@
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.ncCodeDesc!=null"> AND NC_CODE_DESC=#{ew.entity.ncCodeDesc}</if>
<if test="ew.entity.reportUserGroup!=null"> AND REPORT_USER_GROUP=#{ew.entity.reportUserGroup}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
@ -294,6 +301,7 @@
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.ncCodeDesc!=null"> AND NC_CODE_DESC=#{ew.entity.ncCodeDesc}</if>
<if test="ew.entity.reportUserGroup!=null"> AND REPORT_USER_GROUP=#{ew.entity.reportUserGroup}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
@ -327,6 +335,7 @@
<if test="modifyUser!=null">MODIFY_USER,</if>
<if test="modifiedDateTime!=null">MODIFIED_DATE_TIME,</if>
<if test="ncCodeDesc!=null">NC_CODE_DESC,</if>
<if test="reportUserGroup!=null">REPORT_USER_GROUP,</if>
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
@ -348,6 +357,7 @@
<if test="modifyUser!=null">#{modifyUser},</if>
<if test="modifiedDateTime!=null">#{modifiedDateTime},</if>
<if test="ncCodeDesc!=null">#{ncCodeDesc},</if>
<if test="reportUserGroup!=null">#{reportUserGroup},</if>
</trim>
</insert>
@ -376,6 +386,7 @@
#{modifyUser},
#{modifiedDateTime},
#{ncCodeDesc},
#{reportUserGroup},
</trim>
</insert>
@ -400,6 +411,7 @@
<if test="et.modifyUser!=null">MODIFY_USER=#{et.modifyUser},</if>
<if test="et.modifiedDateTime!=null">MODIFIED_DATE_TIME=#{et.modifiedDateTime},</if>
<if test="et.ncCodeDesc!=null">NC_CODE_DESC=#{et.ncCodeDesc},</if>
<if test="et.reportUserGroup!=null">REPORT_USER_GROUP=#{et.reportUserGroup},</if>
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
</update>
@ -424,6 +436,7 @@
MODIFY_USER=#{et.modifyUser},
MODIFIED_DATE_TIME=#{et.modifiedDateTime},
NC_CODE_DESC=#{et.ncCodeDesc},
REPORT_USER_GROUP=#{et.reportUserGroup},
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
</update>
@ -448,6 +461,7 @@
<if test="et.modifyUser!=null">MODIFY_USER=#{et.modifyUser},</if>
<if test="et.modifiedDateTime!=null">MODIFIED_DATE_TIME=#{et.modifiedDateTime},</if>
<if test="et.ncCodeDesc!=null">NC_CODE_DESC=#{et.ncCodeDesc},</if>
<if test="et.reportUserGroup!=null">REPORT_USER_GROUP=#{et.reportUserGroup},</if>
</trim>
<where>
<if test="ew!=null">
@ -471,6 +485,7 @@
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.ncCodeDesc!=null"> AND NC_CODE_DESC=#{ew.entity.ncCodeDesc}</if>
<if test="ew.entity.reportUserGroup!=null"> AND REPORT_USER_GROUP=#{ew.entity.reportUserGroup}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
@ -525,6 +540,7 @@
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.ncCodeDesc!=null"> AND NC_CODE_DESC=#{ew.entity.ncCodeDesc}</if>
<if test="ew.entity.reportUserGroup!=null"> AND REPORT_USER_GROUP=#{ew.entity.reportUserGroup}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}

Loading…
Cancel
Save