Leon 4 years ago
commit e0fd7a8dcb

@ -10,6 +10,7 @@ import com.foreverwin.mesnac.anomaly.service.FileUploadedService;
import com.foreverwin.mesnac.common.dto.SfcDispatchDto;
import com.foreverwin.mesnac.common.service.AnomalyService;
import com.foreverwin.mesnac.common.service.SfcDispatchCommonService;
import com.foreverwin.modular.core.util.CommonMethods;
import com.foreverwin.modular.core.util.FrontPage;
import com.foreverwin.modular.core.util.R;
import org.springframework.beans.factory.annotation.Autowired;
@ -79,6 +80,8 @@ public class AbnormalBillController {
public R page(FrontPage<AbnormalBill> frontPage, AbnormalBill abnormalBill){
IPage result;
QueryWrapper<AbnormalBill> queryWrapper = new QueryWrapper<>();
String site = CommonMethods.getSite();
abnormalBill.setSite(site);
queryWrapper.setEntity(abnormalBill);
if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) {
//TODO modify global query

@ -0,0 +1,175 @@
package com.foreverwin.mesnac.anomaly.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.anomaly.model.AbnormalBill;
import com.foreverwin.mesnac.anomaly.model.AbnormalBillDispose;
import com.foreverwin.mesnac.anomaly.model.AbnormalBillLog;
import com.foreverwin.mesnac.anomaly.service.AbnormalBillLogService;
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;
/**
*
* @author
* @since 2021-07-16
*/
@RestController
@RequestMapping("/Z-ABNORMAL-BILL-LOG")
public class AbnormalBillLogController {
@Autowired
public AbnormalBillLogService abnormalBillLogService;
/**
* id
*
* @param id
* @return
*/
@ResponseBody
@GetMapping("/{id:.+}")
public R getAbnormalBillLogById(@PathVariable String id) {
return R.ok( abnormalBillLogService.getById(id));
}
/**
*
*
* @return
*/
@ResponseBody
@GetMapping("")
public R getAbnormalBillLogList(AbnormalBillLog abnormalBillLog){
List<AbnormalBillLog> result;
QueryWrapper<AbnormalBillLog> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(abnormalBillLog);
result = abnormalBillLogService.list(queryWrapper);
return R.ok(result);
}
/**
*
*
* @param frontPage
* @return
*/
@ResponseBody
@GetMapping("/page")
public R page(FrontPage<AbnormalBillLog> frontPage, AbnormalBillLog abnormalBillLog){
IPage result;
QueryWrapper<AbnormalBillLog> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(abnormalBillLog);
if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) {
//TODO modify global query
queryWrapper.lambda().and(wrapper -> wrapper
.like(AbnormalBillLog::getHandle, frontPage.getGlobalQuery())
.or().like(AbnormalBillLog::getSite, frontPage.getGlobalQuery())
.or().like(AbnormalBillLog::getAbnormalNo, frontPage.getGlobalQuery())
.or().like(AbnormalBillLog::getStatus, frontPage.getGlobalQuery())
.or().like(AbnormalBillLog::getType, frontPage.getGlobalQuery())
.or().like(AbnormalBillLog::getItemBo, frontPage.getGlobalQuery())
.or().like(AbnormalBillLog::getSfc, frontPage.getGlobalQuery())
.or().like(AbnormalBillLog::getOperation, frontPage.getGlobalQuery())
.or().like(AbnormalBillLog::getWorkCenter, frontPage.getGlobalQuery())
.or().like(AbnormalBillLog::getShopOrder, frontPage.getGlobalQuery())
.or().like(AbnormalBillLog::getMessageType, frontPage.getGlobalQuery())
.or().like(AbnormalBillLog::getResrce, frontPage.getGlobalQuery())
.or().like(AbnormalBillLog::getNcCode, frontPage.getGlobalQuery())
.or().like(AbnormalBillLog::getNcCodeGroup, frontPage.getGlobalQuery())
.or().like(AbnormalBillLog::getShutDown, frontPage.getGlobalQuery())
.or().like(AbnormalBillLog::getResponseUser, frontPage.getGlobalQuery())
.or().like(AbnormalBillLog::getPbDescription, frontPage.getGlobalQuery())
.or().like(AbnormalBillLog::getNcQty, frontPage.getGlobalQuery())
.or().like(AbnormalBillLog::getPbGrade, frontPage.getGlobalQuery())
.or().like(AbnormalBillLog::getPbUser, frontPage.getGlobalQuery())
.or().like(AbnormalBillLog::getPbQty, frontPage.getGlobalQuery())
.or().like(AbnormalBillLog::getDiscover, frontPage.getGlobalQuery())
.or().like(AbnormalBillLog::getInspector, frontPage.getGlobalQuery())
.or().like(AbnormalBillLog::getEntityLocation, frontPage.getGlobalQuery())
.or().like(AbnormalBillLog::getReportFrom, frontPage.getGlobalQuery())
.or().like(AbnormalBillLog::getObjectBo, frontPage.getGlobalQuery())
.or().like(AbnormalBillLog::getPbPhotoshop, frontPage.getGlobalQuery())
.or().like(AbnormalBillLog::getCancelCode, frontPage.getGlobalQuery())
.or().like(AbnormalBillLog::getCancelReason, frontPage.getGlobalQuery())
.or().like(AbnormalBillLog::getCancelUser, frontPage.getGlobalQuery())
.or().like(AbnormalBillLog::getDutyUser, frontPage.getGlobalQuery())
.or().like(AbnormalBillLog::getDutyDepart, frontPage.getGlobalQuery())
.or().like(AbnormalBillLog::getPrincipalUser, frontPage.getGlobalQuery())
.or().like(AbnormalBillLog::getDutyCauseDescription, frontPage.getGlobalQuery())
.or().like(AbnormalBillLog::getDutyCauseType, frontPage.getGlobalQuery())
.or().like(AbnormalBillLog::getDutyType, frontPage.getGlobalQuery())
.or().like(AbnormalBillLog::getDutySendUserGroup, frontPage.getGlobalQuery())
.or().like(AbnormalBillLog::getResolveUser, frontPage.getGlobalQuery())
.or().like(AbnormalBillLog::getAbnormalMethod, frontPage.getGlobalQuery())
.or().like(AbnormalBillLog::getRouterBo, frontPage.getGlobalQuery())
.or().like(AbnormalBillLog::getResolveShopOrder, frontPage.getGlobalQuery())
.or().like(AbnormalBillLog::getResolveRemark, frontPage.getGlobalQuery())
.or().like(AbnormalBillLog::getResolveSendUser, frontPage.getGlobalQuery())
.or().like(AbnormalBillLog::getClosedUser, frontPage.getGlobalQuery())
.or().like(AbnormalBillLog::getAbnormalReason, frontPage.getGlobalQuery())
.or().like(AbnormalBillLog::getBeforeMeasure, frontPage.getGlobalQuery())
.or().like(AbnormalBillLog::getCreatedUser, frontPage.getGlobalQuery())
.or().like(AbnormalBillLog::getModifiedUser, frontPage.getGlobalQuery())
);
}
result = abnormalBillLogService.page(frontPage.getPagePlus(), queryWrapper);
return R.ok(result);
}
/**
*
* @param abnormalBillLog
* @return null
*/
@PostMapping
public R save(@RequestBody AbnormalBillLog abnormalBillLog) {
return R.ok(abnormalBillLogService.save(abnormalBillLog));
}
/**
*
* @param abnormalBillLog
* @return null
*/
@PutMapping
public R updateById(@RequestBody AbnormalBillLog abnormalBillLog) {
return R.ok(abnormalBillLogService.updateById(abnormalBillLog));
}
/**
* id
* @param id ID
* @return 0 1
*/
@ResponseBody
@RequestMapping(method = RequestMethod.DELETE, value = "/{id:.+}")
public R removeById(@PathVariable("id") String id){
return R.ok(abnormalBillLogService.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(abnormalBillLogService.removeByIds(ids));
}
@GetMapping("saveAndUpdate")
public R saveAndUpdate(AbnormalBill abnormalBill,
AbnormalBillDispose abnormalBillDispose,
@RequestParam List<String> ncGroupAndNcCodes,
@RequestParam List<String> dutyCauseType,
@RequestParam List<String> dutyType){
abnormalBillLogService.saveAndUpdate(abnormalBill,abnormalBillDispose,ncGroupAndNcCodes,dutyCauseType,dutyType);
return R.ok();
}
}

@ -19,6 +19,11 @@ public class AbnormalBillDisposeDto extends AbnormalBillDispose {
*/
private String status;
/**
*
*/
private String itemBo;
/**
*
*/
@ -412,4 +417,12 @@ public class AbnormalBillDisposeDto extends AbnormalBillDispose {
public void setOperation(String operation) {
this.operation = operation;
}
public String getItemBo() {
return itemBo;
}
public void setItemBo(String itemBo) {
this.itemBo = itemBo;
}
}

@ -0,0 +1,22 @@
package com.foreverwin.mesnac.anomaly.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.foreverwin.mesnac.anomaly.model.AbnormalBill;
import com.foreverwin.mesnac.anomaly.model.AbnormalBillLog;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
/**
* <p>
* Mapper
* </p>
*
* @author
* @since 2021-07-16
*/
@Repository
public interface AbnormalBillLogMapper extends BaseMapper<AbnormalBillLog> {
AbnormalBillLog findAllByAbnormalNo(@Param("abnormalBill") AbnormalBill abnormalBill);
}

@ -0,0 +1,936 @@
package com.foreverwin.mesnac.anomaly.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.time.LocalDateTime;
/**
* <p>
*
* </p>
*
* @author
* @since 2021-07-16
*/
@TableName("Z_ABNORMAL_BILL_LOG")
public class AbnormalBillLog extends Model<AbnormalBillLog> {
private static final long serialVersionUID = 1L;
/**
*
*/
@TableId(value = "HANDLE", type = IdType.INPUT)
private String handle;
/**
*
*/
@TableField("SITE")
private String site;
/**
*
*/
@TableField("ABNORMAL_NO")
private String abnormalNo;
/**
*
*/
@TableField("STATUS")
private String status;
/**
*
*/
@TableField("TYPE")
private String type;
/**
* BO
*/
@TableField("ITEM_BO")
private String itemBo;
/**
* SFC
*/
@TableField("SFC")
private String sfc;
/**
*
*/
@TableField("OPERATION")
private String operation;
/**
*
*/
@TableField("WORK_CENTER")
private String workCenter;
/**
*
*/
@TableField("SHOP_ORDER")
private String shopOrder;
/**
*
*/
@TableField("MESSAGE_TYPE")
private String messageType;
/**
*
*/
@TableField("RESRCE")
private String resrce;
/**
*
*/
@TableField("NC_CODE")
private String ncCode;
/**
*
*/
@TableField("NC_CODE_GROUP")
private String ncCodeGroup;
/**
*
*/
@TableField("SHUT_DOWN")
private String shutDown;
/**
*
*/
@TableField("RESPONSE_USER")
private String responseUser;
/**
*
*/
@TableField("RESPONSE_DATE_TIME")
private LocalDateTime responseDateTime;
/**
*
*/
@TableField("PB_DESCRIPTION")
private String pbDescription;
/**
*
*/
@TableField("NC_QTY")
private String ncQty;
/**
*
*/
@TableField("PB_GRADE")
private String pbGrade;
/**
*
*/
@TableField("PB_USER")
private String pbUser;
/**
*
*/
@TableField("PB_QTY")
private String pbQty;
/**
*
*/
@TableField("REPAIR_DATE_TIME")
private LocalDateTime repairDateTime;
/**
*
*/
@TableField("DISCOVER")
private String discover;
/**
*
*/
@TableField("INSPECTOR")
private String inspector;
/**
*
*/
@TableField("ENTITY_LOCATION")
private String entityLocation;
/**
*
*/
@TableField("REPORT_FROM")
private String reportFrom;
/**
*
*/
@TableField("OBJECT_BO")
private String objectBo;
/**
*
*/
@TableField("PB_PHOTOSHOP")
private String pbPhotoshop;
/**
*
*/
@TableField("CANCEL_CODE")
private String cancelCode;
/**
*
*/
@TableField("CANCEL_REASON")
private String cancelReason;
/**
*
*/
@TableField("CANCEL_DATE_TIME")
private LocalDateTime cancelDateTime;
/**
*
*/
@TableField("CANCEL_USER")
private String cancelUser;
/**
*
*/
@TableField("DUTY_USER")
private String dutyUser;
/**
*
*/
@TableField("DUTY_DATE_TIME")
private LocalDateTime dutyDateTime;
/**
*
*/
@TableField("DUTY_DEPART")
private String dutyDepart;
/**
*
*/
@TableField("PRINCIPAL_USER")
private String principalUser;
/**
*
*/
@TableField("DUTY_CAUSE_DESCRIPTION")
private String dutyCauseDescription;
/**
*
*/
@TableField("DUTY_CAUSE_TYPE")
private String dutyCauseType;
/**
*
*/
@TableField("DUTY_TYPE")
private String dutyType;
/**
*
*/
@TableField("DUTY_SEND_USER_GROUP")
private String dutySendUserGroup;
/**
*
*/
@TableField("RESOLVE_USER")
private String resolveUser;
/**
*
*/
@TableField("RESOLVE_DATE_TIME")
private LocalDateTime resolveDateTime;
/**
*
*/
@TableField("ABNORMAL_METHOD")
private String abnormalMethod;
/**
*
*/
@TableField("ROUTER_BO")
private String routerBo;
/**
*
*/
@TableField("RESOLVE_SHOP_ORDER")
private String resolveShopOrder;
/**
*
*/
@TableField("RESOLVE_REMARK")
private String resolveRemark;
/**
*
*/
@TableField("RESOLVE_SEND_USER")
private String resolveSendUser;
/**
*
*/
@TableField("CLOSED_USER")
private String closedUser;
/**
*
*/
@TableField("CLOSED_DATE_TIME")
private LocalDateTime closedDateTime;
/**
*
*/
@TableField("ABNORMAL_REASON")
private String abnormalReason;
/**
*
*/
@TableField("BEFORE_MEASURE")
private String beforeMeasure;
/**
*
*/
@TableField("CREATED_USER")
private String createdUser;
/**
*
*/
@TableField("CREATED_DATA_TIME")
private LocalDateTime createdDataTime;
/**
*
*/
@TableField("MODIFIED_USER")
private String modifiedUser;
/**
*
*/
@TableField("MODIFIED_DATE_TIME")
private LocalDateTime modifiedDateTime;
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 getAbnormalNo() {
return abnormalNo;
}
public void setAbnormalNo(String abnormalNo) {
this.abnormalNo = abnormalNo;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getItemBo() {
return itemBo;
}
public void setItemBo(String itemBo) {
this.itemBo = itemBo;
}
public String getSfc() {
return sfc;
}
public void setSfc(String sfc) {
this.sfc = sfc;
}
public String getOperation() {
return operation;
}
public void setOperation(String operation) {
this.operation = operation;
}
public String getWorkCenter() {
return workCenter;
}
public void setWorkCenter(String workCenter) {
this.workCenter = workCenter;
}
public String getShopOrder() {
return shopOrder;
}
public void setShopOrder(String shopOrder) {
this.shopOrder = shopOrder;
}
public String getMessageType() {
return messageType;
}
public void setMessageType(String messageType) {
this.messageType = messageType;
}
public String getResrce() {
return resrce;
}
public void setResrce(String resrce) {
this.resrce = resrce;
}
public String getNcCode() {
return ncCode;
}
public void setNcCode(String ncCode) {
this.ncCode = ncCode;
}
public String getNcCodeGroup() {
return ncCodeGroup;
}
public void setNcCodeGroup(String ncCodeGroup) {
this.ncCodeGroup = ncCodeGroup;
}
public String getShutDown() {
return shutDown;
}
public void setShutDown(String shutDown) {
this.shutDown = shutDown;
}
public String getResponseUser() {
return responseUser;
}
public void setResponseUser(String responseUser) {
this.responseUser = responseUser;
}
public LocalDateTime getResponseDateTime() {
return responseDateTime;
}
public void setResponseDateTime(LocalDateTime responseDateTime) {
this.responseDateTime = responseDateTime;
}
public String getPbDescription() {
return pbDescription;
}
public void setPbDescription(String pbDescription) {
this.pbDescription = pbDescription;
}
public String getNcQty() {
return ncQty;
}
public void setNcQty(String ncQty) {
this.ncQty = ncQty;
}
public String getPbGrade() {
return pbGrade;
}
public void setPbGrade(String pbGrade) {
this.pbGrade = pbGrade;
}
public String getPbUser() {
return pbUser;
}
public void setPbUser(String pbUser) {
this.pbUser = pbUser;
}
public String getPbQty() {
return pbQty;
}
public void setPbQty(String pbQty) {
this.pbQty = pbQty;
}
public LocalDateTime getRepairDateTime() {
return repairDateTime;
}
public void setRepairDateTime(LocalDateTime repairDateTime) {
this.repairDateTime = repairDateTime;
}
public String getDiscover() {
return discover;
}
public void setDiscover(String discover) {
this.discover = discover;
}
public String getInspector() {
return inspector;
}
public void setInspector(String inspector) {
this.inspector = inspector;
}
public String getEntityLocation() {
return entityLocation;
}
public void setEntityLocation(String entityLocation) {
this.entityLocation = entityLocation;
}
public String getReportFrom() {
return reportFrom;
}
public void setReportFrom(String reportFrom) {
this.reportFrom = reportFrom;
}
public String getObjectBo() {
return objectBo;
}
public void setObjectBo(String objectBo) {
this.objectBo = objectBo;
}
public String getPbPhotoshop() {
return pbPhotoshop;
}
public void setPbPhotoshop(String pbPhotoshop) {
this.pbPhotoshop = pbPhotoshop;
}
public String getCancelCode() {
return cancelCode;
}
public void setCancelCode(String cancelCode) {
this.cancelCode = cancelCode;
}
public String getCancelReason() {
return cancelReason;
}
public void setCancelReason(String cancelReason) {
this.cancelReason = cancelReason;
}
public LocalDateTime getCancelDateTime() {
return cancelDateTime;
}
public void setCancelDateTime(LocalDateTime cancelDateTime) {
this.cancelDateTime = cancelDateTime;
}
public String getCancelUser() {
return cancelUser;
}
public void setCancelUser(String cancelUser) {
this.cancelUser = cancelUser;
}
public String getDutyUser() {
return dutyUser;
}
public void setDutyUser(String dutyUser) {
this.dutyUser = dutyUser;
}
public LocalDateTime getDutyDateTime() {
return dutyDateTime;
}
public void setDutyDateTime(LocalDateTime dutyDateTime) {
this.dutyDateTime = dutyDateTime;
}
public String getDutyDepart() {
return dutyDepart;
}
public void setDutyDepart(String dutyDepart) {
this.dutyDepart = dutyDepart;
}
public String getPrincipalUser() {
return principalUser;
}
public void setPrincipalUser(String principalUser) {
this.principalUser = principalUser;
}
public String getDutyCauseDescription() {
return dutyCauseDescription;
}
public void setDutyCauseDescription(String dutyCauseDescription) {
this.dutyCauseDescription = dutyCauseDescription;
}
public String getDutyCauseType() {
return dutyCauseType;
}
public void setDutyCauseType(String dutyCauseType) {
this.dutyCauseType = dutyCauseType;
}
public String getDutyType() {
return dutyType;
}
public void setDutyType(String dutyType) {
this.dutyType = dutyType;
}
public String getDutySendUserGroup() {
return dutySendUserGroup;
}
public void setDutySendUserGroup(String dutySendUserGroup) {
this.dutySendUserGroup = dutySendUserGroup;
}
public String getResolveUser() {
return resolveUser;
}
public void setResolveUser(String resolveUser) {
this.resolveUser = resolveUser;
}
public LocalDateTime getResolveDateTime() {
return resolveDateTime;
}
public void setResolveDateTime(LocalDateTime resolveDateTime) {
this.resolveDateTime = resolveDateTime;
}
public String getAbnormalMethod() {
return abnormalMethod;
}
public void setAbnormalMethod(String abnormalMethod) {
this.abnormalMethod = abnormalMethod;
}
public String getRouterBo() {
return routerBo;
}
public void setRouterBo(String routerBo) {
this.routerBo = routerBo;
}
public String getResolveShopOrder() {
return resolveShopOrder;
}
public void setResolveShopOrder(String resolveShopOrder) {
this.resolveShopOrder = resolveShopOrder;
}
public String getResolveRemark() {
return resolveRemark;
}
public void setResolveRemark(String resolveRemark) {
this.resolveRemark = resolveRemark;
}
public String getResolveSendUser() {
return resolveSendUser;
}
public void setResolveSendUser(String resolveSendUser) {
this.resolveSendUser = resolveSendUser;
}
public String getClosedUser() {
return closedUser;
}
public void setClosedUser(String closedUser) {
this.closedUser = closedUser;
}
public LocalDateTime getClosedDateTime() {
return closedDateTime;
}
public void setClosedDateTime(LocalDateTime closedDateTime) {
this.closedDateTime = closedDateTime;
}
public String getAbnormalReason() {
return abnormalReason;
}
public void setAbnormalReason(String abnormalReason) {
this.abnormalReason = abnormalReason;
}
public String getBeforeMeasure() {
return beforeMeasure;
}
public void setBeforeMeasure(String beforeMeasure) {
this.beforeMeasure = beforeMeasure;
}
public String getCreatedUser() {
return createdUser;
}
public void setCreatedUser(String createdUser) {
this.createdUser = createdUser;
}
public LocalDateTime getCreatedDataTime() {
return createdDataTime;
}
public void setCreatedDataTime(LocalDateTime createdDataTime) {
this.createdDataTime = createdDataTime;
}
public String getModifiedUser() {
return modifiedUser;
}
public void setModifiedUser(String modifiedUser) {
this.modifiedUser = modifiedUser;
}
public LocalDateTime getModifiedDateTime() {
return modifiedDateTime;
}
public void setModifiedDateTime(LocalDateTime modifiedDateTime) {
this.modifiedDateTime = modifiedDateTime;
}
public static final String HANDLE = "HANDLE";
public static final String SITE = "SITE";
public static final String ABNORMAL_NO = "ABNORMAL_NO";
public static final String STATUS = "STATUS";
public static final String TYPE = "TYPE";
public static final String ITEM_BO = "ITEM_BO";
public static final String SFC = "SFC";
public static final String OPERATION = "OPERATION";
public static final String WORK_CENTER = "WORK_CENTER";
public static final String SHOP_ORDER = "SHOP_ORDER";
public static final String MESSAGE_TYPE = "MESSAGE_TYPE";
public static final String RESRCE = "RESRCE";
public static final String NC_CODE = "NC_CODE";
public static final String NC_CODE_GROUP = "NC_CODE_GROUP";
public static final String SHUT_DOWN = "SHUT_DOWN";
public static final String RESPONSE_USER = "RESPONSE_USER";
public static final String RESPONSE_DATE_TIME = "RESPONSE_DATE_TIME";
public static final String PB_DESCRIPTION = "PB_DESCRIPTION";
public static final String NC_QTY = "NC_QTY";
public static final String PB_GRADE = "PB_GRADE";
public static final String PB_USER = "PB_USER";
public static final String PB_QTY = "PB_QTY";
public static final String REPAIR_DATE_TIME = "REPAIR_DATE_TIME";
public static final String DISCOVER = "DISCOVER";
public static final String INSPECTOR = "INSPECTOR";
public static final String ENTITY_LOCATION = "ENTITY_LOCATION";
public static final String REPORT_FROM = "REPORT_FROM";
public static final String OBJECT_BO = "OBJECT_BO";
public static final String PB_PHOTOSHOP = "PB_PHOTOSHOP";
public static final String CANCEL_CODE = "CANCEL_CODE";
public static final String CANCEL_REASON = "CANCEL_REASON";
public static final String CANCEL_DATE_TIME = "CANCEL_DATE_TIME";
public static final String CANCEL_USER = "CANCEL_USER";
public static final String DUTY_USER = "DUTY_USER";
public static final String DUTY_DATE_TIME = "DUTY_DATE_TIME";
public static final String DUTY_DEPART = "DUTY_DEPART";
public static final String PRINCIPAL_USER = "PRINCIPAL_USER";
public static final String DUTY_CAUSE_DESCRIPTION = "DUTY_CAUSE_DESCRIPTION";
public static final String DUTY_CAUSE_TYPE = "DUTY_CAUSE_TYPE";
public static final String DUTY_TYPE = "DUTY_TYPE";
public static final String DUTY_SEND_USER_GROUP = "DUTY_SEND_USER_GROUP";
public static final String RESOLVE_USER = "RESOLVE_USER";
public static final String RESOLVE_DATE_TIME = "RESOLVE_DATE_TIME";
public static final String ABNORMAL_METHOD = "ABNORMAL_METHOD";
public static final String ROUTER_BO = "ROUTER_BO";
public static final String RESOLVE_SHOP_ORDER = "RESOLVE_SHOP_ORDER";
public static final String RESOLVE_REMARK = "RESOLVE_REMARK";
public static final String RESOLVE_SEND_USER = "RESOLVE_SEND_USER";
public static final String CLOSED_USER = "CLOSED_USER";
public static final String CLOSED_DATE_TIME = "CLOSED_DATE_TIME";
public static final String ABNORMAL_REASON = "ABNORMAL_REASON";
public static final String BEFORE_MEASURE = "BEFORE_MEASURE";
public static final String CREATED_USER = "CREATED_USER";
public static final String CREATED_DATA_TIME = "CREATED_DATA_TIME";
public static final String MODIFIED_USER = "MODIFIED_USER";
public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME";
@Override
protected Serializable pkVal() {
return this.handle;
}
@Override
public String toString() {
return "AbnormalBillLog{" +
"handle = " + handle +
", site = " + site +
", abnormalNo = " + abnormalNo +
", status = " + status +
", type = " + type +
", itemBo = " + itemBo +
", sfc = " + sfc +
", operation = " + operation +
", workCenter = " + workCenter +
", shopOrder = " + shopOrder +
", messageType = " + messageType +
", resrce = " + resrce +
", ncCode = " + ncCode +
", ncCodeGroup = " + ncCodeGroup +
", shutDown = " + shutDown +
", responseUser = " + responseUser +
", responseDateTime = " + responseDateTime +
", pbDescription = " + pbDescription +
", ncQty = " + ncQty +
", pbGrade = " + pbGrade +
", pbUser = " + pbUser +
", pbQty = " + pbQty +
", repairDateTime = " + repairDateTime +
", discover = " + discover +
", inspector = " + inspector +
", entityLocation = " + entityLocation +
", reportFrom = " + reportFrom +
", objectBo = " + objectBo +
", pbPhotoshop = " + pbPhotoshop +
", cancelCode = " + cancelCode +
", cancelReason = " + cancelReason +
", cancelDateTime = " + cancelDateTime +
", cancelUser = " + cancelUser +
", dutyUser = " + dutyUser +
", dutyDateTime = " + dutyDateTime +
", dutyDepart = " + dutyDepart +
", principalUser = " + principalUser +
", dutyCauseDescription = " + dutyCauseDescription +
", dutyCauseType = " + dutyCauseType +
", dutyType = " + dutyType +
", dutySendUserGroup = " + dutySendUserGroup +
", resolveUser = " + resolveUser +
", resolveDateTime = " + resolveDateTime +
", abnormalMethod = " + abnormalMethod +
", routerBo = " + routerBo +
", resolveShopOrder = " + resolveShopOrder +
", resolveRemark = " + resolveRemark +
", resolveSendUser = " + resolveSendUser +
", closedUser = " + closedUser +
", closedDateTime = " + closedDateTime +
", abnormalReason = " + abnormalReason +
", beforeMeasure = " + beforeMeasure +
", createdUser = " + createdUser +
", createdDataTime = " + createdDataTime +
", modifiedUser = " + modifiedUser +
", modifiedDateTime = " + modifiedDateTime +
"}";
}
}

@ -0,0 +1,39 @@
package com.foreverwin.mesnac.anomaly.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.mesnac.anomaly.model.AbnormalBill;
import com.foreverwin.mesnac.anomaly.model.AbnormalBillDispose;
import com.foreverwin.mesnac.anomaly.model.AbnormalBillLog;
import com.foreverwin.modular.core.util.FrontPage;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author
* @since 2021-07-16
*/
public interface AbnormalBillLogService extends IService<AbnormalBillLog> {
/**
*
* @param frontPage
* @return
*/
IPage<AbnormalBillLog> selectPage(FrontPage<AbnormalBillLog> frontPage, AbnormalBillLog abnormalBillLog);
List<AbnormalBillLog> selectList(AbnormalBillLog abnormalBillLog);
void saveAndUpdate(AbnormalBill abnormalBill,
AbnormalBillDispose abnormalBillDispose,
@RequestParam List<String> ncGroupAndNcCodes,
@RequestParam List<String> dutyCauseType,
@RequestParam List<String> dutyType);
}

@ -0,0 +1,175 @@
package com.foreverwin.mesnac.anomaly.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.anomaly.mapper.AbnormalBillLogMapper;
import com.foreverwin.mesnac.anomaly.mapper.AbnormalNcCodeMapper;
import com.foreverwin.mesnac.anomaly.model.AbnormalBill;
import com.foreverwin.mesnac.anomaly.model.AbnormalBillDispose;
import com.foreverwin.mesnac.anomaly.model.AbnormalBillLog;
import com.foreverwin.mesnac.anomaly.model.AbnormalNcCode;
import com.foreverwin.mesnac.anomaly.service.AbnormalBillDisposeService;
import com.foreverwin.mesnac.anomaly.service.AbnormalBillLogService;
import com.foreverwin.mesnac.anomaly.service.AbnormalBillService;
import com.foreverwin.mesnac.anomaly.service.AbnormalNcCodeService;
import com.foreverwin.mesnac.common.constant.Constants;
import com.foreverwin.mesnac.common.enums.HandleEnum;
import com.foreverwin.mesnac.common.util.StringUtil;
import com.foreverwin.mesnac.meapi.mapper.NwaUserMapper;
import com.foreverwin.mesnac.meapi.mapper.ShopOrderMapper;
import com.foreverwin.mesnac.meapi.model.Router;
import com.foreverwin.mesnac.meapi.model.ShopOrder;
import com.foreverwin.mesnac.meapi.service.RouterService;
import com.foreverwin.modular.core.exception.BusinessException;
import com.foreverwin.modular.core.util.CommonMethods;
import com.foreverwin.modular.core.util.FrontPage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author
* @since 2021-07-16
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class AbnormalBillLogServiceImpl extends ServiceImpl<AbnormalBillLogMapper, AbnormalBillLog> implements AbnormalBillLogService {
@Autowired
private AbnormalBillLogMapper abnormalBillLogMapper;
@Autowired
private AbnormalNcCodeService abnormalNcCodeService;
@Autowired
private AbnormalNcCodeMapper abnormalNcCodeMapper;
@Autowired
private AbnormalBillService abnormalBillService;
@Autowired
private AbnormalBillDisposeService abnormalBillDisposeService;
@Autowired
private RouterService routerService;
@Autowired
private NwaUserMapper nwaUserMapper;
@Autowired
private ShopOrderMapper shopOrderMapper;
@Override
public IPage<AbnormalBillLog> selectPage(FrontPage<AbnormalBillLog> frontPage, AbnormalBillLog abnormalBillLog) {
QueryWrapper<AbnormalBillLog> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(abnormalBillLog);
return super.page(frontPage.getPagePlus(), queryWrapper);
}
@Override
public List<AbnormalBillLog> selectList(AbnormalBillLog abnormalBillLog) {
QueryWrapper<AbnormalBillLog> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(abnormalBillLog);
return super.list(queryWrapper);
}
@Override
public void saveAndUpdate(AbnormalBill abnormalBill, AbnormalBillDispose abnormalBillDispose, List<String> ncGroupAndNcCodes, List<String> dutyCauseType, List<String> dutyType) {
String user = CommonMethods.getUser();
LocalDateTime now = LocalDateTime.now();
String site = CommonMethods.getSite();
AbnormalBillLog abnormalBillLog = abnormalBillLogMapper.findAllByAbnormalNo(abnormalBill);
if(abnormalBillLogMapper.selectById(abnormalBillLog.getHandle()) == null){
//根据abnormalNo找到不合格代码组
StringBuilder ncGroup = new StringBuilder();
AbnormalNcCode abnormalNcCode = new AbnormalNcCode();
abnormalNcCode.setAbnormalBillBo(abnormalBillLog.getHandle());
QueryWrapper<AbnormalNcCode> abnormalNcCodeQueryWrapper = new QueryWrapper<>();
abnormalNcCodeQueryWrapper.eq("ABNORMAL_BILL_BO",abnormalBillLog.getHandle());
List<AbnormalNcCode> abnormalNcCodes = abnormalNcCodeMapper.selectList(abnormalNcCodeQueryWrapper);
if(abnormalNcCodes != null && abnormalNcCodes.size() > 0){
for(AbnormalNcCode abnormalNcGroup : abnormalNcCodes){
ncGroup.append(abnormalNcGroup.getNcCodeGroup()).append(",");
}
}
List<String> ncGroups =new ArrayList<>();
if(!StringUtil.isBlank(ncGroup.toString().toString())){
ncGroup = new StringBuilder(ncGroup.substring(0, ncGroup.length() - 1));
List<String> strings = Arrays.asList(ncGroup.toString().split(","));
ncGroups.add(strings.get(0));
for (int i = 1; i < strings.size(); i++) {
for(int j = 0; j < ncGroups.size(); j++){
if(j == (ncGroups.size() - 1) && !ncGroups.get(j).equals(strings.get(i))){
ncGroups.add(strings.get(i));
}
if(ncGroups.get(j).equals(strings.get(i))){
break;
}
}
}
}
ncGroup = new StringBuilder();
for (int i = 0; i < ncGroups.size(); i++) {
if(i == (ncGroups.size() - 1)){
ncGroup.append(ncGroups.get(i));
}else{
ncGroup.append(ncGroups.get(i)).append(",");
}
}
abnormalBillLog.setNcCodeGroup(ncGroup.toString());
abnormalBillLog.setCreatedUser(user);
abnormalBillLog.setCreatedDataTime(now);
abnormalBillLog.setModifiedUser(user);
abnormalBillLog.setModifiedDateTime(now);
this.save(abnormalBillLog);;
}
if(!StringUtil.isBlank(abnormalBillDispose.getRouterBo())){
//分割该工艺路线
String[] routerSplit = abnormalBillDispose.getRouterBo().split(",");
//判断该返修工艺是否正确
Router router = new Router();
router.setSite(site);
router.setRouter(routerSplit[1]);
router.setRouterType(routerSplit[2]);
router.setCurrentRevision("true");
List<Router> routers = routerService.selectList(router);
if(routers == null || routers.size() == 0){
throw BusinessException.build("该返修工艺不存在");
}
}
//判断返修工单是否正确
if(!StringUtil.isBlank(abnormalBillDispose.getResolveShopOrder())){
ShopOrder shopOrder = shopOrderMapper.selectById(HandleEnum.SHOP_ORDER.getHandle(site, abnormalBillDispose.getResolveShopOrder()));
if(shopOrder == null){
throw BusinessException.build("该返修工单不存在");
}
}
//发送用户
String[] split = abnormalBillDispose.getResolveSendUser().split(",");
List<String> strings = Arrays.asList(split);
int length = nwaUserMapper.checkUser(site, strings);
if(length != strings.size()){
throw BusinessException.build("发送用户填报错误");
}
if(Constants.ABNORMAL_QUALITY.equals(abnormalBill.getType())){
abnormalBillService.anomalyReport(abnormalBill,abnormalBillDispose,ncGroupAndNcCodes,dutyCauseType,dutyType);
}else if(Constants.ABNORMAL_OTHER.equals(abnormalBill.getType())){
abnormalBillService.anomalyReportOther(abnormalBill,abnormalBillDispose,dutyCauseType,dutyType);
}
}
}

@ -99,6 +99,9 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
@Autowired
private NcCodeMapper ncCodeMapper;
@Autowired
private OperationMapper operationMapper;
@Override
public IPage<AbnormalBill> selectPage(FrontPage<AbnormalBill> frontPage, AbnormalBill abnormalBill) {
QueryWrapper<AbnormalBill> queryWrapper = new QueryWrapper<>();
@ -183,10 +186,6 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
@Override
public String anomalyReportDevice(AbnormalBill abnormalBill,AbnormalBillDispose abnormalBillDispose) {
String message = this.generateAbnormalBill(abnormalBill, abnormalBillDispose, null, null);
this.saveOrUpdate(abnormalBill);
abnormalBillDisposeService.saveOrUpdate(abnormalBillDispose);
if(!StringUtil.isBlank(abnormalBill.getSfc()) ){
@ -399,23 +398,25 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
throw BusinessException.build("异常单号不存在");
}
abnormalBill.setHandle(HandleEnum.Z_ABNORMAL_BILL.getHandle(site,abnormalBill.getAbnormalNo()));
//更新的时候,判断该异常的状态是否为新建
//更新的时候,判断该异常的状态是否为新建
AbnormalBill abnormalBill1 = abnormalBillMapper.selectById(abnormalBill.getHandle());
if(abnormalBill1 != null){
if(!"N".equals(abnormalBill1.getStatus())){
if(!"N".equals(abnormalBill1.getStatus()) && StringUtil.isBlank(abnormalBillDispose.getClosedUser())){
throw BusinessException.build("该异常单已经被人处理,不能进行更新");
}
message = "更新成功";
}else{
message = "保存成功";
}
abnormalBillDispose.setClosedUser(null);
abnormalBillDispose.setAbnormalBillBo(abnormalBill.getHandle());
abnormalBillDispose.setHandle(HandleEnum.Z_ABNORMAL_BILL_DISPOSE.getHandle(site,abnormalBill.getAbnormalNo()));
//设置责任划分填报人和填报时间
abnormalBillDispose.setDutyUser(user);
abnormalBillDispose.setDutyDateTime(currentTime);
if(StringUtil.isBlank(abnormalBillDispose.getDutyUser())){
abnormalBillDispose.setDutyUser(user);
abnormalBillDispose.setDutyDateTime(currentTime);
}
ArrayList<AbnormalCause> causeTypes = new ArrayList<>();
//判断原因分类是否为空,如果不为空把它放进Z_ABNORMAL_CAUSE表里面
if(dutyCauseType != null && dutyCauseType.size() >= 1){
@ -440,6 +441,18 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
causeTypes.add(abnormalCause);
}
}
/**
*
*/
if(!StringUtil.isBlank(abnormalBill.getOperation())){
QueryWrapper<Operation> operationQueryWrapper = new QueryWrapper<Operation>();
operationQueryWrapper.eq("OPERATION",abnormalBill.getOperation())
.eq("SITE",site);
List<Operation> operations = operationMapper.selectList(operationQueryWrapper);
if(operations == null || operations.size() == 0){
throw BusinessException.build("工序编号传递错误");
}
}
/**
*
@ -695,7 +708,7 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
abnormalBillDispose.setSite(site);
abnormalBillDispose.setAbnormalBillBo(abnormalBill.getHandle());
this.generateAbnormalBill(abnormalBill, abnormalBillDispose, null, null);
//判断工单sfc资源是否传递正确
Sfc sfc1 = sfcMapper.selectById(HandleEnum.SFC.getHandle(site, sfc));
@ -710,8 +723,7 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
// throw new BaseException("资源传递有误");
// }
}
this.saveOrUpdate(abnormalBill);
abnormalBillDisposeService.saveOrUpdate(abnormalBillDispose);
this.anomalyReportDevice(abnormalBill,abnormalBillDispose);
}
}

@ -37,6 +37,7 @@
<result column="ABNORMAL_NO" property="abnormalNo"/>
<result column="STATUS" property="status"/>
<result column="ITEM" property="item"/>
<result column="ITEM_BO" property="itemBo"/>
<result column="ITEM_DESCRIPTION" property="itemDescription"/>
<result column="TYPE" property="type"/>
<result column="SFC" property="sfc"/>
@ -627,7 +628,7 @@
ZABD.DUTY_SEND_USER_GROUP DUTY_SEND_USER_GROUP,ZABD.DUTY_TYPE DUTY_TYPE,ZABD.PRINCIPAL_USER PRINCIPAL_USER,ZABD.ABNORMAL_METHOD ABNORMAL_METHOD,
R.ROUTER ROUTER,ZABD.RESOLVE_SHOP_ORDER RESOLVE_SHOP_ORDER,ZABD.RESOLVE_REMARK RESOLVE_REMARK,ZABD.RESOLVE_SEND_USER RESOLVE_SEND_USER,
ZABD.ABNORMAL_REASON ABNORMAL_REASON,ZABD.BEFORE_MEASURE BEFORE_MEASURE,"MAP".VALUE "MAP",listagg(ZANC.NC_CODE_GROUP || '/'||ZANC.NC_CODE || ',') within GROUP(ORDER BY zab.ABNORMAL_NO) NC_CODE,
ZABD.ROUTER_BO ROUTER_BO,ZAB.OPERATION OPERATION
ZABD.ROUTER_BO ROUTER_BO,ZAB.OPERATION OPERATION,I.HANDLE ITEM_BO
FROM Z_ABNORMAL_BILL ZAB
LEFT JOIN Z_ABNORMAL_BILL_DISPOSE ZABD ON ZAB.HANDLE = ZABD.ABNORMAL_BILL_BO
INNER JOIN ITEM I ON I.HANDLE = ZAB.ITEM_BO
@ -662,8 +663,7 @@
ZAB.PB_PHOTOSHOP ,ZABD.DUTY_CAUSE_DESCRIPTION ,ZABD.DUTY_CAUSE_TYPE ,ZABD.DUTY_DEPART ,
ZABD.DUTY_SEND_USER_GROUP ,ZABD.DUTY_TYPE ,ZABD.PRINCIPAL_USER ,ZABD.ABNORMAL_METHOD ,
R.ROUTER ,ZABD.RESOLVE_SHOP_ORDER ,ZABD.RESOLVE_REMARK ,ZABD.RESOLVE_SEND_USER ,
ZABD.ABNORMAL_REASON ,ZABD.BEFORE_MEASURE ,"MAP".VALUE,ZABD.ROUTER_BO,ZAB.OPERATION
ZABD.ABNORMAL_REASON ,ZABD.BEFORE_MEASURE ,"MAP".VALUE,ZABD.ROUTER_BO,ZAB.OPERATION,I.HANDLE
</select>

File diff suppressed because it is too large Load Diff

@ -391,12 +391,12 @@
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
AND ${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
AND ${ew.sqlSegment}
</if>
</select>

@ -87,7 +87,13 @@ public class ResourceInspectTaskDto implements Serializable {
/**消耗备品**/
private List<ResourceInspectTaskSpare> taskSpareList;
public Integer getItemSeq() {
return itemSeq;
}
public void setItemSeq(Integer itemSeq) {
this.itemSeq = itemSeq;
}
public String getCompareStartDate() {
return compareStartDate;

@ -78,10 +78,12 @@ public class ResourceInspectTaskServiceImpl extends ServiceImpl<ResourceInspectT
resourceInspectTaskDto.setSite(site);
List<ResourceInspectTaskDto> list = resourceInspectTaskMapper.findResourceInspectTaskList(resourceInspectTaskDto);
for (ResourceInspectTaskDto task:list) {
task.setResourceTypeNo(task.getResourceTypeBo().split(",")[1]);
task.setCycle(getCycle(task));
task.setCurrentUser(currentUser);
}
for (ResourceInspectTaskDto task:list) {
System.out.println(task.getTaskNo());
}
return list;
}
@ -229,6 +231,9 @@ public class ResourceInspectTaskServiceImpl extends ServiceImpl<ResourceInspectT
String frequencyUnit = task.getFrequencyUnit();
String frequency = task.getFrequency();
StringBuffer cycle = new StringBuffer("每");
if (frequencyUnit == null){
return "---";
}
switch (frequencyUnit){
case "D":
cycle = cycle.append(frequency).append("天");

@ -595,48 +595,50 @@
<!--自定义sql模糊查询检验任务所有字段、车间、设备名称等字段-->
<select id="findResourceInspectTaskList" resultType="com.foreverwin.mesnac.equip.dto.ResourceInspectTaskDto">
SELECT DISTINCT ZK.* ,RIP.PLAN_NO AS PLAN_NO ,RIP.FREQUENCY ,RIP.FREQUENCY_UNIT ,
SELECT DISTINCT RIK.* ,RIP.PLAN_NO AS PLAN_NO ,RIP.FREQUENCY ,RIP.FREQUENCY_UNIT ,
R.RESRCE AS RESOURCE_NO ,R.DESCRIPTION AS RESOURCE_DESCRIPTION ,
RTR.RESOURCE_TYPE_BO,WCT.DESCRIPTION AS WORK_CENTER
FROM ( SELECT * FROM Z_RESOURCE_INSPECT_TASK SD
WHERE SD.SITE = #{site}
RTR.RESOURCE_TYPE_BO ,RT.RESOURCE_TYPE AS RESOURCE_TYPE_NO ,RT.DESCRIPTION AS RESOURCE_TYPE_DESCRIPTION ,
WCT.DESCRIPTION AS WORK_CENTER
FROM Z_RESOURCE_INSPECT_TASK RIK
LEFT JOIN Z_INSPECT_PLAN_USER_GROUP ZG ON ZG.RESOURCE_INSPECT_PLAN_BO = RIK.RESOURCE_INSPECT_PLAN_BO
LEFT JOIN USER_GROUP_MEMBER UGM ON UGM.USER_GROUP_BO = ZG.USER_GROUP_BO
LEFT JOIN Z_RESOURCE_INSPECT_PLAN RIP ON RIK.RESOURCE_INSPECT_PLAN_BO = RIP.HANDLE
LEFT JOIN RESRCE R ON R.HANDLE = RIK.RESOURCE_BO
LEFT JOIN WORK_CENTER_MEMBER WCM ON WCM.WORK_CENTER_OR_RESOURCE_GBO = RIK.RESOURCE_BO
LEFT JOIN WORK_CENTER_T WCT ON WCT.WORK_CENTER_BO = WCM.WORK_CENTER_BO
LEFT JOIN RESOURCE_TYPE_RESOURCE RTR ON RTR.RESOURCE_BO = RIK.RESOURCE_BO
LEFT JOIN RESOURCE_TYPE RT ON RT.HANDLE = RTR.RESOURCE_TYPE_BO
WHERE
(ZG.USER_GROUP_BO IS NULL OR (ZG.USER_GROUP_BO IS NOT NULL AND UGM.USER_OR_GROUP_GBO = #{currentUser}))
AND RIK.SITE = #{site}
<if test="taskNo != null and taskNo != ''">
AND SD.TASK_NO = #{taskNo}
AND RIK.TASK_NO = #{taskNo}
</if>
<if test="category != null and category != ''">
AND SD.CATEGORY = #{category}
AND RIK.CATEGORY = #{category}
</if>
<if test="status != null and status != ''">
AND SD.STATUS = #{status}
AND RIK.STATUS = #{status}
</if>
<if test="resourceInspectPlanBo != null and resourceInspectPlanBo != ''">
AND SD.RESOURCE_INSPECT_PLAN_BO LIKE #{resourceInspectPlanBo}
AND RIK.RESOURCE_INSPECT_PLAN_BO LIKE #{resourceInspectPlanBo}
</if>
<if test="resourceBo != null and resourceBo != ''">
AND SD.RESOURCE_BO = #{resourceBo}
AND RIK.RESOURCE_BO = #{resourceBo}
</if>
<if test="compareStartDate != null and compareStartDate != ''">
AND SD.TASK_CREATE_DATE &gt; TO_DATE( #{compareStartDate},'yyyy-MM-dd hh24:mi-ss' )
AND RIK.TASK_CREATE_DATE &gt; TO_DATE( #{compareStartDate},'yyyy-MM-dd hh24:mi-ss' )
</if>
<if test="compareEndDate != null and compareEndDate != ''">
AND SD.TASK_CREATE_DATE &lt; TO_DATE( #{compareEndDate},'yyyy-MM-dd hh24:mi-ss' )
AND RIK.TASK_CREATE_DATE &lt; TO_DATE( #{compareEndDate},'yyyy-MM-dd hh24:mi-ss' )
</if>
) ZK
LEFT JOIN Z_INSPECT_PLAN_USER_GROUP ZG ON ZG.RESOURCE_INSPECT_PLAN_BO = ZK.RESOURCE_INSPECT_PLAN_BO
LEFT JOIN USER_GROUP_MEMBER UGM ON UGM.USER_GROUP_BO = ZG.USER_GROUP_BO
LEFT JOIN Z_RESOURCE_INSPECT_PLAN RIP ON ZK.RESOURCE_INSPECT_PLAN_BO = RIP.HANDLE
LEFT JOIN RESRCE R ON R.HANDLE = ZK.RESOURCE_BO
LEFT JOIN WORK_CENTER_MEMBER WCM ON WCM.WORK_CENTER_OR_RESOURCE_GBO = ZK.RESOURCE_BO
LEFT JOIN WORK_CENTER_T WCT ON WCT.WORK_CENTER_BO = WCM.WORK_CENTER_BO
LEFT JOIN RESOURCE_TYPE_RESOURCE RTR ON RTR.RESOURCE_BO = ZK.RESOURCE_BO
WHERE
(ZG.USER_GROUP_BO IS NULL OR (ZG.USER_GROUP_BO IS NOT NULL AND UGM.USER_OR_GROUP_GBO = #{currentUser}))
<if test="resourceTypeBo != null and resourceTypeBo != ''">
AND RTR.RESOURCE_TYPE_BO = #{resourceTypeBo}
</if>
<if test="workCenter != null and workCenter != ''">
AND WCM.WORK_CENTER_BO = #{workCenter}
</if>
ORDER BY RIK.TASK_NO ASC
</select>
<!--自定义sql条件查询根据检验计划handle及设备handle获取最新的创建任务时间-->

@ -2,7 +2,6 @@ package com.foreverwin.mesnac.meapi.controller;
import com.foreverwin.modular.core.util.R;
import com.foreverwin.modular.core.util.FrontPage;
import com.foreverwin.modular.core.util.CommonMethods;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.web.bind.annotation.RequestMapping;
@ -11,6 +10,8 @@ import org.springframework.web.bind.annotation.*;
import com.foreverwin.mesnac.meapi.service.InventoryService;
import com.foreverwin.mesnac.meapi.model.Inventory;
import java.math.BigDecimal;
import java.util.List;
/**
@ -136,4 +137,25 @@ public class InventoryController {
public R removeByIds(List<String> ids){
return R.ok(inventoryService.removeByIds(ids));
}
/**
*
* 使
* @param inventory
* @return
*/
@ResponseBody
@GetMapping("/getInventoryOne")
public R getInventoryOne(Inventory inventory){
List<Inventory> inventoryList = inventoryService.selectList(inventory);
if (inventoryList.size() < 1){
inventory.setQtyOnHand(new BigDecimal(0));
return R.ok(inventory);
}
if (inventoryList.size() == 1){
return R.ok(inventoryList.get(0));
}
return R.failed("一个条码匹配多个数据!");
}
}

@ -164,4 +164,14 @@ public class ResrceController {
public R findAllResrce(){
return R.ok(resrceService.findAllResrce());
}
/**
*
* @return
*/
@GetMapping("findResourceAndWorkCenterByResource")
public R findResourceAndWorkCenterByResource(Resrce resrce){
return R.ok(resrceService.findResourceAndWorkCenterByResource(resrce));
}
}

@ -1,5 +1,6 @@
package com.foreverwin.mesnac.meapi.mapper;
import com.foreverwin.mesnac.meapi.dto.ResrceWorkCenter;
import com.foreverwin.mesnac.meapi.model.Resrce;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
@ -36,4 +37,7 @@ public interface ResrceMapper extends BaseMapper<Resrce> {
List<Resrce> findResourceListByResourceType(@Param("site")String site,@Param("resourceTypeBo")String resourceTypeBo);
List<Map<String, Object>> selectResourceOperation(@Param("resourceBo") String resourceBo);
ResrceWorkCenter findResourceAndWorkCenterByResource(Resrce resrce);
}

@ -1,6 +1,7 @@
package com.foreverwin.mesnac.meapi.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.meapi.dto.ResrceWorkCenter;
import com.foreverwin.mesnac.meapi.model.Resrce;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.modular.core.util.FrontPage;
@ -69,4 +70,12 @@ public interface ResrceService extends IService<Resrce> {
* @return
*/
List<Map<String, Object>> getResourceOperation(String resourceBo);
/**
*
* @param resrce
* @return
*/
ResrceWorkCenter findResourceAndWorkCenterByResource(Resrce resrce);
}

@ -1,5 +1,6 @@
package com.foreverwin.mesnac.meapi.service.impl;
import com.foreverwin.mesnac.meapi.dto.ResrceWorkCenter;
import com.foreverwin.modular.core.util.CommonMethods;
import com.foreverwin.modular.core.util.FrontPage;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@ -89,5 +90,10 @@ public class ResrceServiceImpl extends ServiceImpl<ResrceMapper, Resrce> impleme
return resrceMapper.selectResourceOperation(resourceBo);
}
@Override
public ResrceWorkCenter findResourceAndWorkCenterByResource(Resrce resrce) {
return resrceMapper.findResourceAndWorkCenterByResource(resrce);
}
}

@ -586,4 +586,17 @@
LEFT JOIN RESOURCE_TYPE RT ON RT.HANDLE = RR.RESOURCE_TYPE_BO
WHERE RS.HANDLE = #{resourceBo}
</select>
<select id="findResourceAndWorkCenterByResource" resultType="com.foreverwin.mesnac.meapi.dto.ResrceWorkCenter">
SELECT R.RESRCE AS RESOURCE_NO ,R.DESCRIPTION AS RESOURCE_DESCRIPTION,
WCM2.WORK_CENTER_BO , WCT.DESCRIPTION AS WORK_CENTER_DESCRIPTION ,WC.WORK_CENTER AS WORK_CENTER_NO
FROM RESRCE r
LEFT JOIN WORK_CENTER_MEMBER WCM ON WCM.WORK_CENTER_OR_RESOURCE_GBO = R.HANDLE
LEFT JOIN WORK_CENTER_MEMBER wcm2 ON WCM2.WORK_CENTER_OR_RESOURCE_GBO = WCM.WORK_CENTER_BO
LEFT JOIN WORK_CENTER_T wct ON WCM2.WORK_CENTER_BO = WCT.WORK_CENTER_BO
LEFT JOIN WORK_CENTER wc ON WC.HANDLE = WCM2.WORK_CENTER_BO
WHERE R.RESRCE = #{resrce} AND R.SITE = #{site}
</select>
</mapper>

Loading…
Cancel
Save