Merge remote-tracking branch 'origin/master'

zpl 4 years ago
commit dd3d3d2b8d

@ -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>

@ -0,0 +1,136 @@
package com.foreverwin.mesnac.common.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;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.foreverwin.mesnac.common.service.PrintLogService;
import com.foreverwin.mesnac.common.model.PrintLog;
import java.util.List;
/**
*
* @author Philip
* @since 2021-07-16
*/
@RestController
@RequestMapping("/Z-PRINT-LOG")
public class PrintLogController {
@Autowired
public PrintLogService printLogService;
/**
* id
*
* @param id
* @return
*/
@ResponseBody
@GetMapping("/{id:.+}")
public R getPrintLogById(@PathVariable String id) {
return R.ok( printLogService.getById(id));
}
/**
*
*
* @return
*/
@ResponseBody
@GetMapping("")
public R getPrintLogList(PrintLog printLog){
List<PrintLog> result;
QueryWrapper<PrintLog> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(printLog);
result = printLogService.list(queryWrapper);
return R.ok(result);
}
/**
*
*
* @param frontPage
* @return
*/
@ResponseBody
@GetMapping("/page")
public R page(FrontPage<PrintLog> frontPage, PrintLog printLog){
IPage result;
QueryWrapper<PrintLog> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(printLog);
if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) {
//TODO modify global query
queryWrapper.lambda().and(wrapper -> wrapper
.like(PrintLog::getHandle, frontPage.getGlobalQuery())
.or().like(PrintLog::getSite, frontPage.getGlobalQuery())
.or().like(PrintLog::getCategory, frontPage.getGlobalQuery())
.or().like(PrintLog::getPrintName, frontPage.getGlobalQuery())
.or().like(PrintLog::getPrintTemplate, frontPage.getGlobalQuery())
.or().like(PrintLog::getPrintParam, frontPage.getGlobalQuery())
.or().like(PrintLog::getSfc, frontPage.getGlobalQuery())
.or().like(PrintLog::getResrce, frontPage.getGlobalQuery())
.or().like(PrintLog::getStepId, frontPage.getGlobalQuery())
.or().like(PrintLog::getOperation, frontPage.getGlobalQuery())
.or().like(PrintLog::getInventory, frontPage.getGlobalQuery())
.or().like(PrintLog::getComments, frontPage.getGlobalQuery())
.or().like(PrintLog::getOther1, frontPage.getGlobalQuery())
.or().like(PrintLog::getOther2, frontPage.getGlobalQuery())
.or().like(PrintLog::getOther3, frontPage.getGlobalQuery())
.or().like(PrintLog::getOther4, frontPage.getGlobalQuery())
.or().like(PrintLog::getOther5, frontPage.getGlobalQuery())
.or().like(PrintLog::getCreateUser, frontPage.getGlobalQuery())
.or().like(PrintLog::getModifyUser, frontPage.getGlobalQuery())
);
}
result = printLogService.page(frontPage.getPagePlus(), queryWrapper);
return R.ok(result);
}
/**
*
* @param printLog
* @return null
*/
@PostMapping
public R save(@RequestBody PrintLog printLog) {
return R.ok(printLogService.save(printLog));
}
/**
*
* @param printLog
* @return null
*/
@PutMapping
public R updateById(@RequestBody PrintLog printLog) {
return R.ok(printLogService.updateById(printLog));
}
/**
* id
* @param id ID
* @return 0 1
*/
@ResponseBody
@RequestMapping(method = RequestMethod.DELETE, value = "/{id:.+}")
public R removeById(@PathVariable("id") String id){
return R.ok(printLogService.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(printLogService.removeByIds(ids));
}
}

@ -162,6 +162,10 @@ public class SfcDispatchDto implements Serializable{
* -
*/
private String workOrder;
/**
* -
*/
private String itemNumber;
/**
*
*/
@ -532,6 +536,14 @@ public class SfcDispatchDto implements Serializable{
this.workOrder = workOrder;
}
public String getItemNumber() {
return itemNumber;
}
public void setItemNumber(String itemNumber) {
this.itemNumber = itemNumber;
}
public String getComponent() {
return component;
}

@ -0,0 +1,18 @@
package com.foreverwin.mesnac.common.mapper;
import com.foreverwin.mesnac.common.model.PrintLog;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* <p>
* Mapper
* </p>
*
* @author Philip
* @since 2021-07-16
*/
@Repository
public interface PrintLogMapper extends BaseMapper<PrintLog> {
}

@ -0,0 +1,358 @@
package com.foreverwin.mesnac.common.model;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.IdType;
/**
* <p>
*
* </p>
*
* @author Philip
* @since 2021-07-16
*/
@TableName("Z_PRINT_LOG")
public class PrintLog extends Model<PrintLog> {
private static final long serialVersionUID = 1L;
/**
*
*/
@TableId(value = "HANDLE", type = IdType.INPUT)
private String handle;
/**
*
*/
@TableField("SITE")
private String site;
/**
*
*/
@TableField("CATEGORY")
private String category;
/**
*
*/
@TableField("PRINT_NAME")
private String printName;
/**
*
*/
@TableField("PRINT_TEMPLATE")
private String printTemplate;
/**
*
*/
@TableField("PRINT_PARAM")
private String printParam;
/**
*
*/
@TableField("SFC")
private String sfc;
/**
*
*/
@TableField("RESRCE")
private String resrce;
/**
*
*/
@TableField("STEP_ID")
private String stepId;
/**
*
*/
@TableField("OPERATION")
private String operation;
/**
*
*/
@TableField("INVENTORY")
private String inventory;
@TableField("COMMENTS")
private String comments;
@TableField("OTHER_1")
private String other1;
@TableField("OTHER_2")
private String other2;
@TableField("OTHER_3")
private String other3;
@TableField("OTHER_4")
private String other4;
@TableField("OTHER_5")
private String other5;
/**
*
*/
@TableField("CREATE_USER")
private String createUser;
/**
*
*/
@TableField("CREATED_DATE_TIME")
private LocalDateTime createdDateTime;
/**
*
*/
@TableField("MODIFY_USER")
private String modifyUser;
/**
*
*/
@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 getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
public String getPrintName() {
return printName;
}
public void setPrintName(String printName) {
this.printName = printName;
}
public String getPrintTemplate() {
return printTemplate;
}
public void setPrintTemplate(String printTemplate) {
this.printTemplate = printTemplate;
}
public String getPrintParam() {
return printParam;
}
public void setPrintParam(String printParam) {
this.printParam = printParam;
}
public String getSfc() {
return sfc;
}
public void setSfc(String sfc) {
this.sfc = sfc;
}
public String getResrce() {
return resrce;
}
public void setResrce(String resrce) {
this.resrce = resrce;
}
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 String getInventory() {
return inventory;
}
public void setInventory(String inventory) {
this.inventory = inventory;
}
public String getComments() {
return comments;
}
public void setComments(String comments) {
this.comments = comments;
}
public String getOther1() {
return other1;
}
public void setOther1(String other1) {
this.other1 = other1;
}
public String getOther2() {
return other2;
}
public void setOther2(String other2) {
this.other2 = other2;
}
public String getOther3() {
return other3;
}
public void setOther3(String other3) {
this.other3 = other3;
}
public String getOther4() {
return other4;
}
public void setOther4(String other4) {
this.other4 = other4;
}
public String getOther5() {
return other5;
}
public void setOther5(String other5) {
this.other5 = other5;
}
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 String getModifyUser() {
return modifyUser;
}
public void setModifyUser(String modifyUser) {
this.modifyUser = modifyUser;
}
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 CATEGORY = "CATEGORY";
public static final String PRINT_NAME = "PRINT_NAME";
public static final String PRINT_TEMPLATE = "PRINT_TEMPLATE";
public static final String PRINT_PARAM = "PRINT_PARAM";
public static final String SFC = "SFC";
public static final String RESRCE = "RESRCE";
public static final String STEP_ID = "STEP_ID";
public static final String OPERATION = "OPERATION";
public static final String INVENTORY = "INVENTORY";
public static final String COMMENTS = "COMMENTS";
public static final String OTHER_1 = "OTHER_1";
public static final String OTHER_2 = "OTHER_2";
public static final String OTHER_3 = "OTHER_3";
public static final String OTHER_4 = "OTHER_4";
public static final String OTHER_5 = "OTHER_5";
public static final String CREATE_USER = "CREATE_USER";
public static final String CREATED_DATE_TIME = "CREATED_DATE_TIME";
public static final String MODIFY_USER = "MODIFY_USER";
public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME";
@Override
protected Serializable pkVal() {
return this.handle;
}
@Override
public String toString() {
return "PrintLog{" +
"handle = " + handle +
", site = " + site +
", category = " + category +
", printName = " + printName +
", printTemplate = " + printTemplate +
", printParam = " + printParam +
", sfc = " + sfc +
", resrce = " + resrce +
", stepId = " + stepId +
", operation = " + operation +
", inventory = " + inventory +
", comments = " + comments +
", other1 = " + other1 +
", other2 = " + other2 +
", other3 = " + other3 +
", other4 = " + other4 +
", other5 = " + other5 +
", createUser = " + createUser +
", createdDateTime = " + createdDateTime +
", modifyUser = " + modifyUser +
", modifiedDateTime = " + modifiedDateTime +
"}";
}
}

@ -0,0 +1,52 @@
package com.foreverwin.mesnac.common.model;
import java.io.Serializable;
import java.util.Map;
/**
*
*
*/
public class PrintRequest implements Serializable {
//打印数量
private int labelQty;
//打印机
private String printer;
//打印模板
private String template;
//打印参数
private Map<String, Object> paramMap;
public int getLabelQty() {
return labelQty;
}
public void setLabelQty(int labelQty) {
this.labelQty = labelQty;
}
public String getPrinter() {
return printer;
}
public void setPrinter(String printer) {
this.printer = printer;
}
public String getTemplate() {
return template;
}
public void setTemplate(String template) {
this.template = template;
}
public Map<String, Object> getParamMap() {
return paramMap;
}
public void setParamMap(Map<String, Object> paramMap) {
this.paramMap = paramMap;
}
}

@ -0,0 +1,22 @@
package com.foreverwin.mesnac.common.service;
import com.foreverwin.mesnac.common.model.PrintLog;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
*
* </p>
*
* @author Philip
* @since 2021-07-16
*/
public interface PrintLogService extends IService<PrintLog> {
/**
*
*
* @param printLog
*/
void savePrintLog(String site, String user, PrintLog printLog);
}

@ -0,0 +1,13 @@
package com.foreverwin.mesnac.common.service;
import com.foreverwin.mesnac.common.model.PrintRequest;
/**
* @author Ervin Chen
* @date 2020/3/6 13:37
*/
public interface PrintService {
void print(PrintRequest printRequest);
}

@ -0,0 +1,43 @@
package com.foreverwin.mesnac.common.service.impl;
import com.foreverwin.mesnac.common.model.PrintLog;
import com.foreverwin.mesnac.common.mapper.PrintLogMapper;
import com.foreverwin.mesnac.common.service.PrintLogService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
/**
* <p>
*
* </p>
*
* @author Philip
* @since 2021-07-16
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class PrintLogServiceImpl extends ServiceImpl<PrintLogMapper, PrintLog> implements PrintLogService {
@Autowired
private PrintLogMapper printLogMapper;
@Override
@Transactional(propagation = Propagation.REQUIRES_NEW)
public void savePrintLog(String site, String user, PrintLog printLog) {
LocalDateTime dateTime = LocalDateTime.now();
printLog.setSite(site);
printLog.setCreateUser(user);
printLog.setCreatedDateTime(dateTime);
printLog.setModifyUser(user);
printLog.setModifiedDateTime(dateTime);
this.save(printLog);
}
}

@ -0,0 +1,39 @@
package com.foreverwin.mesnac.common.service.impl;
import com.foreverwin.mesnac.common.model.PrintRequest;
import com.foreverwin.mesnac.common.service.PrintService;
import com.foreverwin.mesnac.common.util.HttpUtils;
import com.foreverwin.mesnac.meapi.util.StringUtils;
import com.foreverwin.modular.core.exception.BusinessException;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
/**
* @author Ervin Chen
* @date 2020/3/6 13:38
*/
@Service
public class PrintServiceImpl implements PrintService {
@Value("${print.server}")
private String printServer;
@Override
public void print(PrintRequest printRequest) {
String printer = printRequest.getPrinter();
String printTemplate = printRequest.getTemplate();
if (StringUtils.isBlank(printer)) {
throw BusinessException.build("打印机未维护");
}
if (StringUtils.isBlank(printTemplate)) {
throw BusinessException.build("打印模板未维护");
}
//发送打印请求
ResponseEntity responseEntity = HttpUtils.callPost(printServer, "REQUEST_DATA=" + printRequest.toString());
}
}

@ -4,6 +4,8 @@ import org.jsoup.Connection;
import org.jsoup.Connection.Method;
import org.jsoup.Connection.Response;
import org.jsoup.Jsoup;
import org.springframework.http.*;
import org.springframework.web.client.RestTemplate;
import javax.net.ssl.*;
import java.io.*;
@ -319,4 +321,21 @@ public class HttpUtils {
e.printStackTrace();
}
}
/**
* POST
*
* @param url
* @param requestBody
* @return
*/
public static ResponseEntity callPost(String url, String requestBody ){
RestTemplate httpClient = new RestTemplate();
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.parseMediaType("application/x-www-form-urlencoded; charset=UTF-8"));
HttpEntity<String> entity = new HttpEntity<String>( requestBody, headers );
ResponseEntity<String> responseEntity = httpClient.exchange(url, HttpMethod.POST, entity, String.class);
return responseEntity;
}
}

@ -0,0 +1,578 @@
<?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.common.mapper.PrintLogMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.common.model.PrintLog">
<id column="HANDLE" property="handle" />
<result column="SITE" property="site" />
<result column="CATEGORY" property="category" />
<result column="PRINT_NAME" property="printName" />
<result column="PRINT_TEMPLATE" property="printTemplate" />
<result column="PRINT_PARAM" property="printParam" />
<result column="SFC" property="sfc" />
<result column="RESRCE" property="resrce" />
<result column="STEP_ID" property="stepId" />
<result column="OPERATION" property="operation" />
<result column="INVENTORY" property="inventory" />
<result column="COMMENTS" property="comments" />
<result column="OTHER_1" property="other1" />
<result column="OTHER_2" property="other2" />
<result column="OTHER_3" property="other3" />
<result column="OTHER_4" property="other4" />
<result column="OTHER_5" property="other5" />
<result column="CREATE_USER" property="createUser" />
<result column="CREATED_DATE_TIME" property="createdDateTime" />
<result column="MODIFY_USER" property="modifyUser" />
<result column="MODIFIED_DATE_TIME" property="modifiedDateTime" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
HANDLE, SITE, CATEGORY, PRINT_NAME, PRINT_TEMPLATE, PRINT_PARAM, SFC, RESRCE, STEP_ID, OPERATION, INVENTORY, COMMENTS, OTHER_1, OTHER_2, OTHER_3, OTHER_4, OTHER_5, CREATE_USER, CREATED_DATE_TIME, MODIFY_USER, MODIFIED_DATE_TIME
</sql>
<!-- BaseMapper标准查询/修改/删除 -->
<select id="selectById" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM Z_PRINT_LOG WHERE HANDLE=#{handle}
</select>
<select id="selectByMap" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
FROM Z_PRINT_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_PRINT_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_PRINT_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.category!=null"> AND CATEGORY=#{ew.entity.category}</if>
<if test="ew.entity.printName!=null"> AND PRINT_NAME=#{ew.entity.printName}</if>
<if test="ew.entity.printTemplate!=null"> AND PRINT_TEMPLATE=#{ew.entity.printTemplate}</if>
<if test="ew.entity.printParam!=null"> AND PRINT_PARAM=#{ew.entity.printParam}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</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.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if>
<if test="ew.entity.comments!=null"> AND COMMENTS=#{ew.entity.comments}</if>
<if test="ew.entity.other1!=null"> AND OTHER_1=#{ew.entity.other1}</if>
<if test="ew.entity.other2!=null"> AND OTHER_2=#{ew.entity.other2}</if>
<if test="ew.entity.other3!=null"> AND OTHER_3=#{ew.entity.other3}</if>
<if test="ew.entity.other4!=null"> AND OTHER_4=#{ew.entity.other4}</if>
<if test="ew.entity.other5!=null"> AND OTHER_5=#{ew.entity.other5}</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 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>
</where>
</select>
<select id="selectCount" resultType="Integer">
SELECT COUNT(1) FROM Z_PRINT_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.category!=null"> AND CATEGORY=#{ew.entity.category}</if>
<if test="ew.entity.printName!=null"> AND PRINT_NAME=#{ew.entity.printName}</if>
<if test="ew.entity.printTemplate!=null"> AND PRINT_TEMPLATE=#{ew.entity.printTemplate}</if>
<if test="ew.entity.printParam!=null"> AND PRINT_PARAM=#{ew.entity.printParam}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</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.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if>
<if test="ew.entity.comments!=null"> AND COMMENTS=#{ew.entity.comments}</if>
<if test="ew.entity.other1!=null"> AND OTHER_1=#{ew.entity.other1}</if>
<if test="ew.entity.other2!=null"> AND OTHER_2=#{ew.entity.other2}</if>
<if test="ew.entity.other3!=null"> AND OTHER_3=#{ew.entity.other3}</if>
<if test="ew.entity.other4!=null"> AND OTHER_4=#{ew.entity.other4}</if>
<if test="ew.entity.other5!=null"> AND OTHER_5=#{ew.entity.other5}</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 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>
<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_PRINT_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.category!=null"> AND CATEGORY=#{ew.entity.category}</if>
<if test="ew.entity.printName!=null"> AND PRINT_NAME=#{ew.entity.printName}</if>
<if test="ew.entity.printTemplate!=null"> AND PRINT_TEMPLATE=#{ew.entity.printTemplate}</if>
<if test="ew.entity.printParam!=null"> AND PRINT_PARAM=#{ew.entity.printParam}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</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.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if>
<if test="ew.entity.comments!=null"> AND COMMENTS=#{ew.entity.comments}</if>
<if test="ew.entity.other1!=null"> AND OTHER_1=#{ew.entity.other1}</if>
<if test="ew.entity.other2!=null"> AND OTHER_2=#{ew.entity.other2}</if>
<if test="ew.entity.other3!=null"> AND OTHER_3=#{ew.entity.other3}</if>
<if test="ew.entity.other4!=null"> AND OTHER_4=#{ew.entity.other4}</if>
<if test="ew.entity.other5!=null"> AND OTHER_5=#{ew.entity.other5}</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 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>
<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_PRINT_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.category!=null"> AND CATEGORY=#{ew.entity.category}</if>
<if test="ew.entity.printName!=null"> AND PRINT_NAME=#{ew.entity.printName}</if>
<if test="ew.entity.printTemplate!=null"> AND PRINT_TEMPLATE=#{ew.entity.printTemplate}</if>
<if test="ew.entity.printParam!=null"> AND PRINT_PARAM=#{ew.entity.printParam}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</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.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if>
<if test="ew.entity.comments!=null"> AND COMMENTS=#{ew.entity.comments}</if>
<if test="ew.entity.other1!=null"> AND OTHER_1=#{ew.entity.other1}</if>
<if test="ew.entity.other2!=null"> AND OTHER_2=#{ew.entity.other2}</if>
<if test="ew.entity.other3!=null"> AND OTHER_3=#{ew.entity.other3}</if>
<if test="ew.entity.other4!=null"> AND OTHER_4=#{ew.entity.other4}</if>
<if test="ew.entity.other5!=null"> AND OTHER_5=#{ew.entity.other5}</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 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>
<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_PRINT_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.category!=null"> AND CATEGORY=#{ew.entity.category}</if>
<if test="ew.entity.printName!=null"> AND PRINT_NAME=#{ew.entity.printName}</if>
<if test="ew.entity.printTemplate!=null"> AND PRINT_TEMPLATE=#{ew.entity.printTemplate}</if>
<if test="ew.entity.printParam!=null"> AND PRINT_PARAM=#{ew.entity.printParam}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</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.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if>
<if test="ew.entity.comments!=null"> AND COMMENTS=#{ew.entity.comments}</if>
<if test="ew.entity.other1!=null"> AND OTHER_1=#{ew.entity.other1}</if>
<if test="ew.entity.other2!=null"> AND OTHER_2=#{ew.entity.other2}</if>
<if test="ew.entity.other3!=null"> AND OTHER_3=#{ew.entity.other3}</if>
<if test="ew.entity.other4!=null"> AND OTHER_4=#{ew.entity.other4}</if>
<if test="ew.entity.other5!=null"> AND OTHER_5=#{ew.entity.other5}</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 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>
<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_PRINT_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.category!=null"> AND CATEGORY=#{ew.entity.category}</if>
<if test="ew.entity.printName!=null"> AND PRINT_NAME=#{ew.entity.printName}</if>
<if test="ew.entity.printTemplate!=null"> AND PRINT_TEMPLATE=#{ew.entity.printTemplate}</if>
<if test="ew.entity.printParam!=null"> AND PRINT_PARAM=#{ew.entity.printParam}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</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.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if>
<if test="ew.entity.comments!=null"> AND COMMENTS=#{ew.entity.comments}</if>
<if test="ew.entity.other1!=null"> AND OTHER_1=#{ew.entity.other1}</if>
<if test="ew.entity.other2!=null"> AND OTHER_2=#{ew.entity.other2}</if>
<if test="ew.entity.other3!=null"> AND OTHER_3=#{ew.entity.other3}</if>
<if test="ew.entity.other4!=null"> AND OTHER_4=#{ew.entity.other4}</if>
<if test="ew.entity.other5!=null"> AND OTHER_5=#{ew.entity.other5}</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 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>
<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_PRINT_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.category!=null"> AND CATEGORY=#{ew.entity.category}</if>
<if test="ew.entity.printName!=null"> AND PRINT_NAME=#{ew.entity.printName}</if>
<if test="ew.entity.printTemplate!=null"> AND PRINT_TEMPLATE=#{ew.entity.printTemplate}</if>
<if test="ew.entity.printParam!=null"> AND PRINT_PARAM=#{ew.entity.printParam}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</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.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if>
<if test="ew.entity.comments!=null"> AND COMMENTS=#{ew.entity.comments}</if>
<if test="ew.entity.other1!=null"> AND OTHER_1=#{ew.entity.other1}</if>
<if test="ew.entity.other2!=null"> AND OTHER_2=#{ew.entity.other2}</if>
<if test="ew.entity.other3!=null"> AND OTHER_3=#{ew.entity.other3}</if>
<if test="ew.entity.other4!=null"> AND OTHER_4=#{ew.entity.other4}</if>
<if test="ew.entity.other5!=null"> AND OTHER_5=#{ew.entity.other5}</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 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>
<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.common.model.PrintLog">
INSERT INTO Z_PRINT_LOG
<trim prefix="(" suffix=")" suffixOverrides=",">
HANDLE,
<if test="site!=null">SITE,</if>
<if test="category!=null">CATEGORY,</if>
<if test="printName!=null">PRINT_NAME,</if>
<if test="printTemplate!=null">PRINT_TEMPLATE,</if>
<if test="printParam!=null">PRINT_PARAM,</if>
<if test="sfc!=null">SFC,</if>
<if test="resrce!=null">RESRCE,</if>
<if test="stepId!=null">STEP_ID,</if>
<if test="operation!=null">OPERATION,</if>
<if test="inventory!=null">INVENTORY,</if>
<if test="comments!=null">COMMENTS,</if>
<if test="other1!=null">OTHER_1,</if>
<if test="other2!=null">OTHER_2,</if>
<if test="other3!=null">OTHER_3,</if>
<if test="other4!=null">OTHER_4,</if>
<if test="other5!=null">OTHER_5,</if>
<if test="createUser!=null">CREATE_USER,</if>
<if test="createdDateTime!=null">CREATED_DATE_TIME,</if>
<if test="modifyUser!=null">MODIFY_USER,</if>
<if test="modifiedDateTime!=null">MODIFIED_DATE_TIME,</if>
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
<if test="site!=null">#{site},</if>
<if test="category!=null">#{category},</if>
<if test="printName!=null">#{printName},</if>
<if test="printTemplate!=null">#{printTemplate},</if>
<if test="printParam!=null">#{printParam},</if>
<if test="sfc!=null">#{sfc},</if>
<if test="resrce!=null">#{resrce},</if>
<if test="stepId!=null">#{stepId},</if>
<if test="operation!=null">#{operation},</if>
<if test="inventory!=null">#{inventory},</if>
<if test="comments!=null">#{comments},</if>
<if test="other1!=null">#{other1},</if>
<if test="other2!=null">#{other2},</if>
<if test="other3!=null">#{other3},</if>
<if test="other4!=null">#{other4},</if>
<if test="other5!=null">#{other5},</if>
<if test="createUser!=null">#{createUser},</if>
<if test="createdDateTime!=null">#{createdDateTime},</if>
<if test="modifyUser!=null">#{modifyUser},</if>
<if test="modifiedDateTime!=null">#{modifiedDateTime},</if>
</trim>
</insert>
<insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.common.model.PrintLog">
INSERT INTO Z_PRINT_LOG
<trim prefix="(" suffix=")" suffixOverrides=",">
<include refid="Base_Column_List"></include>
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
#{site},
#{category},
#{printName},
#{printTemplate},
#{printParam},
#{sfc},
#{resrce},
#{stepId},
#{operation},
#{inventory},
#{comments},
#{other1},
#{other2},
#{other3},
#{other4},
#{other5},
#{createUser},
#{createdDateTime},
#{modifyUser},
#{modifiedDateTime},
</trim>
</insert>
<update id="updateById">
UPDATE Z_PRINT_LOG <trim prefix="SET" suffixOverrides=",">
<if test="et.site!=null">SITE=#{et.site},</if>
<if test="et.category!=null">CATEGORY=#{et.category},</if>
<if test="et.printName!=null">PRINT_NAME=#{et.printName},</if>
<if test="et.printTemplate!=null">PRINT_TEMPLATE=#{et.printTemplate},</if>
<if test="et.printParam!=null">PRINT_PARAM=#{et.printParam},</if>
<if test="et.sfc!=null">SFC=#{et.sfc},</if>
<if test="et.resrce!=null">RESRCE=#{et.resrce},</if>
<if test="et.stepId!=null">STEP_ID=#{et.stepId},</if>
<if test="et.operation!=null">OPERATION=#{et.operation},</if>
<if test="et.inventory!=null">INVENTORY=#{et.inventory},</if>
<if test="et.comments!=null">COMMENTS=#{et.comments},</if>
<if test="et.other1!=null">OTHER_1=#{et.other1},</if>
<if test="et.other2!=null">OTHER_2=#{et.other2},</if>
<if test="et.other3!=null">OTHER_3=#{et.other3},</if>
<if test="et.other4!=null">OTHER_4=#{et.other4},</if>
<if test="et.other5!=null">OTHER_5=#{et.other5},</if>
<if test="et.createUser!=null">CREATE_USER=#{et.createUser},</if>
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
<if test="et.modifyUser!=null">MODIFY_USER=#{et.modifyUser},</if>
<if test="et.modifiedDateTime!=null">MODIFIED_DATE_TIME=#{et.modifiedDateTime},</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_PRINT_LOG <trim prefix="SET" suffixOverrides=",">
SITE=#{et.site},
CATEGORY=#{et.category},
PRINT_NAME=#{et.printName},
PRINT_TEMPLATE=#{et.printTemplate},
PRINT_PARAM=#{et.printParam},
SFC=#{et.sfc},
RESRCE=#{et.resrce},
STEP_ID=#{et.stepId},
OPERATION=#{et.operation},
INVENTORY=#{et.inventory},
COMMENTS=#{et.comments},
OTHER_1=#{et.other1},
OTHER_2=#{et.other2},
OTHER_3=#{et.other3},
OTHER_4=#{et.other4},
OTHER_5=#{et.other5},
CREATE_USER=#{et.createUser},
CREATED_DATE_TIME=#{et.createdDateTime},
MODIFY_USER=#{et.modifyUser},
MODIFIED_DATE_TIME=#{et.modifiedDateTime},
</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_PRINT_LOG <trim prefix="SET" suffixOverrides=",">
<if test="et.site!=null">SITE=#{et.site},</if>
<if test="et.category!=null">CATEGORY=#{et.category},</if>
<if test="et.printName!=null">PRINT_NAME=#{et.printName},</if>
<if test="et.printTemplate!=null">PRINT_TEMPLATE=#{et.printTemplate},</if>
<if test="et.printParam!=null">PRINT_PARAM=#{et.printParam},</if>
<if test="et.sfc!=null">SFC=#{et.sfc},</if>
<if test="et.resrce!=null">RESRCE=#{et.resrce},</if>
<if test="et.stepId!=null">STEP_ID=#{et.stepId},</if>
<if test="et.operation!=null">OPERATION=#{et.operation},</if>
<if test="et.inventory!=null">INVENTORY=#{et.inventory},</if>
<if test="et.comments!=null">COMMENTS=#{et.comments},</if>
<if test="et.other1!=null">OTHER_1=#{et.other1},</if>
<if test="et.other2!=null">OTHER_2=#{et.other2},</if>
<if test="et.other3!=null">OTHER_3=#{et.other3},</if>
<if test="et.other4!=null">OTHER_4=#{et.other4},</if>
<if test="et.other5!=null">OTHER_5=#{et.other5},</if>
<if test="et.createUser!=null">CREATE_USER=#{et.createUser},</if>
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
<if test="et.modifyUser!=null">MODIFY_USER=#{et.modifyUser},</if>
<if test="et.modifiedDateTime!=null">MODIFIED_DATE_TIME=#{et.modifiedDateTime},</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.category!=null"> AND CATEGORY=#{ew.entity.category}</if>
<if test="ew.entity.printName!=null"> AND PRINT_NAME=#{ew.entity.printName}</if>
<if test="ew.entity.printTemplate!=null"> AND PRINT_TEMPLATE=#{ew.entity.printTemplate}</if>
<if test="ew.entity.printParam!=null"> AND PRINT_PARAM=#{ew.entity.printParam}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</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.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if>
<if test="ew.entity.comments!=null"> AND COMMENTS=#{ew.entity.comments}</if>
<if test="ew.entity.other1!=null"> AND OTHER_1=#{ew.entity.other1}</if>
<if test="ew.entity.other2!=null"> AND OTHER_2=#{ew.entity.other2}</if>
<if test="ew.entity.other3!=null"> AND OTHER_3=#{ew.entity.other3}</if>
<if test="ew.entity.other4!=null"> AND OTHER_4=#{ew.entity.other4}</if>
<if test="ew.entity.other5!=null"> AND OTHER_5=#{ew.entity.other5}</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 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>
<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_PRINT_LOG WHERE HANDLE=#{handle}
</delete>
<delete id="deleteByMap">
DELETE FROM Z_PRINT_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_PRINT_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.category!=null"> AND CATEGORY=#{ew.entity.category}</if>
<if test="ew.entity.printName!=null"> AND PRINT_NAME=#{ew.entity.printName}</if>
<if test="ew.entity.printTemplate!=null"> AND PRINT_TEMPLATE=#{ew.entity.printTemplate}</if>
<if test="ew.entity.printParam!=null"> AND PRINT_PARAM=#{ew.entity.printParam}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</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.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if>
<if test="ew.entity.comments!=null"> AND COMMENTS=#{ew.entity.comments}</if>
<if test="ew.entity.other1!=null"> AND OTHER_1=#{ew.entity.other1}</if>
<if test="ew.entity.other2!=null"> AND OTHER_2=#{ew.entity.other2}</if>
<if test="ew.entity.other3!=null"> AND OTHER_3=#{ew.entity.other3}</if>
<if test="ew.entity.other4!=null"> AND OTHER_4=#{ew.entity.other4}</if>
<if test="ew.entity.other5!=null"> AND OTHER_5=#{ew.entity.other5}</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 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>
<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_PRINT_LOG WHERE HANDLE IN (
<foreach item="item" index="index" collection="coll" separator=",">#{item}
</foreach>)
</delete>
<!-- BaseMapper标准查询/修改/删除 -->
</mapper>

@ -31,3 +31,7 @@ ftp:
username: zjw
password: zhaojiawei
#打印服务器配置
print:
server: http://localhost:8080/CodeSoftPrintWeb/printService

@ -1,5 +1,6 @@
package com.foreverwin.mesnac.dispatch.controller;
import cn.hutool.core.date.DateUtil;
import com.foreverwin.mesnac.common.util.StringUtil;
import com.foreverwin.mesnac.dispatch.dto.IssueItemDto;
import com.foreverwin.modular.core.exception.BusinessException;
@ -41,6 +42,12 @@ public class CallItemController {
List<CallItem> result;
try {
callItem.setSite(CommonMethods.getSite());
if (callItem.getStartFromDate_S() != null) {
callItem.setStartFromDate(DateUtil.parse(callItem.getStartFromDate_S()));
}
if (callItem.getStartToDate_S() != null) {
callItem.setStartToDate(DateUtil.parse(callItem.getStartToDate_S()));
}
result = callItemService.findCallItemList(callItem);
} catch (Exception e) {
return R.failed(e.getMessage());
@ -61,6 +68,12 @@ public class CallItemController {
List<CallItem> result;
try {
callItem.setSite(CommonMethods.getSite());
if (callItem.getStartFromDate_S() != null) {
callItem.setStartFromDate(DateUtil.parse(callItem.getStartFromDate_S()));
}
if (callItem.getStartToDate_S() != null) {
callItem.setStartToDate(DateUtil.parse(callItem.getStartToDate_S()));
}
result = callItemService.findCallItemDetailList(callItem);
} catch (Exception e) {
return R.failed(e.getMessage());

@ -10,6 +10,8 @@ import java.math.BigDecimal;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
/**
@ -150,6 +152,8 @@ public class CallItem extends Model<CallItem> {
@TableField(exist = false)
private String workOrder;
@TableField(exist = false)
private String itemNumber;
@TableField(exist = false)
private String workCenter;
@TableField(exist = false)
private String dispatchNo;
@ -165,6 +169,22 @@ public class CallItem extends Model<CallItem> {
private LocalDateTime plannedStartDate;
@TableField(exist = false)
private String remark;
@TableField(exist = false)
private String startFromDate_S;
@TableField(exist = false)
private String startToDate_S;
@TableField(exist = false)
private Date startFromDate;
@TableField(exist = false)
private Date startToDate;
@TableField(exist = false)
private String requireFromDate_S;
@TableField(exist = false)
private String requireToDate_S;
@TableField(exist = false)
private Date requireFromDate;
@TableField(exist = false)
private Date requireToDate;
public String getHandle() {
return handle;
@ -398,6 +418,14 @@ public class CallItem extends Model<CallItem> {
this.workOrder = workOrder;
}
public String getItemNumber() {
return itemNumber;
}
public void setItemNumber(String itemNumber) {
this.itemNumber = itemNumber;
}
public String getWorkCenter() {
return workCenter;
}
@ -462,6 +490,70 @@ public class CallItem extends Model<CallItem> {
this.remark = remark;
}
public String getStartFromDate_S() {
return startFromDate_S;
}
public void setStartFromDate_S(String startFromDate_S) {
this.startFromDate_S = startFromDate_S;
}
public String getStartToDate_S() {
return startToDate_S;
}
public void setStartToDate_S(String startToDate_S) {
this.startToDate_S = startToDate_S;
}
public Date getStartFromDate() {
return startFromDate;
}
public void setStartFromDate(Date startFromDate) {
this.startFromDate = startFromDate;
}
public Date getStartToDate() {
return startToDate;
}
public void setStartToDate(Date startToDate) {
this.startToDate = startToDate;
}
public String getRequireFromDate_S() {
return requireFromDate_S;
}
public void setRequireFromDate_S(String requireFromDate_S) {
this.requireFromDate_S = requireFromDate_S;
}
public String getRequireToDate_S() {
return requireToDate_S;
}
public void setRequireToDate_S(String requireToDate_S) {
this.requireToDate_S = requireToDate_S;
}
public Date getRequireFromDate() {
return requireFromDate;
}
public void setRequireFromDate(Date requireFromDate) {
this.requireFromDate = requireFromDate;
}
public Date getRequireToDate() {
return requireToDate;
}
public void setRequireToDate(Date requireToDate) {
this.requireToDate = requireToDate;
}
public static final String HANDLE = "HANDLE";
public static final String SITE = "SITE";

@ -34,6 +34,7 @@
<result column="EMPLOYEE" property="employee" />
<result column="SOURCE_RESOURCE" property="sourceResource" />
<result column="WORK_ORDER" property="workOrder" />
<result column="ITEM_NUMBER" property="itemNumber" />
<result column="WORK_CENTER" property="workCenter" />
<result column="DISPATCH_NO" property="dispatchNo" />
<result column="DISPATCH_QTY" property="dispatchQty" />
@ -629,54 +630,71 @@
</select>
<select id="findCallItemList" resultMap="FullResultMap">
SELECT ZCI.HANDLE, ZCI.SITE, CF.VALUE WORK_ORDER, ZSD.WORK_CENTER, ZSD.SHOP_ORDER, ZSD.SFC, ZSD.DISPATCH_NO, IT.ITEM, ITT.DESCRIPTION ITEM_DESCRIPTION, ZSD.BLANKING_SIZE,
ZSD.STEP_ID, ZCI.SFC_DISPATCH_BO, ZSD.DISPATCH_STATUS, ZCI.OPERATION, OPT.DESCRIPTION OPERATION_DESCRIPTION, ZSD.RESOURCE_TYPE, ZCI.RESRCE, ZSD.DISPATCH_QTY, ZSD.PLANNED_START_DATE, ZSD.REMARK,
CASE WHEN VP.NEWS = '1' AND VP.CALLES = '0' AND VP.ISSUED = '0' THEN N'未叫料'
WHEN VP.NEWS = '0' AND (VP.CALLES = '1' OR VP.ISSUED = '1') THEN N'全部推送'
ELSE N'部分推送' END CALL_STATUS,
CASE WHEN (VP.NEWS = '1' OR VP.CALLES = '1') AND VP.ISSUED = '0' THEN N'未发料'
WHEN VP.NEWS = '0' AND VP.CALLES = '0' AND VP.ISSUED = '1' THEN N'发料完成'
ELSE N'部分发料' END ISSUE_STATUS
FROM Z_SFC_DISPATCH ZSD
INNER JOIN Z_CALL_ITEM ZCI ON ZCI.SFC_DISPATCH_BO = ZSD.HANDLE
INNER JOIN SHOP_ORDER SO ON SO.SITE = ZSD.SITE AND ZSD.SHOP_ORDER = SO.SHOP_ORDER
LEFT JOIN CUSTOM_FIELDS CF ON CF.HANDLE = SO.HANDLE AND CF.ATTRIBUTE = 'WORK_ORDER'
INNER JOIN ITEM IT ON IT.HANDLE = SO.ITEM_BO
LEFT JOIN ITEM_T ITT ON ITT.ITEM_BO = IT.HANDLE AND ITT.LOCALE = 'zh'
INNER JOIN OPERATION OP ON OP.SITE = ZCI.SITE AND OP.OPERATION = ZCI.OPERATION AND OP.CURRENT_REVISION = 'true'
LEFT JOIN OPERATION_T OPT ON OPT.OPERATION_BO = OP.HANDLE AND OPT.LOCALE = 'zh'
LEFT JOIN (
SELECT SFC_DISPATCH_BO,
MAX(DECODE(STATUS, '801', '1', '0')) NEWS,
MAX(DECODE(STATUS, '802', '1', '0')) CALLES,
MAX(DECODE(STATUS, '803', '1', '0')) ISSUED,
MAX(DECODE(STATUS, '804', '1', '0')) CANCELED
FROM Z_CALL_ITEM
GROUP BY SFC_DISPATCH_BO
) VP ON VP.SFC_DISPATCH_BO = ZCI.SFC_DISPATCH_BO
WHERE ZSD.SITE = #{site}
<if test="workCenter != null and workCenter != ''">
AND ZSD.WORK_CENTER = #{workCenter}
</if>
<if test="dispatchStatus != null and dispatchStatus != ''">
AND ZSD.DISPATCH_STATUS = #{dispatchStatus}
</if>
<if test="workOrder != null and workOrder != ''">
AND CF.VALUE LIKE '%' ||#{workOrder}|| '%'
</if>
<if test="shopOrder != null and shopOrder != ''">
AND SO.SHOP_ORDER = #{shopOrder}
</if>
<if test="resourceType != null and resourceType != ''">
AND ZSD.RESOURCE_TYPE = #{resourceType}
SELECT *
FROM (
SELECT ZCI.SITE, CF.VALUE WORK_ORDER, CS.VALUE ITEM_NUMBER, ZSD.WORK_CENTER, ZSD.SHOP_ORDER, ZSD.SFC, ZSD.DISPATCH_NO, IT.ITEM, ITT.DESCRIPTION ITEM_DESCRIPTION, ZSD.BLANKING_SIZE,
ZSD.STEP_ID, ZCI.SFC_DISPATCH_BO, ZSD.DISPATCH_STATUS, ZCI.OPERATION, OPT.DESCRIPTION OPERATION_DESCRIPTION, ZSD.RESOURCE_TYPE, ZCI.RESRCE, ZSD.DISPATCH_QTY, ZSD.PLANNED_START_DATE, ZSD.REMARK,
CASE WHEN VP.NEWS = '1' AND VP.CALLES = '0' AND VP.ISSUED = '0' THEN 'NONE'
WHEN VP.NEWS = '0' AND (VP.CALLES = '1' OR VP.ISSUED = '1') THEN 'ALL'
ELSE 'PART' END CALL_STATUS,
CASE WHEN (VP.NEWS = '1' OR VP.CALLES = '1') AND VP.ISSUED = '0' THEN 'NONE'
WHEN VP.NEWS = '0' AND VP.CALLES = '0' AND VP.ISSUED = '1' THEN 'ALL'
ELSE 'ALL' END ISSUE_STATUS
FROM Z_SFC_DISPATCH ZSD
INNER JOIN Z_CALL_ITEM ZCI ON ZCI.SFC_DISPATCH_BO = ZSD.HANDLE
INNER JOIN SHOP_ORDER SO ON SO.SITE = ZSD.SITE AND ZSD.SHOP_ORDER = SO.SHOP_ORDER
LEFT JOIN CUSTOM_FIELDS CF ON CF.HANDLE = SO.HANDLE AND CF.ATTRIBUTE = 'WORK_ORDER'
LEFT JOIN CUSTOM_FIELDS CS ON CS.HANDLE = SO.HANDLE AND CS.ATTRIBUTE = 'ITEM_NUMBER'
INNER JOIN ITEM IT ON IT.HANDLE = SO.ITEM_BO
LEFT JOIN ITEM_T ITT ON ITT.ITEM_BO = IT.HANDLE AND ITT.LOCALE = 'zh'
INNER JOIN OPERATION OP ON OP.SITE = ZCI.SITE AND OP.OPERATION = ZCI.OPERATION AND OP.CURRENT_REVISION = 'true'
LEFT JOIN OPERATION_T OPT ON OPT.OPERATION_BO = OP.HANDLE AND OPT.LOCALE = 'zh'
LEFT JOIN (
SELECT SFC_DISPATCH_BO,
MAX(DECODE(STATUS, '801', '1', '0')) NEWS,
MAX(DECODE(STATUS, '802', '1', '0')) CALLES,
MAX(DECODE(STATUS, '803', '1', '0')) ISSUED,
MAX(DECODE(STATUS, '804', '1', '0')) CANCELED
FROM Z_CALL_ITEM
GROUP BY SFC_DISPATCH_BO
) VP ON VP.SFC_DISPATCH_BO = ZCI.SFC_DISPATCH_BO
WHERE ZSD.SITE = #{site}
<if test="workCenter != null and workCenter != ''">
AND ZSD.WORK_CENTER = #{workCenter}
</if>
<if test="dispatchStatus != null and dispatchStatus != ''">
AND ZSD.DISPATCH_STATUS = #{dispatchStatus}
</if>
<if test="workOrder != null and workOrder != ''">
AND CF.VALUE LIKE '%' ||#{workOrder}|| '%'
</if>
<if test="shopOrder != null and shopOrder != ''">
AND SO.SHOP_ORDER = #{shopOrder}
</if>
<if test="resourceType != null and resourceType != ''">
AND ZSD.RESOURCE_TYPE = #{resourceType}
</if>
<if test="resrce != null and resrce != ''">
AND ZCI.RESRCE = #{resrce}
</if>
<if test="startFromDate != null">
AND ZSD.PLANNED_START_DATE >= #{startFromDate}
</if>
<if test="startToDate != null">
AND ZSD.PLANNED_START_DATE &lt;= #{startToDate}
</if>
GROUP BY ZCI.SITE, CF.VALUE, CS.VALUE, ZSD.WORK_CENTER, ZSD.SHOP_ORDER, ZSD.SFC, ZSD.DISPATCH_NO, IT.ITEM, ITT.DESCRIPTION, ZSD.BLANKING_SIZE,
ZSD.STEP_ID, ZCI.SFC_DISPATCH_BO, ZSD.DISPATCH_STATUS, ZCI.OPERATION, OPT.DESCRIPTION, ZSD.RESOURCE_TYPE, ZCI.RESRCE, ZSD.DISPATCH_QTY, ZSD.PLANNED_START_DATE, ZSD.REMARK,
VP.NEWS, VP.CALLES, VP.ISSUED, VP.CANCELED
)
WHERE 1= 1
<if test="callStatus != null and callStatus != ''">
AND CALL_STATUS = #{callStatus}
</if>
<if test="resrce != null and resrce != ''">
AND ZCI.RESRCE = #{resrce}
<if test="issueStatus != null and issueStatus != ''">
AND ISSUE_STATUS = #{issueStatus}
</if>
GROUP BY ZCI.HANDLE, ZCI.SITE, CF.VALUE, ZSD.WORK_CENTER, ZSD.SHOP_ORDER, ZSD.SFC, ZSD.DISPATCH_NO, IT.ITEM, ITT.DESCRIPTION, ZSD.BLANKING_SIZE,
ZSD.STEP_ID, ZCI.SFC_DISPATCH_BO, ZSD.DISPATCH_STATUS, ZCI.OPERATION, OPT.DESCRIPTION, ZSD.RESOURCE_TYPE, ZCI.RESRCE, ZSD.DISPATCH_QTY, ZSD.PLANNED_START_DATE, ZSD.REMARK,
VP.NEWS, VP.CALLES, VP.ISSUED, VP.CANCELED
ORDER BY ZSD.SFC, ZSD.STEP_ID
ORDER BY SFC, STEP_ID
</select>
<select id="findCallItemDetailList" resultMap="FullResultMap">
@ -742,6 +760,18 @@
<if test="callType != null and callType != ''" >
AND ZCI.CALL_TYPE = #{callType}
</if>
<if test="startFromDate != null">
AND ZSD.PLANNED_START_DATE >= #{startFromDate}
</if>
<if test="startToDate != null">
AND ZSD.PLANNED_START_DATE &lt;= #{startToDate}
</if>
<if test="requireFromDate != null">
AND ZCI.REQUIRED_DATE_TIME >= #{requireFromDate}
</if>
<if test="requireToDate != null">
AND ZCI.REQUIRED_DATE_TIME &lt;= #{requireToDate}
</if>
ORDER BY ZSD.SFC, ZSD.STEP_ID, ZCI.CALL_TYPE
</select>

Loading…
Cancel
Save