yinq 9 months ago
commit eba8e3c1a7

@ -5,6 +5,7 @@ import com.hw.common.core.constant.ServiceNameConstants;
import com.hw.common.core.domain.R;
import com.hw.mes.api.domain.MesBaseBarcodeInfo;
import com.hw.mes.api.domain.MesBaseMaterialInfo;
import com.hw.mes.api.domain.MesBaseStationInfo;
import com.hw.mes.api.domain.vo.MesBaseMaterialInfoVo;
import com.hw.mes.api.factory.RemoteMesFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
@ -36,4 +37,15 @@ public interface RemoteMesService {
@PostMapping("/materialinfo/getMaterialsByMaterialIds")
public R<List<MesBaseMaterialInfo>> getMaterialsByMaterialIds(@RequestBody MesBaseMaterialInfoVo mesBaseMaterialInfo, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
/**
*
*
* @param source
* @return
*/
@GetMapping("/baseStationInfo/getStations")
public R<List<MesBaseStationInfo>> getStations(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}

@ -0,0 +1,145 @@
package com.hw.mes.api.domain;
import com.hw.common.core.annotation.Excel;
import com.hw.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* mes_base_station_info
*
* @author Yinq
* @date 2024-01-26
*/
public class MesBaseStationInfo extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
*
*/
private Long stationId;
/**
*
*/
@Excel(name = "工位编号")
private String stationCode;
/**
*
*/
@Excel(name = "工位名称")
private String stationName;
/**
*
*/
@Excel(name = "所属工序编号")
private Long processId;
/**
*
*/
@Excel(name = "所属工序名称")
private String processName;
/**
*
*/
@Excel(name = "楼层")
private Long floor;
/**
*
*/
@Excel(name = "单位生产时间")
private Long productionTime;
/**
*
*/
@Excel(name = "激活标识")
private String activeFlag;
public String getProcessName() {
return processName;
}
public void setProcessName(String processName) {
this.processName = processName;
}
public void setStationId(Long stationId) {
this.stationId = stationId;
}
public Long getStationId() {
return stationId;
}
public void setStationCode(String stationCode) {
this.stationCode = stationCode;
}
public String getStationCode() {
return stationCode;
}
public void setStationName(String stationName) {
this.stationName = stationName;
}
public String getStationName() {
return stationName;
}
public void setProcessId(Long processId) {
this.processId = processId;
}
public Long getProcessId() {
return processId;
}
public void setFloor(Long floor) {
this.floor = floor;
}
public Long getFloor() {
return floor;
}
public void setProductionTime(Long productionTime) {
this.productionTime = productionTime;
}
public Long getProductionTime() {
return productionTime;
}
public void setActiveFlag(String activeFlag) {
this.activeFlag = activeFlag;
}
public String getActiveFlag() {
return activeFlag;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("stationId", getStationId())
.append("stationCode", getStationCode())
.append("stationName", getStationName())
.append("processId", getProcessId())
.append("floor", getFloor())
.append("productionTime", getProductionTime())
.append("activeFlag", getActiveFlag())
.append("remark", getRemark())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

@ -4,6 +4,7 @@ import com.hw.common.core.domain.R;
import com.hw.mes.api.RemoteMesService;
import com.hw.mes.api.domain.MesBaseBarcodeInfo;
import com.hw.mes.api.domain.MesBaseMaterialInfo;
import com.hw.mes.api.domain.MesBaseStationInfo;
import com.hw.mes.api.domain.vo.MesBaseMaterialInfoVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -34,6 +35,11 @@ public class RemoteMesFallbackFactory implements FallbackFactory<RemoteMesServic
public R<List<MesBaseMaterialInfo>> getMaterialsByMaterialIds(MesBaseMaterialInfoVo mesBaseMaterialInfo, String source) {
return R.fail("获取物料信息失败:" + throwable.getMessage());
}
@Override
public R<List<MesBaseStationInfo>> getStations(String source) {
return R.fail("获取工位列表信息失败:" + throwable.getMessage());
}
};
}
}

@ -1,11 +1,12 @@
package com.hw.auth.controller;
import javax.servlet.http.HttpServletRequest;
import com.hw.common.core.constant.SecurityConstants;
import com.hw.mes.api.RemoteMesService;
import com.hw.mes.api.domain.MesBaseStationInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.hw.auth.form.LoginBody;
import com.hw.auth.form.RegisterBody;
import com.hw.auth.service.SysLoginService;
@ -17,6 +18,8 @@ import com.hw.common.security.service.TokenService;
import com.hw.common.security.utils.SecurityUtils;
import com.hw.system.api.model.LoginUser;
import java.util.List;
/**
* token
*
@ -31,6 +34,9 @@ public class TokenController
@Autowired
private SysLoginService sysLoginService;
@Autowired
private RemoteMesService remoteMesService;
@PostMapping("login")
public R<?> login(@RequestBody LoginBody form)
{
@ -85,4 +91,17 @@ public class TokenController
// 获取登录token
return R.ok(tokenService.createToken(userInfo));
}
/**
*
* @return
*/
@GetMapping("getStations")
public R<?> getStations()
{
R<List<MesBaseStationInfo>> resultR = remoteMesService.getStations(SecurityConstants.INNER);
return R.ok(resultR.getData());
}
}

@ -146,7 +146,7 @@ public class TdEngineConstants {
* @param monitorId
* @return String
*/
public static String getEmsTableName(Long monitorId){
public static String getEmsTableName(String monitorId){
return EMS_TABLE_NAME_PREFIX + monitorId;
}

@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* BOMController
* MESController
*
* @author Yinq
* @date 2024-01-30

@ -3,7 +3,9 @@ package com.hw.mes.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.hw.common.security.annotation.InnerAuth;
import com.hw.common.security.utils.SecurityUtils;
import com.hw.mes.api.domain.MesBaseStationInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -16,7 +18,6 @@ import org.springframework.web.bind.annotation.RestController;
import com.hw.common.log.annotation.Log;
import com.hw.common.log.enums.BusinessType;
import com.hw.common.security.annotation.RequiresPermissions;
import com.hw.mes.domain.MesBaseStationInfo;
import com.hw.mes.service.IMesBaseStationInfoService;
import com.hw.common.core.web.controller.BaseController;
import com.hw.common.core.web.domain.AjaxResult;
@ -25,7 +26,7 @@ import com.hw.common.core.web.page.TableDataInfo;
/**
* Controller
*
*
* @author Yinq
* @date 2024-01-26
*/
@ -105,4 +106,19 @@ public class MesBaseStationInfoController extends BaseController
{
return toAjax(mesBaseStationInfoService.deleteMesBaseStationInfoByStationIds(stationIds));
}
/**
*
*/
@InnerAuth
@GetMapping("/getStations")
public AjaxResult getStations(MesBaseStationInfo mesBaseStationInfo)
{
List<MesBaseStationInfo> list = mesBaseStationInfoService.selectMesBaseStationInfoList(mesBaseStationInfo);
return success(list);
}
}

@ -0,0 +1,23 @@
package com.hw.mes.controller;
import com.hw.common.core.web.controller.BaseController;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* MES线Controller
*
* @author Yinq
* @date 2024-01-30
*/
@RestController
@RequestMapping("/pl")
public class MesProductionLineController extends BaseController
{
}

@ -1,145 +1,145 @@
package com.hw.mes.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.hw.common.core.annotation.Excel;
import com.hw.common.core.web.domain.BaseEntity;
/**
* mes_base_station_info
*
* @author Yinq
* @date 2024-01-26
*/
public class MesBaseStationInfo extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
*
*/
private Long stationId;
/**
*
*/
@Excel(name = "工位编号")
private String stationCode;
/**
*
*/
@Excel(name = "工位名称")
private String stationName;
/**
*
*/
@Excel(name = "所属工序编号")
private Long processId;
/**
*
*/
@Excel(name = "所属工序名称")
private String processName;
/**
*
*/
@Excel(name = "楼层")
private Long floor;
/**
*
*/
@Excel(name = "单位生产时间")
private Long productionTime;
/**
*
*/
@Excel(name = "激活标识")
private String activeFlag;
public String getProcessName() {
return processName;
}
public void setProcessName(String processName) {
this.processName = processName;
}
public void setStationId(Long stationId) {
this.stationId = stationId;
}
public Long getStationId() {
return stationId;
}
public void setStationCode(String stationCode) {
this.stationCode = stationCode;
}
public String getStationCode() {
return stationCode;
}
public void setStationName(String stationName) {
this.stationName = stationName;
}
public String getStationName() {
return stationName;
}
public void setProcessId(Long processId) {
this.processId = processId;
}
public Long getProcessId() {
return processId;
}
public void setFloor(Long floor) {
this.floor = floor;
}
public Long getFloor() {
return floor;
}
public void setProductionTime(Long productionTime) {
this.productionTime = productionTime;
}
public Long getProductionTime() {
return productionTime;
}
public void setActiveFlag(String activeFlag) {
this.activeFlag = activeFlag;
}
public String getActiveFlag() {
return activeFlag;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("stationId", getStationId())
.append("stationCode", getStationCode())
.append("stationName", getStationName())
.append("processId", getProcessId())
.append("floor", getFloor())
.append("productionTime", getProductionTime())
.append("activeFlag", getActiveFlag())
.append("remark", getRemark())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}
//package com.hw.mes.domain;
//
//import org.apache.commons.lang3.builder.ToStringBuilder;
//import org.apache.commons.lang3.builder.ToStringStyle;
//import com.hw.common.core.annotation.Excel;
//import com.hw.common.core.web.domain.BaseEntity;
//
///**
// * 工位信息对象 mes_base_station_info
// *
// * @author Yinq
// * @date 2024-01-26
// */
//public class MesBaseStationInfo extends BaseEntity {
// private static final long serialVersionUID = 1L;
//
// /**
// * 主键标识
// */
// private Long stationId;
//
// /**
// * 工位编号
// */
// @Excel(name = "工位编号")
// private String stationCode;
//
// /**
// * 工位名称
// */
// @Excel(name = "工位名称")
// private String stationName;
//
// /**
// * 所属工序编号
// */
// @Excel(name = "所属工序编号")
// private Long processId;
//
// /**
// * 所属工序名称
// */
// @Excel(name = "所属工序名称")
// private String processName;
//
// /**
// * 楼层
// */
// @Excel(name = "楼层")
// private Long floor;
//
// /**
// * 单位生产时间
// */
// @Excel(name = "单位生产时间")
// private Long productionTime;
//
// /**
// * 激活标识
// */
// @Excel(name = "激活标识")
// private String activeFlag;
//
// public String getProcessName() {
// return processName;
// }
//
// public void setProcessName(String processName) {
// this.processName = processName;
// }
//
// public void setStationId(Long stationId) {
// this.stationId = stationId;
// }
//
// public Long getStationId() {
// return stationId;
// }
//
// public void setStationCode(String stationCode) {
// this.stationCode = stationCode;
// }
//
// public String getStationCode() {
// return stationCode;
// }
//
// public void setStationName(String stationName) {
// this.stationName = stationName;
// }
//
// public String getStationName() {
// return stationName;
// }
//
// public void setProcessId(Long processId) {
// this.processId = processId;
// }
//
// public Long getProcessId() {
// return processId;
// }
//
// public void setFloor(Long floor) {
// this.floor = floor;
// }
//
// public Long getFloor() {
// return floor;
// }
//
// public void setProductionTime(Long productionTime) {
// this.productionTime = productionTime;
// }
//
// public Long getProductionTime() {
// return productionTime;
// }
//
// public void setActiveFlag(String activeFlag) {
// this.activeFlag = activeFlag;
// }
//
// public String getActiveFlag() {
// return activeFlag;
// }
//
// @Override
// public String toString() {
// return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
// .append("stationId", getStationId())
// .append("stationCode", getStationCode())
// .append("stationName", getStationName())
// .append("processId", getProcessId())
// .append("floor", getFloor())
// .append("productionTime", getProductionTime())
// .append("activeFlag", getActiveFlag())
// .append("remark", getRemark())
// .append("createBy", getCreateBy())
// .append("createTime", getCreateTime())
// .append("updateBy", getUpdateBy())
// .append("updateTime", getUpdateTime())
// .toString();
// }
//}

@ -1,19 +1,20 @@
package com.hw.mes.mapper;
import com.hw.mes.api.domain.MesBaseStationInfo;
import java.util.List;
import com.hw.mes.domain.MesBaseStationInfo;
/**
* Mapper
*
*
* @author Yinq
* @date 2024-01-26
*/
public interface MesBaseStationInfoMapper
public interface MesBaseStationInfoMapper
{
/**
*
*
*
* @param stationId
* @return
*/
@ -21,7 +22,7 @@ public interface MesBaseStationInfoMapper
/**
*
*
*
* @param mesBaseStationInfo
* @return
*/
@ -29,7 +30,7 @@ public interface MesBaseStationInfoMapper
/**
*
*
*
* @param mesBaseStationInfo
* @return
*/
@ -37,7 +38,7 @@ public interface MesBaseStationInfoMapper
/**
*
*
*
* @param mesBaseStationInfo
* @return
*/
@ -45,7 +46,7 @@ public interface MesBaseStationInfoMapper
/**
*
*
*
* @param stationId
* @return
*/
@ -53,7 +54,7 @@ public interface MesBaseStationInfoMapper
/**
*
*
*
* @param stationIds
* @return
*/

@ -1,19 +1,20 @@
package com.hw.mes.service;
import com.hw.mes.api.domain.MesBaseStationInfo;
import java.util.List;
import com.hw.mes.domain.MesBaseStationInfo;
/**
* Service
*
*
* @author Yinq
* @date 2024-01-26
*/
public interface IMesBaseStationInfoService
public interface IMesBaseStationInfoService
{
/**
*
*
*
* @param stationId
* @return
*/
@ -21,7 +22,7 @@ public interface IMesBaseStationInfoService
/**
*
*
*
* @param mesBaseStationInfo
* @return
*/
@ -29,7 +30,7 @@ public interface IMesBaseStationInfoService
/**
*
*
*
* @param mesBaseStationInfo
* @return
*/
@ -37,7 +38,7 @@ public interface IMesBaseStationInfoService
/**
*
*
*
* @param mesBaseStationInfo
* @return
*/
@ -45,7 +46,7 @@ public interface IMesBaseStationInfoService
/**
*
*
*
* @param stationIds
* @return
*/
@ -53,7 +54,7 @@ public interface IMesBaseStationInfoService
/**
*
*
*
* @param stationId
* @return
*/

@ -3,27 +3,27 @@ package com.hw.mes.service.impl;
import java.util.List;
import com.hw.common.core.utils.DateUtils;
import com.hw.common.security.utils.SecurityUtils;
import com.hw.mes.api.domain.MesBaseStationInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hw.mes.mapper.MesBaseStationInfoMapper;
import com.hw.mes.domain.MesBaseStationInfo;
import com.hw.mes.service.IMesBaseStationInfoService;
/**
* Service
*
*
* @author Yinq
* @date 2024-01-26
*/
@Service
public class MesBaseStationInfoServiceImpl implements IMesBaseStationInfoService
public class MesBaseStationInfoServiceImpl implements IMesBaseStationInfoService
{
@Autowired
private MesBaseStationInfoMapper mesBaseStationInfoMapper;
/**
*
*
*
* @param stationId
* @return
*/
@ -35,7 +35,7 @@ public class MesBaseStationInfoServiceImpl implements IMesBaseStationInfoService
/**
*
*
*
* @param mesBaseStationInfo
* @return
*/
@ -47,7 +47,7 @@ public class MesBaseStationInfoServiceImpl implements IMesBaseStationInfoService
/**
*
*
*
* @param mesBaseStationInfo
* @return
*/
@ -61,7 +61,7 @@ public class MesBaseStationInfoServiceImpl implements IMesBaseStationInfoService
/**
*
*
*
* @param mesBaseStationInfo
* @return
*/
@ -75,7 +75,7 @@ public class MesBaseStationInfoServiceImpl implements IMesBaseStationInfoService
/**
*
*
*
* @param stationIds
* @return
*/
@ -87,7 +87,7 @@ public class MesBaseStationInfoServiceImpl implements IMesBaseStationInfoService
/**
*
*
*
* @param stationId
* @return
*/

@ -0,0 +1,187 @@
<?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.hw.qms.mapper.MesBaseBarcodeInfoMapper">
<resultMap type="MesBaseBarcodeInfo" id="MesBaseBarcodeInfoResult">
<result property="barcodeId" column="barcode_id" />
<result property="printTime" column="print_time" />
<result property="printPerson" column="print_person" />
<result property="batchFlag" column="batch_flag" />
<result property="barcodeType" column="barcode_type" />
<result property="barcodeInfo" column="barcode_info" />
<result property="batchCode" column="batch_code" />
<result property="palletInfoCode" column="pallet_info_code" />
<result property="materialId" column="material_id" />
<result property="manufacturerId" column="manufacturer_id" />
<result property="amount" column="amount" />
<result property="machineName" column="machine_name" />
<result property="poNo" column="po_no" />
<result property="productionDate" column="production_date" />
<result property="acceptedDate" column="accepted_date" />
<result property="lastOutstockDate" column="last_outstock_date" />
<result property="planCode" column="plan_code" />
<result property="planDetailCode" column="plan_detail_code" />
<result property="saleorderCode" column="saleorder_code" />
<result property="projectNo" column="project_no" />
<result property="serialNumber" column="serial_number" />
<result property="remark" column="remark" />
<result property="bindStatus" column="bind_status" />
<result property="bindBy" column="bind_by" />
<result property="bindTime" column="bind_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectMesBaseBarcodeInfoVo">
select barcode_id, print_time, print_person, batch_flag, barcode_type, barcode_info, batch_code, pallet_info_code, material_id, manufacturer_id, amount, machine_name, po_no, production_date, accepted_date, last_outstock_date, plan_code, plan_detail_code, saleorder_code, project_no, serial_number, remark, bind_status, bind_by, bind_time, update_by, update_time from mes_base_barcode_info
</sql>
<select id="selectMesBaseBarcodeInfoList" parameterType="MesBaseBarcodeInfo" resultMap="MesBaseBarcodeInfoResult">
<include refid="selectMesBaseBarcodeInfoVo"/>
<where>
<if test="printTime != null "> and print_time = #{printTime}</if>
<if test="printPerson != null and printPerson != ''"> and print_person = #{printPerson}</if>
<if test="batchFlag != null and batchFlag != ''"> and batch_flag = #{batchFlag}</if>
<if test="barcodeType != null and barcodeType != ''"> and barcode_type = #{barcodeType}</if>
<if test="barcodeInfo != null and barcodeInfo != ''"> and barcode_info = #{barcodeInfo}</if>
<if test="batchCode != null and batchCode != ''"> and batch_code = #{batchCode}</if>
<if test="palletInfoCode != null and palletInfoCode != ''"> and pallet_info_code = #{palletInfoCode}</if>
<if test="materialId != null "> and material_id = #{materialId}</if>
<if test="manufacturerId != null "> and manufacturer_id = #{manufacturerId}</if>
<if test="amount != null "> and amount = #{amount}</if>
<if test="machineName != null and machineName != ''"> and machine_name like concat('%', #{machineName}, '%')</if>
<if test="poNo != null and poNo != ''"> and po_no = #{poNo}</if>
<if test="productionDate != null "> and production_date = #{productionDate}</if>
<if test="acceptedDate != null "> and accepted_date = #{acceptedDate}</if>
<if test="lastOutstockDate != null "> and last_outstock_date = #{lastOutstockDate}</if>
<if test="planCode != null and planCode != ''"> and plan_code = #{planCode}</if>
<if test="planDetailCode != null and planDetailCode != ''"> and plan_detail_code = #{planDetailCode}</if>
<if test="saleorderCode != null and saleorderCode != ''"> and saleorder_code = #{saleorderCode}</if>
<if test="projectNo != null and projectNo != ''"> and project_no = #{projectNo}</if>
<if test="serialNumber != null and serialNumber != ''"> and serial_number = #{serialNumber}</if>
<if test="bindStatus != null and bindStatus != ''"> and bind_status = #{bindStatus}</if>
<if test="bindBy != null and bindBy != ''"> and bind_by = #{bindBy}</if>
<if test="bindTime != null "> and bind_time = #{bindTime}</if>
</where>
</select>
<select id="selectMesBaseBarcodeInfoByBarcodeId" parameterType="Long" resultMap="MesBaseBarcodeInfoResult">
<include refid="selectMesBaseBarcodeInfoVo"/>
where barcode_id = #{barcodeId}
</select>
<insert id="insertMesBaseBarcodeInfo" parameterType="MesBaseBarcodeInfo" useGeneratedKeys="true" keyProperty="barcodeId">
insert into mes_base_barcode_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="printTime != null">print_time,</if>
<if test="printPerson != null">print_person,</if>
<if test="batchFlag != null and batchFlag != ''">batch_flag,</if>
<if test="barcodeType != null and barcodeType != ''">barcode_type,</if>
<if test="barcodeInfo != null and barcodeInfo != ''">barcode_info,</if>
<if test="batchCode != null and batchCode != ''">batch_code,</if>
<if test="palletInfoCode != null">pallet_info_code,</if>
<if test="materialId != null">material_id,</if>
<if test="manufacturerId != null">manufacturer_id,</if>
<if test="amount != null">amount,</if>
<if test="machineName != null">machine_name,</if>
<if test="poNo != null">po_no,</if>
<if test="productionDate != null">production_date,</if>
<if test="acceptedDate != null">accepted_date,</if>
<if test="lastOutstockDate != null">last_outstock_date,</if>
<if test="planCode != null">plan_code,</if>
<if test="planDetailCode != null">plan_detail_code,</if>
<if test="saleorderCode != null">saleorder_code,</if>
<if test="projectNo != null">project_no,</if>
<if test="serialNumber != null">serial_number,</if>
<if test="remark != null">remark,</if>
<if test="bindStatus != null">bind_status,</if>
<if test="bindBy != null">bind_by,</if>
<if test="bindTime != null">bind_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="printTime != null">#{printTime},</if>
<if test="printPerson != null">#{printPerson},</if>
<if test="batchFlag != null and batchFlag != ''">#{batchFlag},</if>
<if test="barcodeType != null and barcodeType != ''">#{barcodeType},</if>
<if test="barcodeInfo != null and barcodeInfo != ''">#{barcodeInfo},</if>
<if test="batchCode != null and batchCode != ''">#{batchCode},</if>
<if test="palletInfoCode != null">#{palletInfoCode},</if>
<if test="materialId != null">#{materialId},</if>
<if test="manufacturerId != null">#{manufacturerId},</if>
<if test="amount != null">#{amount},</if>
<if test="machineName != null">#{machineName},</if>
<if test="poNo != null">#{poNo},</if>
<if test="productionDate != null">#{productionDate},</if>
<if test="acceptedDate != null">#{acceptedDate},</if>
<if test="lastOutstockDate != null">#{lastOutstockDate},</if>
<if test="planCode != null">#{planCode},</if>
<if test="planDetailCode != null">#{planDetailCode},</if>
<if test="saleorderCode != null">#{saleorderCode},</if>
<if test="projectNo != null">#{projectNo},</if>
<if test="serialNumber != null">#{serialNumber},</if>
<if test="remark != null">#{remark},</if>
<if test="bindStatus != null">#{bindStatus},</if>
<if test="bindBy != null">#{bindBy},</if>
<if test="bindTime != null">#{bindTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateMesBaseBarcodeInfo" parameterType="MesBaseBarcodeInfo">
update mes_base_barcode_info
<trim prefix="SET" suffixOverrides=",">
<if test="printTime != null">print_time = #{printTime},</if>
<if test="printPerson != null">print_person = #{printPerson},</if>
<if test="batchFlag != null and batchFlag != ''">batch_flag = #{batchFlag},</if>
<if test="barcodeType != null and barcodeType != ''">barcode_type = #{barcodeType},</if>
<if test="barcodeInfo != null and barcodeInfo != ''">barcode_info = #{barcodeInfo},</if>
<if test="batchCode != null and batchCode != ''">batch_code = #{batchCode},</if>
<if test="palletInfoCode != null">pallet_info_code = #{palletInfoCode},</if>
<if test="materialId != null">material_id = #{materialId},</if>
<if test="manufacturerId != null">manufacturer_id = #{manufacturerId},</if>
<if test="amount != null">amount = #{amount},</if>
<if test="machineName != null">machine_name = #{machineName},</if>
<if test="poNo != null">po_no = #{poNo},</if>
<if test="productionDate != null">production_date = #{productionDate},</if>
<if test="acceptedDate != null">accepted_date = #{acceptedDate},</if>
<if test="lastOutstockDate != null">last_outstock_date = #{lastOutstockDate},</if>
<if test="planCode != null">plan_code = #{planCode},</if>
<if test="planDetailCode != null">plan_detail_code = #{planDetailCode},</if>
<if test="saleorderCode != null">saleorder_code = #{saleorderCode},</if>
<if test="projectNo != null">project_no = #{projectNo},</if>
<if test="serialNumber != null">serial_number = #{serialNumber},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="bindStatus != null">bind_status = #{bindStatus},</if>
<if test="bindBy != null">bind_by = #{bindBy},</if>
<if test="bindTime != null">bind_time = #{bindTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where barcode_id = #{barcodeId}
</update>
<delete id="deleteMesBaseBarcodeInfoByBarcodeId" parameterType="Long">
delete from mes_base_barcode_info where barcode_id = #{barcodeId}
</delete>
<delete id="deleteMesBaseBarcodeInfoByBarcodeIds" parameterType="String">
delete from mes_base_barcode_info where barcode_id in
<foreach item="barcodeId" collection="array" open="(" separator="," close=")">
#{barcodeId}
</foreach>
</delete>
<select id="selectMesBaseBarcodeInfoByBarcodeInfo" parameterType="String" resultMap="MesBaseBarcodeInfoResult">
<include refid="selectMesBaseBarcodeInfoVo"/>
where barcode_info = #{barcodeInfo} limit 1
</select>
</mapper>

@ -0,0 +1,300 @@
<?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.hw.qms.mapper.MesBaseMaterialInfoMapper">
<resultMap type="MesBaseMaterialInfo" id="MesBaseMaterialInfoResult">
<result property="materialId" column="material_id"/>
<result property="erpId" column="erp_id"/>
<result property="materialCode" column="material_code"/>
<result property="oldMaterialCode" column="old_material_code"/>
<result property="materialName" column="material_name"/>
<result property="materialCategories" column="material_categories"/>
<result property="materialSubclass" column="material_subclass"/>
<result property="materialTypeId" column="material_type_id"/>
<result property="batchFlag" column="batch_flag"/>
<result property="materialUnitId" column="material_unit_id"/>
<result property="materialUnit" column="material_unit"/>
<result property="materialMatkl" column="material_matkl"/>
<result property="materialSpec" column="material_spec"/>
<result property="netWeight" column="net_weight"/>
<result property="grossWeight" column="gross_weight"/>
<result property="factoryId" column="factory_id"/>
<result property="createOrgId" column="create_org_id"/>
<result property="useOrgId" column="use_org_id"/>
<result property="prodlineId" column="prodline_id"/>
<result property="activeFlag" column="active_flag"/>
<result property="deletedFlag" column="deleted_flag"/>
<result property="remark" column="remark"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="approveDate" column="approve_date"/>
<result property="erpModifyDate" column="erp_modify_date"/>
<result property="warehouseId" column="warehouse_id"/>
<result property="checkRuleId" column="check_rule_id"/>
</resultMap>
<sql id="selectMesBaseMaterialInfoVo">
select material_id,
erp_id,
material_code,
old_material_code,
material_name,
material_categories,
material_subclass,
material_type_id,
batch_flag,
material_unit_id,
material_unit,
material_matkl,
material_spec,
net_weight,
gross_weight,
factory_id,
create_org_id,
use_org_id,
prodline_id,
active_flag,
deleted_flag,
remark,
create_by,
create_time,
update_by,
update_time,
approve_date,
erp_modify_date
from mes_base_material_info
</sql>
<select id="selectMesBaseMaterialInfoList" parameterType="MesBaseMaterialInfo"
resultMap="MesBaseMaterialInfoResult">
<include refid="selectMesBaseMaterialInfoVo"/>
<where>
<if test="erpId != null ">and erp_id = #{erpId}</if>
<if test="materialCode != null and materialCode != ''">and material_code = #{materialCode}</if>
<if test="oldMaterialCode != null and oldMaterialCode != ''">and old_material_code = #{oldMaterialCode}
</if>
<if test="materialName != null and materialName != ''">and material_name like concat('%', #{materialName},
'%')
</if>
<if test="materialCategories != null and materialCategories != ''">and material_categories =
#{materialCategories}
</if>
<if test="materialSubclass != null and materialSubclass != ''">and material_subclass =
#{materialSubclass}
</if>
<if test="materialTypeId != null ">and material_type_id = #{materialTypeId}</if>
<if test="batchFlag != null and batchFlag != ''">and batch_flag = #{batchFlag}</if>
<if test="materialUnitId != null ">and material_unit_id = #{materialUnitId}</if>
<if test="materialUnit != null and materialUnit != ''">and material_unit = #{materialUnit}</if>
<if test="materialMatkl != null and materialMatkl != ''">and material_matkl = #{materialMatkl}</if>
<if test="materialSpec != null and materialSpec != ''">and material_spec = #{materialSpec}</if>
<if test="netWeight != null ">and net_weight = #{netWeight}</if>
<if test="grossWeight != null ">and gross_weight = #{grossWeight}</if>
<if test="factoryId != null ">and factory_id = #{factoryId}</if>
<if test="createOrgId != null ">and create_org_id = #{createOrgId}</if>
<if test="useOrgId != null ">and use_org_id = #{useOrgId}</if>
<if test="prodlineId != null and prodlineId != ''">and prodline_id = #{prodlineId}</if>
<if test="activeFlag != null and activeFlag != ''">and active_flag = #{activeFlag}</if>
<if test="deletedFlag != null and deletedFlag != ''">and deleted_flag = #{deletedFlag}</if>
<if test="approveDate != null ">and approve_date = #{approveDate}</if>
<if test="erpModifyDate != null ">and erp_modify_date = #{erpModifyDate}</if>
</where>
</select>
<select id="selectMesBaseMaterialInfoByMaterialId" parameterType="Long" resultMap="MesBaseMaterialInfoResult">
<include refid="selectMesBaseMaterialInfoVo"/>
where material_id = #{materialId}
</select>
<insert id="insertMesBaseMaterialInfo" parameterType="MesBaseMaterialInfo" useGeneratedKeys="true"
keyProperty="materialId">
insert into mes_base_material_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="erpId != null">erp_id,</if>
<if test="materialCode != null and materialCode != ''">material_code,</if>
<if test="oldMaterialCode != null">old_material_code,</if>
<if test="materialName != null and materialName != ''">material_name,</if>
<if test="materialCategories != null and materialCategories != ''">material_categories,</if>
<if test="materialSubclass != null">material_subclass,</if>
<if test="materialTypeId != null">material_type_id,</if>
<if test="batchFlag != null">batch_flag,</if>
<if test="materialUnitId != null">material_unit_id,</if>
<if test="materialUnit != null">material_unit,</if>
<if test="materialMatkl != null">material_matkl,</if>
<if test="materialSpec != null">material_spec,</if>
<if test="netWeight != null">net_weight,</if>
<if test="grossWeight != null">gross_weight,</if>
<if test="factoryId != null">factory_id,</if>
<if test="createOrgId != null">create_org_id,</if>
<if test="useOrgId != null">use_org_id,</if>
<if test="prodlineId != null">prodline_id,</if>
<if test="activeFlag != null">active_flag,</if>
<if test="deletedFlag != null">deleted_flag,</if>
<if test="remark != null">remark,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="approveDate != null">approve_date,</if>
<if test="erpModifyDate != null">erp_modify_date,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="erpId != null">#{erpId},</if>
<if test="materialCode != null and materialCode != ''">#{materialCode},</if>
<if test="oldMaterialCode != null">#{oldMaterialCode},</if>
<if test="materialName != null and materialName != ''">#{materialName},</if>
<if test="materialCategories != null and materialCategories != ''">#{materialCategories},</if>
<if test="materialSubclass != null">#{materialSubclass},</if>
<if test="materialTypeId != null">#{materialTypeId},</if>
<if test="batchFlag != null">#{batchFlag},</if>
<if test="materialUnitId != null">#{materialUnitId},</if>
<if test="materialUnit != null">#{materialUnit},</if>
<if test="materialMatkl != null">#{materialMatkl},</if>
<if test="materialSpec != null">#{materialSpec},</if>
<if test="netWeight != null">#{netWeight},</if>
<if test="grossWeight != null">#{grossWeight},</if>
<if test="factoryId != null">#{factoryId},</if>
<if test="createOrgId != null">#{createOrgId},</if>
<if test="useOrgId != null">#{useOrgId},</if>
<if test="prodlineId != null">#{prodlineId},</if>
<if test="activeFlag != null">#{activeFlag},</if>
<if test="deletedFlag != null">#{deletedFlag},</if>
<if test="remark != null">#{remark},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="approveDate != null">#{approveDate},</if>
<if test="erpModifyDate != null">#{erpModifyDate},</if>
</trim>
</insert>
<update id="updateMesBaseMaterialInfo" parameterType="MesBaseMaterialInfo">
update mes_base_material_info
<trim prefix="SET" suffixOverrides=",">
<if test="erpId != null">erp_id = #{erpId},</if>
<if test="materialCode != null and materialCode != ''">material_code = #{materialCode},</if>
<if test="oldMaterialCode != null">old_material_code = #{oldMaterialCode},</if>
<if test="materialName != null and materialName != ''">material_name = #{materialName},</if>
<if test="materialCategories != null and materialCategories != ''">material_categories =
#{materialCategories},
</if>
<if test="materialSubclass != null">material_subclass = #{materialSubclass},</if>
<if test="materialTypeId != null">material_type_id = #{materialTypeId},</if>
<if test="batchFlag != null">batch_flag = #{batchFlag},</if>
<if test="materialUnitId != null">material_unit_id = #{materialUnitId},</if>
<if test="materialUnit != null">material_unit = #{materialUnit},</if>
<if test="materialMatkl != null">material_matkl = #{materialMatkl},</if>
<if test="materialSpec != null">material_spec = #{materialSpec},</if>
<if test="netWeight != null">net_weight = #{netWeight},</if>
<if test="grossWeight != null">gross_weight = #{grossWeight},</if>
<if test="factoryId != null">factory_id = #{factoryId},</if>
<if test="createOrgId != null">create_org_id = #{createOrgId},</if>
<if test="useOrgId != null">use_org_id = #{useOrgId},</if>
<if test="prodlineId != null">prodline_id = #{prodlineId},</if>
<if test="activeFlag != null">active_flag = #{activeFlag},</if>
<if test="deletedFlag != null">deleted_flag = #{deletedFlag},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="approveDate != null">approve_date = #{approveDate},</if>
<if test="erpModifyDate != null">erp_modify_date = #{erpModifyDate},</if>
</trim>
where material_id = #{materialId}
</update>
<delete id="deleteMesBaseMaterialInfoByMaterialId" parameterType="Long">
delete
from mes_base_material_info
where material_id = #{materialId}
</delete>
<delete id="deleteMesBaseMaterialInfoByMaterialIds" parameterType="String">
delete from mes_base_material_info where material_id in
<foreach item="materialId" collection="array" open="(" separator="," close=")">
#{materialId}
</foreach>
</delete>
<!--新增以下-->
<select id="selectMesBaseMaterialInfoListByMaterialIds" parameterType="String"
resultMap="MesBaseMaterialInfoResult">
<include refid="selectMesBaseMaterialInfoVo"/>
where material_id in
<foreach item="materialId" collection="array" open="(" separator="," close=")">
#{materialId}
</foreach>
</select>
<select id="selectMaterialInfos4AllocateCheckRule" parameterType="MesBaseMaterialInfo"
resultMap="MesBaseMaterialInfoResult">
select material_id,
erp_id,
material_code,
old_material_code,
material_name,
material_categories,
material_subclass,
material_type_id,
batch_flag,
material_unit_id,
material_unit,
material_matkl,
material_spec,
net_weight,
gross_weight,
factory_id
from mes_base_material_info mbmi
<where>
and not exists (select 1 from qms_check_rule_detail qcrd where mbmi.material_id = qcrd.target_id and qcrd.target_type='1' and qcrd.check_rule_id=#{checkRuleId})
<if test="erpId != null ">and erp_id = #{erpId}</if>
<if test="materialCode != null and materialCode != ''">and material_code = #{materialCode}</if>
<if test="oldMaterialCode != null and oldMaterialCode != ''">and old_material_code = #{oldMaterialCode}
</if>
<if test="materialName != null and materialName != ''">and material_name like concat('%', #{materialName},
'%')
</if>
<if test="materialCategories != null and materialCategories != ''">and material_categories =
#{materialCategories}
</if>
<if test="materialSubclass != null and materialSubclass != ''">and material_subclass =
#{materialSubclass}
</if>
<if test="materialTypeId != null ">and material_type_id = #{materialTypeId}</if>
<if test="batchFlag != null and batchFlag != ''">and batch_flag = #{batchFlag}</if>
<if test="materialUnitId != null ">and material_unit_id = #{materialUnitId}</if>
<if test="materialUnit != null and materialUnit != ''">and material_unit = #{materialUnit}</if>
<if test="materialMatkl != null and materialMatkl != ''">and material_matkl = #{materialMatkl}</if>
<if test="materialSpec != null and materialSpec != ''">and material_spec = #{materialSpec}</if>
<if test="netWeight != null ">and net_weight = #{netWeight}</if>
<if test="grossWeight != null ">and gross_weight = #{grossWeight}</if>
<if test="factoryId != null ">and factory_id = #{factoryId}</if>
<if test="createOrgId != null ">and create_org_id = #{createOrgId}</if>
<if test="useOrgId != null ">and use_org_id = #{useOrgId}</if>
<if test="prodlineId != null and prodlineId != ''">and prodline_id = #{prodlineId}</if>
<if test="activeFlag != null and activeFlag != ''">and active_flag = #{activeFlag}</if>
<if test="deletedFlag != null and deletedFlag != ''">and deleted_flag = #{deletedFlag}</if>
<if test="approveDate != null ">and approve_date = #{approveDate}</if>
<if test="erpModifyDate != null ">and erp_modify_date = #{erpModifyDate}</if>
</where>
</select>
</mapper>

@ -0,0 +1,154 @@
<?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.hw.qms.mapper.QmsCheckProjectMapper">
<resultMap type="QmsCheckProject" id="QmsCheckProjectResult">
<result property="checkProjectId" column="check_project_id" />
<result property="checkProjectName" column="check_project_name" />
<result property="checkProjectStatus" column="check_project_status" />
<result property="checkProjectProperty" column="check_project_property" />
<result property="checkMode" column="check_mode" />
<result property="checkSample" column="check_sample" />
<result property="checkTool" column="check_tool" />
<result property="unitCode" column="unit_code" />
<result property="standardValue" column="standard_value" />
<result property="upperDiff" column="upper_diff" />
<result property="downDiff" column="down_diff" />
<result property="defectSeverity" column="defect_severity" />
<result property="remark" column="remark" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectQmsCheckProjectVo">
select check_project_id, check_project_name, check_project_status, check_project_property, check_mode, check_sample, check_tool, unit_code, standard_value, upper_diff, down_diff, defect_severity, remark, create_by, create_time, update_by, update_time from qms_check_project
</sql>
<select id="selectQmsCheckProjectList" parameterType="QmsCheckProject" resultMap="QmsCheckProjectResult">
<include refid="selectQmsCheckProjectVo"/>
<where>
<if test="checkProjectName != null and checkProjectName != ''"> and check_project_name like concat('%', #{checkProjectName}, '%')</if>
<if test="checkProjectStatus != null and checkProjectStatus != ''"> and check_project_status = #{checkProjectStatus}</if>
<if test="checkProjectProperty != null and checkProjectProperty != ''"> and check_project_property = #{checkProjectProperty}</if>
<if test="checkMode != null and checkMode != ''"> and check_mode = #{checkMode}</if>
<if test="checkSample != null "> and check_sample = #{checkSample}</if>
<if test="checkTool != null and checkTool != ''"> and check_tool = #{checkTool}</if>
<if test="unitCode != null and unitCode != ''"> and unit_code = #{unitCode}</if>
<if test="standardValue != null "> and standard_value = #{standardValue}</if>
<if test="upperDiff != null "> and upper_diff = #{upperDiff}</if>
<if test="downDiff != null "> and down_diff = #{downDiff}</if>
<if test="defectSeverity != null and defectSeverity != ''"> and defect_severity = #{defectSeverity}</if>
</where>
</select>
<select id="selectQmsCheckProjectByCheckProjectId" parameterType="Long" resultMap="QmsCheckProjectResult">
<include refid="selectQmsCheckProjectVo"/>
where check_project_id = #{checkProjectId}
</select>
<insert id="insertQmsCheckProject" parameterType="QmsCheckProject" useGeneratedKeys="true" keyProperty="checkProjectId">
insert into qms_check_project
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="checkProjectName != null and checkProjectName != ''">check_project_name,</if>
<if test="checkProjectStatus != null and checkProjectStatus != ''">check_project_status,</if>
<if test="checkProjectProperty != null and checkProjectProperty != ''">check_project_property,</if>
<if test="checkMode != null and checkMode != ''">check_mode,</if>
<if test="checkSample != null">check_sample,</if>
<if test="checkTool != null">check_tool,</if>
<if test="unitCode != null">unit_code,</if>
<if test="standardValue != null">standard_value,</if>
<if test="upperDiff != null">upper_diff,</if>
<if test="downDiff != null">down_diff,</if>
<if test="defectSeverity != null">defect_severity,</if>
<if test="remark != null">remark,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="checkProjectName != null and checkProjectName != ''">#{checkProjectName},</if>
<if test="checkProjectStatus != null and checkProjectStatus != ''">#{checkProjectStatus},</if>
<if test="checkProjectProperty != null and checkProjectProperty != ''">#{checkProjectProperty},</if>
<if test="checkMode != null and checkMode != ''">#{checkMode},</if>
<if test="checkSample != null">#{checkSample},</if>
<if test="checkTool != null">#{checkTool},</if>
<if test="unitCode != null">#{unitCode},</if>
<if test="standardValue != null">#{standardValue},</if>
<if test="upperDiff != null">#{upperDiff},</if>
<if test="downDiff != null">#{downDiff},</if>
<if test="defectSeverity != null">#{defectSeverity},</if>
<if test="remark != null">#{remark},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateQmsCheckProject" parameterType="QmsCheckProject">
update qms_check_project
<trim prefix="SET" suffixOverrides=",">
<if test="checkProjectName != null and checkProjectName != ''">check_project_name = #{checkProjectName},</if>
<if test="checkProjectStatus != null and checkProjectStatus != ''">check_project_status = #{checkProjectStatus},</if>
<if test="checkProjectProperty != null and checkProjectProperty != ''">check_project_property = #{checkProjectProperty},</if>
<if test="checkMode != null and checkMode != ''">check_mode = #{checkMode},</if>
<if test="checkSample != null">check_sample = #{checkSample},</if>
<if test="checkTool != null">check_tool = #{checkTool},</if>
<if test="unitCode != null">unit_code = #{unitCode},</if>
standard_value = #{standardValue},
upper_diff = #{upperDiff},
down_diff = #{downDiff},
<if test="defectSeverity != null">defect_severity = #{defectSeverity},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where check_project_id = #{checkProjectId}
</update>
<delete id="deleteQmsCheckProjectByCheckProjectId" parameterType="Long">
delete from qms_check_project where check_project_id = #{checkProjectId}
</delete>
<delete id="deleteQmsCheckProjectByCheckProjectIds" parameterType="String">
delete from qms_check_project where check_project_id in
<foreach item="checkProjectId" collection="array" open="(" separator="," close=")">
#{checkProjectId}
</foreach>
</delete>
<select id="selectQmsCheckProjects4AllocateCheckRule" parameterType="QmsCheckProject" resultMap="QmsCheckProjectResult">
select qcp.check_project_id, qcp.check_project_name from qms_check_project qcp
<where>
and not exists (select 1 from qms_check_rule_project qcrp where qcrp.check_project_id = qcp.check_project_id and qcrp.check_rule_id=#{checkRuleId})
<if test="checkProjectName != null and checkProjectName != ''"> and check_project_name like concat('%', #{checkProjectName}, '%')</if>
<if test="checkProjectStatus != null and checkProjectStatus != ''"> and check_project_status = #{checkProjectStatus}</if>
<if test="checkProjectProperty != null and checkProjectProperty != ''"> and check_project_property = #{checkProjectProperty}</if>
<if test="checkMode != null and checkMode != ''"> and check_mode = #{checkMode}</if>
<if test="checkSample != null "> and check_sample = #{checkSample}</if>
<if test="checkTool != null and checkTool != ''"> and check_tool = #{checkTool}</if>
<if test="unitCode != null and unitCode != ''"> and unit_code = #{unitCode}</if>
<if test="standardValue != null "> and standard_value = #{standardValue}</if>
<if test="upperDiff != null "> and upper_diff = #{upperDiff}</if>
<if test="downDiff != null "> and down_diff = #{downDiff}</if>
<if test="defectSeverity != null and defectSeverity != ''"> and defect_severity = #{defectSeverity}</if>
</where>
</select>
</mapper>

@ -0,0 +1,139 @@
<?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.hw.qms.mapper.QmsCheckResultDetailMapper">
<resultMap type="QmsCheckResultDetail" id="QmsCheckResultDetailResult">
<result property="checkResultDetailId" column="check_result_detail_id" />
<result property="checkResultId" column="check_result_id" />
<result property="materialBarcode" column="material_barcode" />
<result property="checkStatus" column="check_status" />
<result property="remark" column="remark" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<resultMap id="QmsCheckResultDetailQmsCheckResultDetailProjectResult" type="QmsCheckResultDetail" extends="QmsCheckResultDetailResult">
<collection property="qmsCheckResultDetailProjectList" notNullColumn="sub_result_detail_project_id" javaType="java.util.List" resultMap="QmsCheckResultDetailProjectResult" />
</resultMap>
<resultMap type="QmsCheckResultDetailProject" id="QmsCheckResultDetailProjectResult">
<result property="resultDetailProjectId" column="sub_result_detail_project_id" />
<result property="checkResultDetailId" column="sub_check_result_detail_id" />
<result property="checkProjectId" column="sub_check_project_id" />
<result property="checkProjectStatus" column="sub_check_project_status" />
<result property="checkProjectResult" column="sub_check_project_result" />
<result property="standardValue" column="sub_standard_value" />
<result property="upperDiff" column="sub_upper_diff" />
<result property="downDiff" column="sub_down_diff" />
<result property="createBy" column="sub_create_by" />
<result property="createTime" column="sub_create_time" />
<result property="updateBy" column="sub_update_by" />
<result property="updateTime" column="sub_update_time" />
</resultMap>
<sql id="selectQmsCheckResultDetailVo">
select check_result_detail_id, check_result_id, material_barcode, check_status, remark, create_by, create_time, update_by, update_time from qms_check_result_detail
</sql>
<select id="selectQmsCheckResultDetailList" parameterType="QmsCheckResultDetail" resultMap="QmsCheckResultDetailResult">
<include refid="selectQmsCheckResultDetailVo"/>
<where>
<if test="checkResultId != null "> and check_result_id = #{checkResultId}</if>
<if test="materialBarcode != null and materialBarcode != ''"> and material_barcode = #{materialBarcode}</if>
<if test="checkStatus != null and checkStatus != ''"> and check_status = #{checkStatus}</if>
</where>
</select>
<select id="selectQmsCheckResultDetailByCheckResultDetailId" parameterType="Long" resultMap="QmsCheckResultDetailQmsCheckResultDetailProjectResult">
select a.check_result_detail_id, a.check_result_id, a.material_barcode, a.check_status, a.remark, a.create_by, a.create_time, a.update_by, a.update_time,
b.result_detail_project_id as sub_result_detail_project_id, b.check_result_detail_id as sub_check_result_detail_id, b.check_project_id as sub_check_project_id, b.check_project_status as sub_check_project_status, b.check_project_result as sub_check_project_result, b.standard_value as sub_standard_value, b.upper_diff as sub_upper_diff, b.down_diff as sub_down_diff, b.create_by as sub_create_by, b.create_time as sub_create_time, b.update_by as sub_update_by, b.update_time as sub_update_time
from qms_check_result_detail a
left join qms_check_result_detail_project b on b.check_result_detail_id = a.check_result_detail_id
where a.check_result_detail_id = #{checkResultDetailId}
</select>
<insert id="insertQmsCheckResultDetail" parameterType="QmsCheckResultDetail" useGeneratedKeys="true" keyProperty="checkResultDetailId">
insert into qms_check_result_detail
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="checkResultId != null">check_result_id,</if>
<if test="materialBarcode != null and materialBarcode != ''">material_barcode,</if>
<if test="checkStatus != null and checkStatus != ''">check_status,</if>
<if test="remark != null">remark,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="checkResultId != null">#{checkResultId},</if>
<if test="materialBarcode != null and materialBarcode != ''">#{materialBarcode},</if>
<if test="checkStatus != null and checkStatus != ''">#{checkStatus},</if>
<if test="remark != null">#{remark},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateQmsCheckResultDetail" parameterType="QmsCheckResultDetail">
update qms_check_result_detail
<trim prefix="SET" suffixOverrides=",">
<if test="checkResultId != null">check_result_id = #{checkResultId},</if>
<if test="materialBarcode != null and materialBarcode != ''">material_barcode = #{materialBarcode},</if>
<if test="checkStatus != null and checkStatus != ''">check_status = #{checkStatus},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where check_result_detail_id = #{checkResultDetailId}
</update>
<delete id="deleteQmsCheckResultDetailByCheckResultDetailId" parameterType="Long">
delete from qms_check_result_detail where check_result_detail_id = #{checkResultDetailId}
</delete>
<delete id="deleteQmsCheckResultDetailByCheckResultDetailIds" parameterType="String">
delete from qms_check_result_detail where check_result_detail_id in
<foreach item="checkResultDetailId" collection="array" open="(" separator="," close=")">
#{checkResultDetailId}
</foreach>
</delete>
<delete id="deleteQmsCheckResultDetailProjectByCheckResultDetailIds" parameterType="String">
delete from qms_check_result_detail_project where check_result_detail_id in
<foreach item="checkResultDetailId" collection="array" open="(" separator="," close=")">
#{checkResultDetailId}
</foreach>
</delete>
<delete id="deleteQmsCheckResultDetailProjectByCheckResultDetailId" parameterType="Long">
delete from qms_check_result_detail_project where check_result_detail_id = #{checkResultDetailId}
</delete>
<insert id="batchQmsCheckResultDetailProject">
insert into qms_check_result_detail_project( result_detail_project_id, check_result_detail_id, check_project_id, check_project_status, check_project_result, standard_value, upper_diff, down_diff, create_by, create_time, update_by, update_time) values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.resultDetailProjectId}, #{item.checkResultDetailId}, #{item.checkProjectId}, #{item.checkProjectStatus}, #{item.checkProjectResult}, #{item.standardValue}, #{item.upperDiff}, #{item.downDiff}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime})
</foreach>
</insert>
<select id="selectQmsCheckResultDetailByMaterialBarcode" parameterType="String" resultMap="QmsCheckResultDetailQmsCheckResultDetailProjectResult">
select a.check_result_detail_id, a.check_result_id, a.material_barcode, a.check_status, a.remark, a.create_by, a.create_time, a.update_by, a.update_time,
b.result_detail_project_id as sub_result_detail_project_id, b.check_result_detail_id as sub_check_result_detail_id, b.check_project_id as sub_check_project_id, b.check_project_status as sub_check_project_status, b.check_project_result as sub_check_project_result, b.standard_value as sub_standard_value, b.upper_diff as sub_upper_diff, b.down_diff as sub_down_diff, b.create_by as sub_create_by, b.create_time as sub_create_time, b.update_by as sub_update_by, b.update_time as sub_update_time
from qms_check_result_detail a
left join qms_check_result_detail_project b on b.check_result_detail_id = a.check_result_detail_id
where a.material_barcode = #{materialBarcode} limit 1
</select>
</mapper>

@ -0,0 +1,173 @@
<?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.hw.qms.mapper.QmsCheckResultMapper">
<resultMap type="QmsCheckResult" id="QmsCheckResultResult">
<result property="checkResultId" column="check_result_id" />
<result property="materialType" column="material_type" />
<result property="materialId" column="material_id" />
<result property="materialBatch" column="material_batch" />
<result property="checkMode" column="check_mode" />
<result property="checkSample" column="check_sample" />
<result property="planCode" column="plan_code" />
<result property="planDetailCode" column="plan_detail_code" />
<result property="saleorderCode" column="saleorder_code" />
<result property="poNo" column="po_no" />
<result property="poLine" column="po_line" />
<result property="projectNo" column="project_no" />
<result property="checkStatus" column="check_status" />
<result property="remark" column="remark" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="attr1" column="attr1" />
</resultMap>
<resultMap id="QmsCheckResultQmsCheckResultDetailResult" type="QmsCheckResult" extends="QmsCheckResultResult">
<collection property="qmsCheckResultDetailList" notNullColumn="sub_check_result_detail_id" javaType="java.util.List" resultMap="QmsCheckResultDetailResult" />
</resultMap>
<resultMap type="QmsCheckResultDetail" id="QmsCheckResultDetailResult">
<result property="checkResultDetailId" column="sub_check_result_detail_id" />
<result property="checkResultId" column="sub_check_result_id" />
<result property="materialBarcode" column="sub_material_barcode" />
<result property="checkStatus" column="sub_check_status" />
<result property="remark" column="sub_remark" />
<result property="createBy" column="sub_create_by" />
<result property="createTime" column="sub_create_time" />
<result property="updateBy" column="sub_update_by" />
<result property="updateTime" column="sub_update_time" />
</resultMap>
<sql id="selectQmsCheckResultVo">
select check_result_id, material_type, material_id, material_batch, check_mode, check_sample, plan_code, plan_detail_code, saleorder_code, po_no, po_line, project_no, check_status, remark, create_by, create_time, update_by, update_time, attr1 from qms_check_result
</sql>
<select id="selectQmsCheckResultList" parameterType="QmsCheckResult" resultMap="QmsCheckResultResult">
<include refid="selectQmsCheckResultVo"/>
<where>
<if test="materialType != null and materialType != ''"> and material_type = #{materialType}</if>
<if test="materialId != null "> and material_id = #{materialId}</if>
<if test="materialBatch != null and materialBatch != ''"> and material_batch = #{materialBatch}</if>
<if test="checkMode != null and checkMode != ''"> and check_mode = #{checkMode}</if>
<if test="checkSample != null "> and check_sample = #{checkSample}</if>
<if test="planCode != null and planCode != ''"> and plan_code = #{planCode}</if>
<if test="planDetailCode != null and planDetailCode != ''"> and plan_detail_code = #{planDetailCode}</if>
<if test="saleorderCode != null and saleorderCode != ''"> and saleorder_code = #{saleorderCode}</if>
<if test="poNo != null and poNo != ''"> and po_no = #{poNo}</if>
<if test="poLine != null and poLine != ''"> and po_line = #{poLine}</if>
<if test="projectNo != null and projectNo != ''"> and project_no = #{projectNo}</if>
<if test="checkStatus != null and checkStatus != ''"> and check_status = #{checkStatus}</if>
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
</where>
</select>
<select id="selectQmsCheckResultByCheckResultId" parameterType="Long" resultMap="QmsCheckResultQmsCheckResultDetailResult">
select a.check_result_id, a.material_type, a.material_id, a.material_batch, a.check_mode, a.check_sample, a.plan_code, a.plan_detail_code, a.saleorder_code, a.po_no, a.po_line, a.project_no, a.check_status, a.remark, a.create_by, a.create_time, a.update_by, a.update_time, a.attr1,
b.check_result_detail_id as sub_check_result_detail_id, b.check_result_id as sub_check_result_id, b.material_barcode as sub_material_barcode, b.check_status as sub_check_status, b.remark as sub_remark, b.create_by as sub_create_by, b.create_time as sub_create_time, b.update_by as sub_update_by, b.update_time as sub_update_time
from qms_check_result a
left join qms_check_result_detail b on b.check_result_id = a.check_result_id
where a.check_result_id = #{checkResultId}
</select>
<insert id="insertQmsCheckResult" parameterType="QmsCheckResult" useGeneratedKeys="true" keyProperty="checkResultId">
insert into qms_check_result
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="materialType != null">material_type,</if>
<if test="materialId != null">material_id,</if>
<if test="materialBatch != null and materialBatch != ''">material_batch,</if>
<if test="checkMode != null">check_mode,</if>
<if test="checkSample != null">check_sample,</if>
<if test="planCode != null">plan_code,</if>
<if test="planDetailCode != null">plan_detail_code,</if>
<if test="saleorderCode != null">saleorder_code,</if>
<if test="poNo != null">po_no,</if>
<if test="poLine != null">po_line,</if>
<if test="projectNo != null">project_no,</if>
<if test="checkStatus != null and checkStatus != ''">check_status,</if>
<if test="remark != null">remark,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="attr1 != null">attr1,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="materialType != null">#{materialType},</if>
<if test="materialId != null">#{materialId},</if>
<if test="materialBatch != null and materialBatch != ''">#{materialBatch},</if>
<if test="checkMode != null">#{checkMode},</if>
<if test="checkSample != null">#{checkSample},</if>
<if test="planCode != null">#{planCode},</if>
<if test="planDetailCode != null">#{planDetailCode},</if>
<if test="saleorderCode != null">#{saleorderCode},</if>
<if test="poNo != null">#{poNo},</if>
<if test="poLine != null">#{poLine},</if>
<if test="projectNo != null">#{projectNo},</if>
<if test="checkStatus != null and checkStatus != ''">#{checkStatus},</if>
<if test="remark != null">#{remark},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="attr1 != null">#{attr1},</if>
</trim>
</insert>
<update id="updateQmsCheckResult" parameterType="QmsCheckResult">
update qms_check_result
<trim prefix="SET" suffixOverrides=",">
<if test="materialType != null">material_type = #{materialType},</if>
<if test="materialId != null">material_id = #{materialId},</if>
<if test="materialBatch != null and materialBatch != ''">material_batch = #{materialBatch},</if>
<if test="checkMode != null">check_mode = #{checkMode},</if>
<if test="checkSample != null">check_sample = #{checkSample},</if>
<if test="planCode != null">plan_code = #{planCode},</if>
<if test="planDetailCode != null">plan_detail_code = #{planDetailCode},</if>
<if test="saleorderCode != null">saleorder_code = #{saleorderCode},</if>
<if test="poNo != null">po_no = #{poNo},</if>
<if test="poLine != null">po_line = #{poLine},</if>
<if test="projectNo != null">project_no = #{projectNo},</if>
<if test="checkStatus != null and checkStatus != ''">check_status = #{checkStatus},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="attr1 != null">attr1 = #{attr1},</if>
</trim>
where check_result_id = #{checkResultId}
</update>
<delete id="deleteQmsCheckResultByCheckResultId" parameterType="Long">
delete from qms_check_result where check_result_id = #{checkResultId}
</delete>
<delete id="deleteQmsCheckResultByCheckResultIds" parameterType="String">
delete from qms_check_result where check_result_id in
<foreach item="checkResultId" collection="array" open="(" separator="," close=")">
#{checkResultId}
</foreach>
</delete>
<delete id="deleteQmsCheckResultDetailByCheckResultIds" parameterType="String">
delete from qms_check_result_detail where check_result_id in
<foreach item="checkResultId" collection="array" open="(" separator="," close=")">
#{checkResultId}
</foreach>
</delete>
<delete id="deleteQmsCheckResultDetailByCheckResultId" parameterType="Long">
delete from qms_check_result_detail where check_result_id = #{checkResultId}
</delete>
<insert id="batchQmsCheckResultDetail">
insert into qms_check_result_detail( check_result_detail_id, check_result_id, material_barcode, check_status, remark, create_by, create_time, update_by, update_time) values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.checkResultDetailId}, #{item.checkResultId}, #{item.materialBarcode}, #{item.checkStatus}, #{item.remark}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime})
</foreach>
</insert>
</mapper>

@ -0,0 +1,105 @@
<?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.hw.qms.mapper.QmsCheckRuleDetailMapper">
<resultMap type="QmsCheckRuleDetail" id="QmsCheckRuleDetailResult">
<result property="checkRuleId" column="check_rule_id" />
<result property="targetType" column="target_type" />
<result property="targetId" column="target_id" />
<result property="materialCode" column="material_code" />
<result property="materialName" column="material_name" />
</resultMap>
<sql id="selectQmsCheckRuleDetailVo">
select check_rule_id, target_type, target_id from qms_check_rule_detail
</sql>
<select id="selectQmsCheckRuleDetailList" parameterType="QmsCheckRuleDetail" resultMap="QmsCheckRuleDetailResult">
<include refid="selectQmsCheckRuleDetailVo"/>
<where>
<if test="checkRuleId != null "> and check_rule_id = #{checkRuleId}</if>
<if test="targetType != null and targetType != ''"> and target_type = #{targetType}</if>
<if test="targetId != null "> and target_id = #{targetId}</if>
</where>
</select>
<select id="selectQmsCheckRuleDetailByCheckRuleId" parameterType="Long" resultMap="QmsCheckRuleDetailResult">
<include refid="selectQmsCheckRuleDetailVo"/>
where check_rule_id = #{checkRuleId}
</select>
<insert id="insertQmsCheckRuleDetail" parameterType="QmsCheckRuleDetail">
insert into qms_check_rule_detail
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="checkRuleId != null">check_rule_id,</if>
<if test="targetType != null and targetType != ''">target_type,</if>
<if test="targetId != null">target_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="checkRuleId != null">#{checkRuleId},</if>
<if test="targetType != null and targetType != ''">#{targetType},</if>
<if test="targetId != null">#{targetId},</if>
</trim>
</insert>
<update id="updateQmsCheckRuleDetail" parameterType="QmsCheckRuleDetail">
update qms_check_rule_detail
<trim prefix="SET" suffixOverrides=",">
<if test="targetType != null and targetType != ''">target_type = #{targetType},</if>
<if test="targetId != null">target_id = #{targetId},</if>
</trim>
where check_rule_id = #{checkRuleId}
</update>
<delete id="deleteQmsCheckRuleDetailByCheckRuleId" parameterType="Long">
delete from qms_check_rule_detail where check_rule_id = #{checkRuleId}
</delete>
<delete id="deleteQmsCheckRuleDetailByCheckRuleIds" parameterType="String">
delete from qms_check_rule_detail where check_rule_id in
<foreach item="checkRuleId" collection="array" open="(" separator="," close=")">
#{checkRuleId}
</foreach>
</delete>
<select id="selectQmsCheckRuleDetailJoinList" parameterType="QmsCheckRuleDetail" resultMap="QmsCheckRuleDetailResult">
select qcrd.check_rule_id, qcrd.target_type, qcrd.target_id,
mbmi.material_code,mbmi.material_name
from qms_check_rule_detail qcrd
left join mes_base_material_info mbmi on qcrd.target_id=mbmi.material_id and qcrd.target_type='1'
<where>
<if test="checkRuleId != null "> and check_rule_id = #{checkRuleId}</if>
<if test="targetType != null and targetType != ''"> and target_type = #{targetType}</if>
<if test="targetId != null "> and target_id = #{targetId}</if>
<if test="materialCode != null and materialCode != ''"> and material_code = #{materialCode}</if>
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
</where>
</select>
<delete id="deleteQmsCheckRuleDetails">
delete from qms_check_rule_detail where
<foreach item="item" index="index" collection="list" separator="or">
( check_rule_id = #{item.checkRuleId} and target_id = #{item.targetId} and target_type=#{item.targetType})
</foreach>
</delete>
</mapper>

@ -0,0 +1,140 @@
<?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.hw.qms.mapper.QmsCheckRuleMapper">
<resultMap type="QmsCheckRule" id="QmsCheckRuleResult">
<result property="checkRuleId" column="check_rule_id" />
<result property="checkRuleName" column="check_rule_name" />
<result property="checkRuleType" column="check_rule_type" />
<result property="checkMode" column="check_mode" />
<result property="checkSample" column="check_sample" />
<result property="checkRuleStatus" column="check_rule_status" />
<result property="remark" column="remark" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<resultMap id="QmsCheckRuleQmsCheckRuleProjectResult" type="QmsCheckRule" extends="QmsCheckRuleResult">
<collection property="qmsCheckRuleProjectList" notNullColumn="sub_check_rule_id" javaType="java.util.List" resultMap="QmsCheckRuleProjectResult" />
</resultMap>
<resultMap type="QmsCheckRuleProject" id="QmsCheckRuleProjectResult">
<result property="checkRuleId" column="sub_check_rule_id" />
<result property="checkProjectId" column="sub_check_project_id" />
<result property="projectStepOrder" column="sub_project_step_order" />
</resultMap>
<sql id="selectQmsCheckRuleVo">
select check_rule_id, check_rule_name, check_rule_type, check_mode, check_sample, check_rule_status, remark, create_by, create_time, update_by, update_time from qms_check_rule
</sql>
<select id="selectQmsCheckRuleList" parameterType="QmsCheckRule" resultMap="QmsCheckRuleResult">
<include refid="selectQmsCheckRuleVo"/>
<where>
<if test="checkRuleName != null and checkRuleName != ''"> and check_rule_name like concat('%', #{checkRuleName}, '%')</if>
<if test="checkRuleType != null and checkRuleType != ''"> and check_rule_type = #{checkRuleType}</if>
<if test="checkMode != null and checkMode != ''"> and check_mode = #{checkMode}</if>
<if test="checkSample != null "> and check_sample = #{checkSample}</if>
<if test="checkRuleStatus != null and checkRuleStatus != ''"> and check_rule_status = #{checkRuleStatus}</if>
</where>
</select>
<select id="selectQmsCheckRuleByCheckRuleId" parameterType="Long" resultMap="QmsCheckRuleQmsCheckRuleProjectResult">
select a.check_rule_id, a.check_rule_name, a.check_rule_type, a.check_mode, a.check_sample, a.check_rule_status, a.remark, a.create_by, a.create_time, a.update_by, a.update_time,
b.check_rule_id as sub_check_rule_id, b.check_project_id as sub_check_project_id, b.project_step_order as sub_project_step_order
from qms_check_rule a
left join qms_check_rule_project b on b.check_rule_id = a.check_rule_id
where a.check_rule_id = #{checkRuleId} order by b.project_step_order
</select>
<insert id="insertQmsCheckRule" parameterType="QmsCheckRule" useGeneratedKeys="true" keyProperty="checkRuleId">
insert into qms_check_rule
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="checkRuleName != null and checkRuleName != ''">check_rule_name,</if>
<if test="checkRuleType != null and checkRuleType != ''">check_rule_type,</if>
<if test="checkMode != null">check_mode,</if>
<if test="checkSample != null">check_sample,</if>
<if test="checkRuleStatus != null and checkRuleStatus != ''">check_rule_status,</if>
<if test="remark != null">remark,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="checkRuleName != null and checkRuleName != ''">#{checkRuleName},</if>
<if test="checkRuleType != null and checkRuleType != ''">#{checkRuleType},</if>
<if test="checkMode != null">#{checkMode},</if>
<if test="checkSample != null">#{checkSample},</if>
<if test="checkRuleStatus != null and checkRuleStatus != ''">#{checkRuleStatus},</if>
<if test="remark != null">#{remark},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateQmsCheckRule" parameterType="QmsCheckRule">
update qms_check_rule
<trim prefix="SET" suffixOverrides=",">
<if test="checkRuleName != null and checkRuleName != ''">check_rule_name = #{checkRuleName},</if>
<if test="checkRuleType != null and checkRuleType != ''">check_rule_type = #{checkRuleType},</if>
<if test="checkMode != null">check_mode = #{checkMode},</if>
check_sample = #{checkSample},
<if test="checkRuleStatus != null and checkRuleStatus != ''">check_rule_status = #{checkRuleStatus},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where check_rule_id = #{checkRuleId}
</update>
<delete id="deleteQmsCheckRuleByCheckRuleId" parameterType="Long">
delete from qms_check_rule where check_rule_id = #{checkRuleId}
</delete>
<delete id="deleteQmsCheckRuleByCheckRuleIds" parameterType="String">
delete from qms_check_rule where check_rule_id in
<foreach item="checkRuleId" collection="array" open="(" separator="," close=")">
#{checkRuleId}
</foreach>
</delete>
<delete id="deleteQmsCheckRuleProjectByCheckRuleIds" parameterType="String">
delete from qms_check_rule_project where check_rule_id in
<foreach item="checkRuleId" collection="array" open="(" separator="," close=")">
#{checkRuleId}
</foreach>
</delete>
<delete id="deleteQmsCheckRuleProjectByCheckRuleId" parameterType="Long">
delete from qms_check_rule_project where check_rule_id = #{checkRuleId}
</delete>
<insert id="batchQmsCheckRuleDetail">
insert into qms_check_rule_detail( check_rule_id, target_type, target_id) values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.checkRuleId}, #{item.targetType}, #{item.targetId})
</foreach>
</insert>
<insert id="batchQmsCheckRuleProject">
insert into qms_check_rule_project( check_rule_id, check_project_id, project_step_order) values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.checkRuleId}, #{item.checkProjectId}, #{item.projectStepOrder})
</foreach>
</insert>
</mapper>

@ -0,0 +1,116 @@
<?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.hw.qms.mapper.QmsCheckRuleProjectMapper">
<resultMap type="QmsCheckRuleProject" id="QmsCheckRuleProjectResult">
<result property="checkRuleId" column="check_rule_id" />
<result property="checkProjectId" column="check_project_id" />
<result property="projectStepOrder" column="project_step_order" />
<association property="CheckProject" javaType="QmsCheckProject" resultMap="CheckProjectResult" />
</resultMap>
<resultMap id="CheckProjectResult" type="QmsCheckProject">
<id property="checkProjectId" column="check_project_id" />
<result property="checkProjectName" column="check_project_name" />
<result property="checkProjectStatus" column="check_project_status" />
<result property="checkProjectProperty" column="check_project_property" />
<result property="checkMode" column="check_mode" />
<result property="checkSample" column="check_sample" />
<result property="checkTool" column="check_tool" />
<result property="unitCode" column="unit_code" />
<result property="standardValue" column="standard_value" />
<result property="upperDiff" column="upper_diff" />
<result property="downDiff" column="down_diff" />
<result property="defectSeverity" column="defect_severity" />
</resultMap>
<sql id="selectQmsCheckRuleProjectVo">
select check_rule_id, check_project_id, project_step_order from qms_check_rule_project
</sql>
<select id="selectQmsCheckRuleProjectList" parameterType="QmsCheckRuleProject" resultMap="QmsCheckRuleProjectResult">
<include refid="selectQmsCheckRuleProjectVo"/>
<where>
<if test="projectStepOrder != null "> and project_step_order = #{projectStepOrder}</if>
</where>
</select>
<select id="selectQmsCheckRuleProjectByCheckRuleId" parameterType="Long" resultMap="QmsCheckRuleProjectResult">
<include refid="selectQmsCheckRuleProjectVo"/>
where check_rule_id = #{checkRuleId}
</select>
<insert id="insertQmsCheckRuleProject" parameterType="QmsCheckRuleProject">
insert into qms_check_rule_project
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="checkRuleId != null">check_rule_id,</if>
<if test="checkProjectId != null">check_project_id,</if>
<if test="projectStepOrder != null">project_step_order,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="checkRuleId != null">#{checkRuleId},</if>
<if test="checkProjectId != null">#{checkProjectId},</if>
<if test="projectStepOrder != null">#{projectStepOrder},</if>
</trim>
</insert>
<update id="updateQmsCheckRuleProject" parameterType="QmsCheckRuleProject">
update qms_check_rule_project
<trim prefix="SET" suffixOverrides=",">
<if test="checkProjectId != null">check_project_id = #{checkProjectId},</if>
<if test="projectStepOrder != null">project_step_order = #{projectStepOrder},</if>
</trim>
where check_rule_id = #{checkRuleId}
</update>
<delete id="deleteQmsCheckRuleProjectByCheckRuleId" parameterType="Long">
delete from qms_check_rule_project where check_rule_id = #{checkRuleId}
</delete>
<delete id="deleteQmsCheckRuleProjectByCheckRuleIds" parameterType="String">
delete from qms_check_rule_project where check_rule_id in
<foreach item="checkRuleId" collection="array" open="(" separator="," close=")">
#{checkRuleId}
</foreach>
</delete>
<select id="selectQmsCheckRuleProjectListByTarget" parameterType="QmsCheckRuleProject" resultMap="QmsCheckRuleProjectResult">
select qcrp.check_rule_id, qcrp.check_project_id, qcrp.project_step_order,
qcp.check_project_name,qcp.check_project_property,qcp.standard_value,qcp.upper_diff,qcp.down_diff
from qms_check_rule_project qcrp left join qms_check_project qcp on qcrp.check_project_id = qcp.check_project_id
<where>
<if test="projectStepOrder != null "> and project_step_order = #{projectStepOrder}</if>
<if test="targetId != null and targetType!=null and targetType!=''"> and exists (select 1 from qms_check_rule_detail qcrd where
qcrd.check_rule_id=qcrd.check_rule_id and qcrd.target_type=#{targetType} and qcrd.target_id=#{targetId})</if>
</where>
</select>
<delete id="deleteQmsCheckRuleProjects">
delete from qms_check_rule_project where
<foreach item="item" index="index" collection="list" separator="or">
( check_rule_id = #{item.checkRuleId} and check_project_id = #{item.checkProjectId})
</foreach>
</delete>
<select id="selectQmsCheckRuleProjectJoinList" parameterType="QmsCheckRuleProject" resultMap="QmsCheckRuleProjectResult">
select qcrp.check_rule_id, qcrp.check_project_id, qcrp.project_step_order,qcp.check_project_name
from qms_check_rule_project qcrp left join qms_check_project qcp on qcrp.check_project_id = qcp.check_project_id
<where>
<if test="projectStepOrder != null "> and project_step_order = #{projectStepOrder}</if>
<if test="checkProjectName != null "> and check_project_name like concat('%', #{checkProjectName},
'%')</if>
</where>
</select>
</mapper>

@ -1,26 +1,10 @@
import request from '@/utils/request'
export function getMaterialBoms(query) {
export function getProductPlans(query) {
return request({
url: '/mes/api/getMaterialBoms',
url: '/mes/api/getProductPlans',
method: 'get',
params: query
})
}
export function getWarehouses(query) {
return request({
url: '/wms/api/getWarehouses',
method: 'get',
params: query
})
}
export function applyRawOutstock(query) {
return request({
url: '/wms/api/applyRawOutstock',
method: 'post',
data: query
})
}

@ -1,7 +1,7 @@
import request from '@/utils/request'
// 登录方法
export function login(username, password, code, uuid) {
export function login(username, password, code, uuid, stationId) {
return request({
url: '/auth/login',
headers: {
@ -9,7 +9,7 @@ export function login(username, password, code, uuid) {
repeatSubmit: false
},
method: 'post',
data: { username, password, code, uuid }
data: {username, password, code, uuid, stationId}
})
}
@ -59,4 +59,15 @@ export function getCodeImg() {
method: 'get',
timeout: 20000
})
}
}
// 获取验证码
export function getStations() {
return request({
headers: {
isToken: false
},
url: '/auth/getStations',
method: 'get',
})
}

@ -8,7 +8,7 @@ import { isRelogin } from '@/utils/request'
NProgress.configure({ showSpinner: false })
const whiteList = ['/login', '/register']
const whiteList = ['/login', '/login2', '/register']
router.beforeEach((to, from, next) => {
NProgress.start()

@ -46,6 +46,11 @@ export const constantRoutes = [
component: () => import('@/views/login'),
hidden: true
},
{
path: '/login2',
component: () => import('@/views/login2'),
hidden: true
},
{
path: '/register',
component: () => import('@/views/register'),

@ -72,7 +72,6 @@ function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) {
}
}
if(route.name === 'Board'){
console.log(route)
route.component = Layout2
}
if (route.children != null && route.children && route.children.length) {

@ -42,8 +42,9 @@ const user = {
const password = userInfo.password
const code = userInfo.code
const uuid = userInfo.uuid
const stationId = userInfo.stationId || ''
return new Promise((resolve, reject) => {
login(username, password, code, uuid).then(res => {
login(username, password, code, uuid,stationId).then(res => {
let data = res.data
setToken(data.access_token)
commit('SET_TOKEN', data.access_token)

@ -0,0 +1,834 @@
<template>
<div class="app-container">
<div class="headTitle">京源环保生产管理系统</div>
<div class="chartBox chartBox1">
<div class="title">工单信息</div>
<div class="chart">
<div class="form1">
<el-form label-position="right" label-width="80px" :model="form1">
<el-form-item label="工单编号">
<el-input v-model="form1.name"></el-input>
</el-form-item>
<el-form-item label="物料编号">
<el-input v-model="form1.region"></el-input>
</el-form-item>
<el-form-item label="物料名称">
<el-input v-model="form1.type"></el-input>
</el-form-item>
<el-form-item label="扫码时间">
<el-input v-model="form1.type"></el-input>
</el-form-item>
<el-form-item label="产品型号">
<el-input v-model="form1.type"></el-input>
</el-form-item>
</el-form>
<div style="text-align: center">
<el-button type="primary">图纸下发</el-button>
</div>
</div>
</div>
<div class="chart1">
<Chart ref="chart1_1"></Chart>
</div>
<div class="chart2">
<Chart ref="chart1_2"></Chart>
</div>
<div class="chart3">
<Chart ref="chart1_3"></Chart>
</div>
<div class="chart4">
<Chart ref="chart1_4"></Chart>
</div>
</div>
<div class="chartBox chartBox2">
<div class="title">库存统计</div>
<div class="chart">
<Chart ref="chart2"></Chart>
</div>
</div>
<div class="chartBox chartBox3">
<div class="title">生产派工</div>
<div class="chart">
<div class="whiteTable">
<el-table
:data="tableData"
style="width: 100%"
max-height="19.13vw"
:cell-style="{textAlign:'center'}"
:header-cell-style="{textAlign:'center'}"
>
<el-table-column
label="序号"
type="index"
width="50"
>
</el-table-column>
<el-table-column
prop="workOrderNumber"
label="工单编号"
>
</el-table-column>
<el-table-column
prop="planNum"
label="计划"
width="80"
>
</el-table-column>
<el-table-column
prop="realNum"
label="实际"
width="80"
>
</el-table-column>
<el-table-column
prop="quantityNum"
label="差异"
width="80"
>
</el-table-column>
<el-table-column
prop="startTime"
label="开始时间"
width="200"
>
</el-table-column>
<el-table-column
label="操作"
width="120"
>
<template slot-scope="scope">
<el-button
type="text"
size="small"
>
开始
</el-button>
<el-button
type="text"
size="small"
>
退库
</el-button>
<el-button
type="text"
size="small"
style="color: #f56c6c"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
</div>
</div>
</div>
<div class="chartBox chartBox4">
<div class="title">当日产量</div>
<div class="chart">
<Chart ref="chart4"></Chart>
</div>
</div>
<div class="bottom">
<el-row>
<el-button type="primary">首页</el-button>
<el-button type="success">板材领料</el-button>
<el-button type="info">SOP预览</el-button>
<el-button type="danger">退出</el-button>
</el-row>
</div>
</div>
</template>
<script>
import Chart from '@/components/board/Chart'
import * as echarts from 'echarts'
const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100
export default {
name: 'Board1',
components: {
Chart
},
data() {
return {
form: {
name: '',
region: '',
date1: '',
date2: '',
delivery: false,
type: [],
resource: '',
desc: ''
},
form1: {
name: '',
region: '',
type: ''
},
tableData: [
{
workOrderNumber: '202401221413',
planNum: '1000',
realNum: '800',
quantityNum: '200',
startTime: '2024-01-01',
},
{
workOrderNumber: '202401221413',
planNum: '1000',
realNum: '800',
quantityNum: '200',
startTime: '2024-01-01',
},
{
workOrderNumber: '202401221413',
planNum: '1000',
realNum: '800',
quantityNum: '200',
startTime: '2024-01-01',
},
],
}
},
mounted() {
this.$refs.chart1_1.setData({
series: [
{
type: "pie",
clockWise: false,
radius: ['60%', '75%'],
itemStyle: {
normal: {
label: {
show: false,
},
labelLine: {
show: false,
},
shadowBlur: 0,
shadowColor: "#aa8e2c",
},
},
hoverAnimation: false,
center: ["50%", "50%"],
data: [
{
value: 100,
label: {
normal: {
rich: {
a: {
color: "#aa8e2c",
align: "center",
fontSize: 1.1 * vw,
fontWeight: "bold",
},
b: {
color: "#fff",
align: "center",
fontSize: 0.9 * vw,
},
},
formatter: function (params) {
return (
"{a|" +
100 +
"}" +
"\n{b|计划}"
);
},
position: "center",
show: true,
textStyle: {
fontSize: "14",
fontWeight: "normal",
color: "#fff",
},
},
},
itemStyle: {
normal: {
color: "#aa8e2c",
shadowColor: "#aa8e2c",
shadowBlur: 0,
},
},
},
{
value: 0,
name: "invisible",
itemStyle: {
normal: {
color: "#412a4e",
},
emphasis: {
color: "#412a4e",
},
},
},
],
},
],
})
this.$refs.chart1_2.setData({
series: [
{
type: "pie",
clockWise: false,
radius: ['60%', '75%'],
itemStyle: {
normal: {
label: {
show: false,
},
labelLine: {
show: false,
},
shadowBlur: 0,
shadowColor: "#389af4",
},
},
hoverAnimation: false,
center: ["50%", "50%"],
data: [
{
value: 100,
label: {
normal: {
rich: {
a: {
color: "#389af4",
align: "center",
fontSize: 1.1 * vw,
fontWeight: "bold",
},
b: {
color: "#fff",
align: "center",
fontSize: 0.9 * vw,
},
},
formatter: function (params) {
return (
"{a|" +
100 +
"}" +
"\n{b|实际}"
);
},
position: "center",
show: true,
textStyle: {
fontSize: "14",
fontWeight: "normal",
color: "#fff",
},
},
},
itemStyle: {
normal: {
color: "#389af4",
shadowColor: "#389af4",
shadowBlur: 0,
},
},
},
{
value: 0,
name: "invisible",
itemStyle: {
normal: {
color: "#412a4e",
},
emphasis: {
color: "#412a4e",
},
},
},
],
},
],
})
this.$refs.chart1_3.setData({
series: [
{
type: "pie",
clockWise: false,
radius: ['60%', '75%'],
itemStyle: {
normal: {
label: {
show: false,
},
labelLine: {
show: false,
},
shadowBlur: 0,
shadowColor: "#ff0000",
},
},
hoverAnimation: false,
center: ["50%", "50%"],
data: [
{
value: 100,
label: {
normal: {
rich: {
a: {
color: "#ff0000",
align: "center",
fontSize: 1.1 * vw,
fontWeight: "bold",
},
b: {
color: "#fff",
align: "center",
fontSize: 0.9 * vw,
},
},
formatter: function (params) {
return (
"{a|" +
100 +
"}" +
"\n{b|差异}"
);
},
position: "center",
show: true,
textStyle: {
fontSize: "14",
fontWeight: "normal",
color: "#fff",
},
},
},
itemStyle: {
normal: {
color: "#b32b2b",
shadowColor: "#ff0000",
shadowBlur: 0,
},
},
},
{
value: 0,
name: "invisible",
itemStyle: {
normal: {
color: "#412a4e",
},
emphasis: {
color: "#412a4e",
},
},
},
],
},
],
})
this.$refs.chart1_4.setData({
series: [
{
type: "pie",
clockWise: false,
radius: ['60%', '75%'],
itemStyle: {
normal: {
label: {
show: false,
},
labelLine: {
show: false,
},
shadowBlur: 0,
shadowColor: "#00ff00",
},
},
hoverAnimation: false,
center: ["50%", "50%"],
data: [
{
value: 100,
label: {
normal: {
rich: {
a: {
color: "#00ff00",
align: "center",
fontSize: 1.1 * vw,
fontWeight: "bold",
},
b: {
color: "#fff",
align: "center",
fontSize: 0.9 * vw,
},
},
formatter: function (params) {
return (
"{a|" +
100 +
"%}" +
"\n{b|完成率}"
);
},
position: "center",
show: true,
textStyle: {
fontSize: "14",
fontWeight: "normal",
color: "#fff",
},
},
},
itemStyle: {
normal: {
color: "#3ac13a",
shadowColor: "#00ff00",
shadowBlur: 0,
},
},
},
{
value: 0,
name: "invisible",
itemStyle: {
normal: {
color: "#412a4e",
},
emphasis: {
color: "#412a4e",
},
},
},
],
},
],
})
this.$refs.chart2.setData({
tooltip: {
trigger: 'axis',
axisPointer: {
//
type: 'shadow' // 线'line' | 'shadow'
}
},
grid: {
left: '0',
right: '4%',
bottom: '0',
top: 20,
containLabel: true
},
xAxis: {
type: 'category',
data: [1, 2, 3, 4, 5, 6],
axisLine: {
lineStyle: {
color: 'white'
}
},
axisLabel: {
// interval: 0,
// rotate: 40,
textStyle: {
fontFamily: 'Microsoft YaHei'
}
}
},
yAxis: {
type: 'value',
axisLine: {
show: false,
lineStyle: {
color: 'white'
}
},
splitLine: {
show: false
},
axisLabel: {}
},
series: [
{
name: '数量',
label: {
normal: {
show: true,
position: 'top',
textStyle: {
color: '#a8aab0',
fontStyle: 'normal',
fontFamily: '微软雅黑',
fontSize: 0.75 * vw
}
}
},
type: 'bar',
barWidth: '30%',
barMaxWidth: 50,
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: '#39ffff'
},
{
offset: 1,
color: '#5affa6'
}
])
}
},
data: [1, 2, 3, 4, 5, 6]
}
]
})
this.$refs.chart4.setData({
tooltip: {
trigger: 'axis',
axisPointer: {
//
type: 'shadow' // 线'line' | 'shadow'
}
},
grid: {
left: '0',
right: '4%',
bottom: '0',
top: 20,
containLabel: true
},
xAxis: {
type: 'category',
data: [1, 2, 3, 4, 5, 6],
axisLine: {
lineStyle: {
color: 'white'
}
},
axisLabel: {
// interval: 0,
// rotate: 40,
textStyle: {
fontFamily: 'Microsoft YaHei'
}
}
},
yAxis: {
type: 'value',
axisLine: {
show: false,
lineStyle: {
color: 'white'
}
},
splitLine: {
show: false
},
axisLabel: {}
},
series: [
{
name: '数量',
label: {
normal: {
show: true,
position: 'top',
textStyle: {
color: '#a8aab0',
fontStyle: 'normal',
fontFamily: '微软雅黑',
fontSize: 0.75 * vw
}
}
},
type: 'bar',
barWidth: '30%',
barMaxWidth: 50,
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: '#39ffff'
},
{
offset: 1,
color: '#5affa6'
}
])
}
},
data: [1, 2, 3, 4, 5, 6]
}
]
})
},
methods: {}
}
</script>
<style lang="less" scoped>
.app-container {
background-image: url("../../../assets/board/bg.jpg");
background-repeat: no-repeat;
background-size: 100% 100%;
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
}
.headTitle {
position: absolute;
top: 5%;
left: 50%;
transform: translate(-50%, -100%);
font-size: 1.5vw;
color: #d6eaed;
letter-spacing: 10px;
}
.el-table {
background-color: #fff0;
}
.whiteTable {
/deep/ .el-table .el-table__header-wrapper th {
background-color: #fff0;
}
/deep/ .el-table tr {
background-color: #fff0;
}
/deep/ .el-table .cell {
color: #fff
}
/deep/ .el-table--enable-row-hover .el-table__body tr:hover > td.el-table__cell {
background-color: #fff0;
}
}
.chartBox {
background-image: url("../../../assets/board/box.png");
background-repeat: no-repeat;
background-size: 100% 100%;
position: absolute;
width: 46%;
height: 23.34vw;
.title {
position: absolute;
top: 8%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 1.2vw;
color: #ccc;
}
.chart {
position: absolute;
top: 16%;
left: 1%;
width: 98%;
height: 82%;
}
}
.chartBox1 {
top: 10%;
left: 2%;
.chart1 {
position: absolute;
top: 16%;
left: 60%;
width: 20%;
height: 35%;
}
.chart2 {
position: absolute;
top: 16%;
left: 80%;
width: 20%;
height: 35%;
}
.chart3 {
position: absolute;
top: 55%;
left: 60%;
width: 20%;
height: 35%;
}
.chart4 {
position: absolute;
top: 55%;
left: 80%;
width: 20%;
height: 35%;
}
}
.chartBox2 {
top: 10%;
right: 2%;
}
.chartBox3 {
top: 53%;
left: 2%;
}
.chartBox4 {
top: 53%;
right: 2%;
}
.bottom {
position: absolute;
bottom: 1.5%;
left: 2%;
}
.form1 {
position: absolute;
width: 50%;
height: 100%;
top: 2%;
left: 2%;
/deep/ .el-form-item__label {
color: #fff;
font-weight: 500;
}
/deep/ .el-input__inner {
color: #fff;
background-color: #0000;
border: none;
border-bottom: 1px solid #fff9;
border-radius: 0;
}
}
</style>

@ -20,18 +20,24 @@
>
</el-table-column>
<el-table-column
prop="workOrderNumber"
prop="dispatchCode"
label="工单编号"
>
</el-table-column>
<el-table-column
prop="plan"
prop="materialName"
label="物料名称"
width="100"
>
</el-table-column>
<el-table-column
prop="planAmount"
label="计划"
width="100"
>
</el-table-column>
<el-table-column
prop="practical"
prop="completeAmount"
label="实际"
width="100"
>
@ -41,9 +47,12 @@
label="差异"
width="100"
>
<template slot-scope="scope">
{{scope.row.planAmount -scope.row.completeAmount }}
</template>
</el-table-column>
<el-table-column
prop="deliveryTime"
prop="planDeliveryDate"
label="交付时间"
width="150"
>
@ -261,7 +270,7 @@
<script>
import Chart from '@/components/board/Chart'
import * as echarts from 'echarts'
import {getMaterialBoms,getWarehouses,applyRawOutstock} from'@/api/board/firstFloor'
import { getProductPlans} from '@/api/board/firstFloor'
const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100
export default {
@ -333,6 +342,10 @@ export default {
}
},
mounted() {
getProductPlans().then(e=>{
console.log(e)
this.tableData = e.data
})
this.$refs.chart2.setData({
tooltip: {
trigger: 'axis',

@ -0,0 +1,660 @@
<template>
<div class="app-container">
<div class="headTitle">京源环保生产管理系统</div>
<div class="chartBox chartBox1">
<div class="title">派工信息</div>
<div class="chart">
<div class="whiteTable">
<el-table
:data="tableData"
style="width: 100%"
max-height="19.13vw"
:cell-style="{textAlign:'center'}"
:header-cell-style="{textAlign:'center'}"
>
<el-table-column
label="序号"
type="index"
width="50"
>
</el-table-column>
<el-table-column
prop="workOrderNumber"
label="工单编号"
>
</el-table-column>
<el-table-column
prop="plan"
label="计划"
width="100"
>
</el-table-column>
<el-table-column
prop="practical"
label="实际"
width="100"
>
</el-table-column>
<el-table-column
prop="difference"
label="差异"
width="100"
>
</el-table-column>
<el-table-column
prop="deliveryTime"
label="交付时间"
width="150"
>
</el-table-column>
<el-table-column
label="操作"
width="120"
>
<template slot-scope="scope">
<el-button
type="text"
size="small"
>
条码打印
</el-button>
<el-button
type="text"
size="small"
>
开始
</el-button>
</template>
</el-table-column>
</el-table>
</div>
</div>
</div>
<div class="chartBox chartBox2">
<div class="title">库存统计</div>
<div class="chart">
<Chart ref="chart2"></Chart>
</div>
</div>
<div class="chartBox chartBox3">
<div class="title">计划明细</div>
<div class="chart">
<div class="whiteTable">
<el-table
:data="tableData1"
style="width: 100%"
max-height="19.13vw"
:cell-style="{textAlign:'center'}"
:header-cell-style="{textAlign:'center'}"
>
<el-table-column
label="序号"
type="index"
width="50"
>
</el-table-column>
<el-table-column
prop="planNumber"
label="计划编号"
>
</el-table-column>
<el-table-column
prop="workOrderNumber"
label="工单编号"
>
</el-table-column>
<el-table-column
prop="startTime"
label="开始时间"
width="200"
>
</el-table-column>
<el-table-column
label="操作"
width="120"
>
<template slot-scope="scope">
<el-button
type="text"
size="small"
>
装配
</el-button>
<el-button
type="text"
size="small"
@click="getMaterials(scope) "
>
领料
</el-button>
<el-button
type="text"
size="small"
>
扫描
</el-button>
<el-button
type="text"
size="small"
>
退料
</el-button>
<el-button
type="text"
size="small"
style="color: #f56c6c"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
</div>
</div>
</div>
<div class="chartBox chartBox4">
<div class="title">当日产量</div>
<div class="chart">
<Chart ref="chart4"></Chart>
</div>
</div>
<div class="bottom">
<el-row>
<el-button type="primary">首页</el-button>
<el-button type="success">键盘</el-button>
<el-button type="info">最小化</el-button>
<el-button type="danger">退出</el-button>
</el-row>
</div>
<el-dialog
title="领料"
:visible.sync="dialogVisible"
width="40%">
<el-form ref="form" :model="form" label-width="80px">
<el-form-item label="生产计划">
<el-input v-model="form.planCode"></el-input>
</el-form-item>
<el-form-item label="成品" v-show="false">
<el-input v-model="form.productId"></el-input>
</el-form-item>
<el-form-item label="领料类型" v-show="false">
<el-select v-model="form.taskType" placeholder="请选择领料类型">
<el-option label="类型一" value="shanghai"></el-option>
<el-option label="类型二" value="beijing"></el-option>
</el-select>
</el-form-item>
<el-form-item label="领料仓库" >
<el-select v-model="form.warehouseId" placeholder="请选择领料仓库" @change="form.wmsRawOutstockDetailList =[]">
<el-option v-for="item in warehouseList" :label="item.warehouseName" :value="item.warehouseId"></el-option>
</el-select>
</el-form-item>
<el-form-item label="领料原因">
<el-input type="textarea" v-model="form.applyReason"></el-input>
</el-form-item>
</el-form>
<el-table
:data="form.wmsRawOutstockDetailList"
style="width: 100%"
max-height="19.13vw"
:cell-style="{textAlign:'center'}"
:header-cell-style="{textAlign:'center'}"
>
<el-table-column
label="物料编号"
prop="materialId"
>
</el-table-column>
<el-table-column
prop="materialName"
label="物料名称"
>
</el-table-column>
<el-table-column
prop="planAmount"
label="领取数量"
width="120"
>
<template slot-scope="scope">
<el-input-number
style="width: 100%"
controls-position="right"
v-model="scope.row.quantityAcquired"
>
</el-input-number>
</template>
</el-table-column>
<el-table-column
label="操作"
width="160"
>
<template slot="header" slot-scope="scope">
<el-input
v-model="searchMaterialValue"
size="mini"
@change="searchMaterial"
placeholder="输入物料名称搜索"/>
</template>
<template slot-scope="scope">
<el-button
type="text"
size="small"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<div style="text-align: center;margin-top: 12px">
<el-button type="primary" @click="receiveMaterial"></el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import Chart from '@/components/board/Chart'
import * as echarts from 'echarts'
import {getMaterialBoms,getWarehouses,applyRawOutstock} from'@/api/board/firstFloor'
const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100
export default {
name: 'Board1',
components: {
Chart
},
data() {
return {
searchMaterialValue:'',
warehouseList:[],
form: {
warehouseId: '',
planCode: '',
applyReason: '',
productId:''||2,
planDetailCode:''||1,
taskType: '1',
wmsRawOutstockDetailList: []
},
form2: {
materialId: '',
materialName: '',
planAmount: '',
quantityAcquired:0,
},
dialogVisible: false,
addDialogVisible: false,
tableData: [
{
workOrderNumber: '202401221413',
plan: '1000',
practical: '800',
difference: '200',
deliveryTime: '2024-01-01',
},
{
workOrderNumber: '202401221413',
plan: '1000',
practical: '800',
difference: '200',
deliveryTime: '2024-01-01',
},
{
workOrderNumber: '202401221413',
plan: '1000',
practical: '800',
difference: '200',
deliveryTime: '2024-01-01',
}
],
tableData1: [
{
workOrderNumber: '202401221413',
planNumber: '202401221413-1',
startTime: '2024-01-01',
},
{
workOrderNumber: '202401221413',
planNumber: '202401221413-2',
startTime: '2024-01-01',
},
{
workOrderNumber: '202401221413',
planNumber: '202401221413-3',
startTime: '2024-01-01',
},
],
}
},
mounted() {
this.$refs.chart2.setData({
tooltip: {
trigger: 'axis',
axisPointer: {
//
type: 'shadow' // 线'line' | 'shadow'
}
},
grid: {
left: '0',
right: '4%',
bottom: '0',
top: 20,
containLabel: true
},
xAxis: {
type: 'category',
data: [1, 2, 3, 4, 5, 6],
axisLine: {
lineStyle: {
color: 'white'
}
},
axisLabel: {
// interval: 0,
// rotate: 40,
textStyle: {
fontFamily: 'Microsoft YaHei'
}
}
},
yAxis: {
type: 'value',
axisLine: {
show: false,
lineStyle: {
color: 'white'
}
},
splitLine: {
show: false
},
axisLabel: {}
},
series: [
{
name: '数量',
label: {
normal: {
show: true,
position: 'top',
textStyle: {
color: '#a8aab0',
fontStyle: 'normal',
fontFamily: '微软雅黑',
fontSize: 0.75 * vw
}
}
},
type: 'bar',
barWidth: '30%',
barMaxWidth: 50,
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: '#39ffff'
},
{
offset: 1,
color: '#5affa6'
}
])
}
},
data: [1, 2, 3, 4, 5, 6]
}
]
})
this.$refs.chart4.setData({
tooltip: {
trigger: 'axis',
axisPointer: {
//
type: 'shadow' // 线'line' | 'shadow'
}
},
grid: {
left: '0',
right: '4%',
bottom: '0',
top: 20,
containLabel: true
},
xAxis: {
type: 'category',
data: [1, 2, 3, 4, 5, 6],
axisLine: {
lineStyle: {
color: 'white'
}
},
axisLabel: {
// interval: 0,
// rotate: 40,
textStyle: {
fontFamily: 'Microsoft YaHei'
}
}
},
yAxis: {
type: 'value',
axisLine: {
show: false,
lineStyle: {
color: 'white'
}
},
splitLine: {
show: false
},
axisLabel: {}
},
series: [
{
name: '数量',
label: {
normal: {
show: true,
position: 'top',
textStyle: {
color: '#a8aab0',
fontStyle: 'normal',
fontFamily: '微软雅黑',
fontSize: 0.75 * vw
}
}
},
type: 'bar',
barWidth: '30%',
barMaxWidth: 50,
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: '#39ffff'
},
{
offset: 1,
color: '#5affa6'
}
])
}
},
data: [1, 2, 3, 4, 5, 6]
}
]
})
},
methods: {
getMaterials(val) {
this.searchMaterialValue = ''
this.dialogVisible = true
this.form = {
warehouseId: '',
planCode: val.row.planNumber,
productId:''||2,
planDetailCode:''||1,
applyReason: '',
taskType: '1',
wmsRawOutstockDetailList: []
}
getWarehouses({
warehouseFloor:1
}).then(e=>{
this.warehouseList = e.data
this.form.warehouseId = e.data[0]?.warehouseId
})
getMaterialBoms({
ancestors:1,
}).then(e=>{
this.form.wmsRawOutstockDetailList = e.data.map(r=>{
return {
materialId:r.materialId,
materialName:r.materialName,
planAmount:0,
}
})
})
},
addMaterialRequisition() {
this.addDialogVisible = false
this.form.wmsRawOutstockDetailList.push(this.form2)
},
receiveMaterial() {
applyRawOutstock(this.form).then(e=>{
console.log(e)
if(e.code === 200){
this.dialogVisible = false
this.$message({
message: '领料完成',
type: 'success'
});
}
})
},
searchMaterial(val){
console.log(val)
getMaterialBoms({
ancestors:1,
materialName:val
}).then(e=>{
this.form.wmsRawOutstockDetailList = e.data.map(r=>{
return {
materialId:r.materialId,
materialName:r.materialName,
planAmount:0,
}
})
})
}
}
}
</script>
<style lang="less" scoped>
.app-container {
background-image: url("../../../assets/board/bg.jpg");
background-repeat: no-repeat;
background-size: 100% 100%;
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
}
.headTitle {
position: absolute;
top: 5%;
left: 50%;
transform: translate(-50%, -100%);
font-size: 1.5vw;
color: #d6eaed;
letter-spacing: 10px;
}
.el-table {
background-color: #fff0;
}
.whiteTable {
/deep/ .el-table .el-table__header-wrapper th {
background-color: #fff0;
}
/deep/ .el-table tr {
background-color: #fff0;
}
/deep/ .el-table .cell {
color: #fff
}
/deep/ .el-table--enable-row-hover .el-table__body tr:hover > td.el-table__cell {
background-color: #fff0;
}
}
.chartBox {
background-image: url("../../../assets/board/box.png");
background-repeat: no-repeat;
background-size: 100% 100%;
position: absolute;
width: 46%;
height: 23.34vw;
.title {
position: absolute;
top: 8%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 1.2vw;
color: #ccc;
}
.chart {
position: absolute;
top: 16%;
left: 1%;
width: 98%;
height: 82%;
}
}
.chartBox1 {
top: 10%;
left: 2%;
}
.chartBox2 {
top: 10%;
right: 2%;
}
.chartBox3 {
top: 53%;
left: 2%;
}
.chartBox4 {
top: 53%;
right: 2%;
}
.bottom {
position: absolute;
bottom: 1.5%;
left: 2%;
}
</style>

@ -0,0 +1,833 @@
<template>
<div class="app-container">
<div class="headTitle">京源环保生产管理系统</div>
<div class="chartBox chartBox1">
<div class="title">工单信息</div>
<div class="chart">
<div class="form1">
<el-form label-position="right" label-width="80px" :model="form1">
<el-form-item label="工单编号">
<el-input v-model="form1.name"></el-input>
</el-form-item>
<el-form-item label="物料编号">
<el-input v-model="form1.region"></el-input>
</el-form-item>
<el-form-item label="物料名称">
<el-input v-model="form1.type"></el-input>
</el-form-item>
<el-form-item label="扫码时间">
<el-input v-model="form1.type"></el-input>
</el-form-item>
<el-form-item label="产品型号">
<el-input v-model="form1.type"></el-input>
</el-form-item>
</el-form>
<div style="text-align: center">
<el-button type="primary">图纸下发</el-button>
</div>
</div>
</div>
<div class="chart1">
<Chart ref="chart1_1"></Chart>
</div>
<div class="chart2">
<Chart ref="chart1_2"></Chart>
</div>
<div class="chart3">
<Chart ref="chart1_3"></Chart>
</div>
<div class="chart4">
<Chart ref="chart1_4"></Chart>
</div>
</div>
<div class="chartBox chartBox2">
<div class="title">库存统计</div>
<div class="chart">
<Chart ref="chart2"></Chart>
</div>
</div>
<div class="chartBox chartBox3">
<div class="title">生产派工</div>
<div class="chart">
<div class="whiteTable">
<el-table
:data="tableData"
style="width: 100%"
max-height="19.13vw"
:cell-style="{textAlign:'center'}"
:header-cell-style="{textAlign:'center'}"
>
<el-table-column
label="序号"
type="index"
width="50"
>
</el-table-column>
<el-table-column
prop="workOrderNumber"
label="工单编号"
>
</el-table-column>
<el-table-column
prop="planNum"
label="计划"
width="80"
>
</el-table-column>
<el-table-column
prop="realNum"
label="实际"
width="80"
>
</el-table-column>
<el-table-column
prop="quantityNum"
label="差异"
width="80"
>
</el-table-column>
<el-table-column
prop="startTime"
label="开始时间"
width="200"
>
</el-table-column>
<el-table-column
label="操作"
width="120"
>
<template slot-scope="scope">
<el-button
type="text"
size="small"
>
开始
</el-button>
<el-button
type="text"
size="small"
>
退库
</el-button>
<el-button
type="text"
size="small"
style="color: #f56c6c"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
</div>
</div>
</div>
<div class="chartBox chartBox4">
<div class="title">当日产量</div>
<div class="chart">
<Chart ref="chart4"></Chart>
</div>
</div>
<div class="bottom">
<el-row>
<el-button type="primary">首页</el-button>
<el-button type="info">SOP预览</el-button>
<el-button type="danger">退出</el-button>
</el-row>
</div>
</div>
</template>
<script>
import Chart from '@/components/board/Chart'
import * as echarts from 'echarts'
const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100
export default {
name: 'Board1',
components: {
Chart
},
data() {
return {
form: {
name: '',
region: '',
date1: '',
date2: '',
delivery: false,
type: [],
resource: '',
desc: ''
},
form1: {
name: '',
region: '',
type: ''
},
tableData: [
{
workOrderNumber: '202401221413',
planNum: '1000',
realNum: '800',
quantityNum: '200',
startTime: '2024-01-01',
},
{
workOrderNumber: '202401221413',
planNum: '1000',
realNum: '800',
quantityNum: '200',
startTime: '2024-01-01',
},
{
workOrderNumber: '202401221413',
planNum: '1000',
realNum: '800',
quantityNum: '200',
startTime: '2024-01-01',
},
],
}
},
mounted() {
this.$refs.chart1_1.setData({
series: [
{
type: "pie",
clockWise: false,
radius: ['60%', '75%'],
itemStyle: {
normal: {
label: {
show: false,
},
labelLine: {
show: false,
},
shadowBlur: 0,
shadowColor: "#aa8e2c",
},
},
hoverAnimation: false,
center: ["50%", "50%"],
data: [
{
value: 100,
label: {
normal: {
rich: {
a: {
color: "#aa8e2c",
align: "center",
fontSize: 1.1 * vw,
fontWeight: "bold",
},
b: {
color: "#fff",
align: "center",
fontSize: 0.9 * vw,
},
},
formatter: function (params) {
return (
"{a|" +
100 +
"}" +
"\n{b|计划}"
);
},
position: "center",
show: true,
textStyle: {
fontSize: "14",
fontWeight: "normal",
color: "#fff",
},
},
},
itemStyle: {
normal: {
color: "#aa8e2c",
shadowColor: "#aa8e2c",
shadowBlur: 0,
},
},
},
{
value: 0,
name: "invisible",
itemStyle: {
normal: {
color: "#412a4e",
},
emphasis: {
color: "#412a4e",
},
},
},
],
},
],
})
this.$refs.chart1_2.setData({
series: [
{
type: "pie",
clockWise: false,
radius: ['60%', '75%'],
itemStyle: {
normal: {
label: {
show: false,
},
labelLine: {
show: false,
},
shadowBlur: 0,
shadowColor: "#389af4",
},
},
hoverAnimation: false,
center: ["50%", "50%"],
data: [
{
value: 100,
label: {
normal: {
rich: {
a: {
color: "#389af4",
align: "center",
fontSize: 1.1 * vw,
fontWeight: "bold",
},
b: {
color: "#fff",
align: "center",
fontSize: 0.9 * vw,
},
},
formatter: function (params) {
return (
"{a|" +
100 +
"}" +
"\n{b|实际}"
);
},
position: "center",
show: true,
textStyle: {
fontSize: "14",
fontWeight: "normal",
color: "#fff",
},
},
},
itemStyle: {
normal: {
color: "#389af4",
shadowColor: "#389af4",
shadowBlur: 0,
},
},
},
{
value: 0,
name: "invisible",
itemStyle: {
normal: {
color: "#412a4e",
},
emphasis: {
color: "#412a4e",
},
},
},
],
},
],
})
this.$refs.chart1_3.setData({
series: [
{
type: "pie",
clockWise: false,
radius: ['60%', '75%'],
itemStyle: {
normal: {
label: {
show: false,
},
labelLine: {
show: false,
},
shadowBlur: 0,
shadowColor: "#ff0000",
},
},
hoverAnimation: false,
center: ["50%", "50%"],
data: [
{
value: 100,
label: {
normal: {
rich: {
a: {
color: "#ff0000",
align: "center",
fontSize: 1.1 * vw,
fontWeight: "bold",
},
b: {
color: "#fff",
align: "center",
fontSize: 0.9 * vw,
},
},
formatter: function (params) {
return (
"{a|" +
100 +
"}" +
"\n{b|差异}"
);
},
position: "center",
show: true,
textStyle: {
fontSize: "14",
fontWeight: "normal",
color: "#fff",
},
},
},
itemStyle: {
normal: {
color: "#b32b2b",
shadowColor: "#ff0000",
shadowBlur: 0,
},
},
},
{
value: 0,
name: "invisible",
itemStyle: {
normal: {
color: "#412a4e",
},
emphasis: {
color: "#412a4e",
},
},
},
],
},
],
})
this.$refs.chart1_4.setData({
series: [
{
type: "pie",
clockWise: false,
radius: ['60%', '75%'],
itemStyle: {
normal: {
label: {
show: false,
},
labelLine: {
show: false,
},
shadowBlur: 0,
shadowColor: "#00ff00",
},
},
hoverAnimation: false,
center: ["50%", "50%"],
data: [
{
value: 100,
label: {
normal: {
rich: {
a: {
color: "#00ff00",
align: "center",
fontSize: 1.1 * vw,
fontWeight: "bold",
},
b: {
color: "#fff",
align: "center",
fontSize: 0.9 * vw,
},
},
formatter: function (params) {
return (
"{a|" +
100 +
"%}" +
"\n{b|完成率}"
);
},
position: "center",
show: true,
textStyle: {
fontSize: "14",
fontWeight: "normal",
color: "#fff",
},
},
},
itemStyle: {
normal: {
color: "#3ac13a",
shadowColor: "#00ff00",
shadowBlur: 0,
},
},
},
{
value: 0,
name: "invisible",
itemStyle: {
normal: {
color: "#412a4e",
},
emphasis: {
color: "#412a4e",
},
},
},
],
},
],
})
this.$refs.chart2.setData({
tooltip: {
trigger: 'axis',
axisPointer: {
//
type: 'shadow' // 线'line' | 'shadow'
}
},
grid: {
left: '0',
right: '4%',
bottom: '0',
top: 20,
containLabel: true
},
xAxis: {
type: 'category',
data: [1, 2, 3, 4, 5, 6],
axisLine: {
lineStyle: {
color: 'white'
}
},
axisLabel: {
// interval: 0,
// rotate: 40,
textStyle: {
fontFamily: 'Microsoft YaHei'
}
}
},
yAxis: {
type: 'value',
axisLine: {
show: false,
lineStyle: {
color: 'white'
}
},
splitLine: {
show: false
},
axisLabel: {}
},
series: [
{
name: '数量',
label: {
normal: {
show: true,
position: 'top',
textStyle: {
color: '#a8aab0',
fontStyle: 'normal',
fontFamily: '微软雅黑',
fontSize: 0.75 * vw
}
}
},
type: 'bar',
barWidth: '30%',
barMaxWidth: 50,
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: '#39ffff'
},
{
offset: 1,
color: '#5affa6'
}
])
}
},
data: [1, 2, 3, 4, 5, 6]
}
]
})
this.$refs.chart4.setData({
tooltip: {
trigger: 'axis',
axisPointer: {
//
type: 'shadow' // 线'line' | 'shadow'
}
},
grid: {
left: '0',
right: '4%',
bottom: '0',
top: 20,
containLabel: true
},
xAxis: {
type: 'category',
data: [1, 2, 3, 4, 5, 6],
axisLine: {
lineStyle: {
color: 'white'
}
},
axisLabel: {
// interval: 0,
// rotate: 40,
textStyle: {
fontFamily: 'Microsoft YaHei'
}
}
},
yAxis: {
type: 'value',
axisLine: {
show: false,
lineStyle: {
color: 'white'
}
},
splitLine: {
show: false
},
axisLabel: {}
},
series: [
{
name: '数量',
label: {
normal: {
show: true,
position: 'top',
textStyle: {
color: '#a8aab0',
fontStyle: 'normal',
fontFamily: '微软雅黑',
fontSize: 0.75 * vw
}
}
},
type: 'bar',
barWidth: '30%',
barMaxWidth: 50,
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: '#39ffff'
},
{
offset: 1,
color: '#5affa6'
}
])
}
},
data: [1, 2, 3, 4, 5, 6]
}
]
})
},
methods: {}
}
</script>
<style lang="less" scoped>
.app-container {
background-image: url("../../../assets/board/bg.jpg");
background-repeat: no-repeat;
background-size: 100% 100%;
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
}
.headTitle {
position: absolute;
top: 5%;
left: 50%;
transform: translate(-50%, -100%);
font-size: 1.5vw;
color: #d6eaed;
letter-spacing: 10px;
}
.el-table {
background-color: #fff0;
}
.whiteTable {
/deep/ .el-table .el-table__header-wrapper th {
background-color: #fff0;
}
/deep/ .el-table tr {
background-color: #fff0;
}
/deep/ .el-table .cell {
color: #fff
}
/deep/ .el-table--enable-row-hover .el-table__body tr:hover > td.el-table__cell {
background-color: #fff0;
}
}
.chartBox {
background-image: url("../../../assets/board/box.png");
background-repeat: no-repeat;
background-size: 100% 100%;
position: absolute;
width: 46%;
height: 23.34vw;
.title {
position: absolute;
top: 8%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 1.2vw;
color: #ccc;
}
.chart {
position: absolute;
top: 16%;
left: 1%;
width: 98%;
height: 82%;
}
}
.chartBox1 {
top: 10%;
left: 2%;
.chart1 {
position: absolute;
top: 16%;
left: 60%;
width: 20%;
height: 35%;
}
.chart2 {
position: absolute;
top: 16%;
left: 80%;
width: 20%;
height: 35%;
}
.chart3 {
position: absolute;
top: 55%;
left: 60%;
width: 20%;
height: 35%;
}
.chart4 {
position: absolute;
top: 55%;
left: 80%;
width: 20%;
height: 35%;
}
}
.chartBox2 {
top: 10%;
right: 2%;
}
.chartBox3 {
top: 53%;
left: 2%;
}
.chartBox4 {
top: 53%;
right: 2%;
}
.bottom {
position: absolute;
bottom: 1.5%;
left: 2%;
}
.form1 {
position: absolute;
width: 50%;
height: 100%;
top: 2%;
left: 2%;
/deep/ .el-form-item__label {
color: #fff;
font-weight: 500;
}
/deep/ .el-input__inner {
color: #fff;
background-color: #0000;
border: none;
border-bottom: 1px solid #fff9;
border-radius: 0;
}
}
</style>

@ -1,29 +1,35 @@
<template>
<div class="login">
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
<h3 class="title">京源环保管理系统</h3>
<h3 class="title">京源环保办公系统</h3>
<el-form-item prop="username">
<el-input
v-model="loginForm.username"
type="text"
auto-complete="off"
placeholder="账号"
type="text"
>
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
<svg-icon slot="prefix" class="el-input__icon input-icon" icon-class="user"/>
</el-input>
</el-form-item>
<el-form-item prop="password">
<el-input
v-model="loginForm.password"
type="password"
auto-complete="off"
placeholder="密码"
type="password"
@keyup.enter.native="handleLogin"
>
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
<svg-icon slot="prefix" class="el-input__icon input-icon" icon-class="password"/>
</el-input>
</el-form-item>
<el-form-item prop="code" v-if="captchaEnabled">
<el-form-item v-if="isStationId" prop="stationId">
<el-select v-model="loginForm.stationId" placeholder="请选择工位" style="width: 100%">
<el-option v-for="item in options" :key="item.stationId" :label="item.stationName"
:value="item.stationId"></el-option>
</el-select>
</el-form-item>
<el-form-item v-if="captchaEnabled" prop="code">
<el-input
v-model="loginForm.code"
auto-complete="off"
@ -31,10 +37,10 @@
style="width: 63%"
@keyup.enter.native="handleLogin"
>
<svg-icon slot="prefix" icon-class="validCode" class="el-input__icon input-icon" />
<svg-icon slot="prefix" class="el-input__icon input-icon" icon-class="validCode"/>
</el-input>
<div class="login-code">
<img :src="codeUrl" @click="getCode" class="login-code-img"/>
<img :src="codeUrl" class="login-code-img" @click="getCode"/>
</div>
</el-form-item>
<el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;"></el-checkbox>
@ -42,29 +48,29 @@
<el-button
:loading="loading"
size="medium"
type="primary"
style="width:100%;"
type="primary"
@click.native.prevent="handleLogin"
>
<span v-if="!loading"> </span>
<span v-else> ...</span>
</el-button>
<div style="float: right;" v-if="register">
<router-link class="link-type" :to="'/register'">立即注册</router-link>
<div v-if="register" style="float: right;">
<router-link :to="'/register'" class="link-type">立即注册</router-link>
</div>
</el-form-item>
</el-form>
<!-- 底部 -->
<div class="el-login-footer">
<span>Copyright © 2018-2023 ruoyi.vip All Rights Reserved.</span>
</div>
<!-- <div class="el-login-footer">-->
<!-- <span>Copyright © 2018-2023 ruoyi.vip All Rights Reserved.</span>-->
<!-- </div>-->
</div>
</template>
<script>
import { getCodeImg } from "@/api/login";
import {getCodeImg, getStations} from "@/api/login";
import Cookies from "js-cookie";
import { encrypt, decrypt } from '@/utils/jsencrypt'
import {encrypt, decrypt} from '@/utils/jsencrypt'
export default {
name: "Login",
@ -75,29 +81,40 @@ export default {
username: "admin",
password: "admin123",
rememberMe: false,
stationId: '',
code: "",
uuid: ""
},
loginRules: {
username: [
{ required: true, trigger: "blur", message: "请输入您的账号" }
{required: true, trigger: "blur", message: "请输入您的账号"}
],
password: [
{ required: true, trigger: "blur", message: "请输入您的密码" }
{required: true, trigger: "blur", message: "请输入您的密码"}
],
code: [{ required: true, trigger: "change", message: "请输入验证码" }]
code: [{required: true, trigger: "change", message: "请输入验证码"}]
},
loading: false,
//
captchaEnabled: true,
//
register: false,
redirect: undefined
redirect: undefined,
isStationId: false,
options: [],
floorData: [
{
floor: 1,
processId: 1,
route: '/board/firstFloor'
}
]
};
},
watch: {
$route: {
handler: function(route) {
handler: function (route) {
this.redirect = route.query && route.query.redirect;
},
immediate: true
@ -106,6 +123,15 @@ export default {
created() {
this.getCode();
this.getCookie();
// this.loginForm.stationId = this.$route?.query?.station || '';
if (this.$route?.query?.isStationId === 'true') {
this.isStationId = true
}
},
mounted() {
getStations().then(e => {
this.options = e.data
})
},
methods: {
getCode() {
@ -132,16 +158,20 @@ export default {
if (valid) {
this.loading = true;
if (this.loginForm.rememberMe) {
Cookies.set("username", this.loginForm.username, { expires: 30 });
Cookies.set("password", encrypt(this.loginForm.password), { expires: 30 });
Cookies.set('rememberMe', this.loginForm.rememberMe, { expires: 30 });
Cookies.set("username", this.loginForm.username, {expires: 30});
Cookies.set("password", encrypt(this.loginForm.password), {expires: 30});
Cookies.set('rememberMe', this.loginForm.rememberMe, {expires: 30});
} else {
Cookies.remove("username");
Cookies.remove("password");
Cookies.remove('rememberMe');
}
this.$store.dispatch("Login", this.loginForm).then(() => {
this.$router.push({ path: this.redirect || "/" }).catch(()=>{});
let data = this.options.find(v=>v.stationId === this.loginForm.stationId) || {}
let routeData = this.floorData.find(v=>v.floor === data.floor && v.processId === data.processId)
console.log(routeData)
this.$router.push({path: routeData.route || this.redirect || "/"}).catch(() => {
});
}).catch(() => {
this.loading = false;
if (this.captchaEnabled) {
@ -155,7 +185,7 @@ export default {
};
</script>
<style rel="stylesheet/scss" lang="scss">
<style lang="scss" rel="stylesheet/scss">
.login {
display: flex;
justify-content: center;
@ -164,6 +194,7 @@ export default {
background-image: url("../assets/images/login-background.jpg");
background-size: cover;
}
.title {
margin: 0px auto 30px auto;
text-align: center;
@ -175,32 +206,39 @@ export default {
background: #ffffff;
width: 400px;
padding: 25px 25px 5px 25px;
.el-input {
height: 38px;
input {
height: 38px;
}
}
.input-icon {
height: 39px;
width: 14px;
margin-left: 2px;
}
}
.login-tip {
font-size: 13px;
text-align: center;
color: #bfbfbf;
}
.login-code {
width: 33%;
height: 38px;
float: right;
img {
cursor: pointer;
vertical-align: middle;
}
}
.el-login-footer {
height: 40px;
line-height: 40px;
@ -213,6 +251,7 @@ export default {
font-size: 12px;
letter-spacing: 1px;
}
.login-code-img {
height: 38px;
}

@ -0,0 +1,219 @@
<template>
<div class="login">
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
<h3 class="title">京源环保管理系统</h3>
<el-form-item prop="username">
<el-input
v-model="loginForm.username"
type="text"
auto-complete="off"
placeholder="账号"
>
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
</el-input>
</el-form-item>
<el-form-item prop="password">
<el-input
v-model="loginForm.password"
type="password"
auto-complete="off"
placeholder="密码"
@keyup.enter.native="handleLogin"
>
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
</el-input>
</el-form-item>
<el-form-item prop="code" v-if="captchaEnabled">
<el-input
v-model="loginForm.code"
auto-complete="off"
placeholder="验证码"
style="width: 63%"
@keyup.enter.native="handleLogin"
>
<svg-icon slot="prefix" icon-class="validCode" class="el-input__icon input-icon" />
</el-input>
<div class="login-code">
<img :src="codeUrl" @click="getCode" class="login-code-img"/>
</div>
</el-form-item>
<el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;"></el-checkbox>
<el-form-item style="width:100%;">
<el-button
:loading="loading"
size="medium"
type="primary"
style="width:100%;"
@click.native.prevent="handleLogin"
>
<span v-if="!loading"> </span>
<span v-else> ...</span>
</el-button>
<div style="float: right;" v-if="register">
<router-link class="link-type" :to="'/register'">立即注册</router-link>
</div>
</el-form-item>
</el-form>
<!-- 底部 -->
<div class="el-login-footer">
<span>Copyright © 2018-2023 ruoyi.vip All Rights Reserved.</span>
</div>
</div>
</template>
<script>
import { getCodeImg } from "@/api/login";
import Cookies from "js-cookie";
import { encrypt, decrypt } from '@/utils/jsencrypt'
export default {
name: "Login",
data() {
return {
codeUrl: "",
loginForm: {
username: "admin",
password: "admin123",
rememberMe: false,
code: "",
uuid: ""
},
loginRules: {
username: [
{ required: true, trigger: "blur", message: "请输入您的账号" }
],
password: [
{ required: true, trigger: "blur", message: "请输入您的密码" }
],
code: [{ required: true, trigger: "change", message: "请输入验证码" }]
},
loading: false,
//
captchaEnabled: true,
//
register: false,
redirect: undefined
};
},
watch: {
$route: {
handler: function(route) {
this.redirect = route.query && route.query.redirect;
},
immediate: true
}
},
created() {
this.getCode();
this.getCookie();
},
methods: {
getCode() {
getCodeImg().then(res => {
this.captchaEnabled = res.captchaEnabled === undefined ? true : res.captchaEnabled;
if (this.captchaEnabled) {
this.codeUrl = "data:image/gif;base64," + res.img;
this.loginForm.uuid = res.uuid;
}
});
},
getCookie() {
const username = Cookies.get("username");
const password = Cookies.get("password");
const rememberMe = Cookies.get('rememberMe')
this.loginForm = {
username: username === undefined ? this.loginForm.username : username,
password: password === undefined ? this.loginForm.password : decrypt(password),
rememberMe: rememberMe === undefined ? false : Boolean(rememberMe)
};
},
handleLogin() {
this.$refs.loginForm.validate(valid => {
if (valid) {
this.loading = true;
if (this.loginForm.rememberMe) {
Cookies.set("username", this.loginForm.username, { expires: 30 });
Cookies.set("password", encrypt(this.loginForm.password), { expires: 30 });
Cookies.set('rememberMe', this.loginForm.rememberMe, { expires: 30 });
} else {
Cookies.remove("username");
Cookies.remove("password");
Cookies.remove('rememberMe');
}
this.$store.dispatch("Login", this.loginForm).then(() => {
this.$router.push({ path: this.redirect || "/" }).catch(()=>{});
}).catch(() => {
this.loading = false;
if (this.captchaEnabled) {
this.getCode();
}
});
}
});
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss">
.login {
display: flex;
justify-content: center;
align-items: center;
height: 100%;
background-image: url("../assets/images/login-background.jpg");
background-size: cover;
}
.title {
margin: 0px auto 30px auto;
text-align: center;
color: #707070;
}
.login-form {
border-radius: 6px;
background: #ffffff;
width: 400px;
padding: 25px 25px 5px 25px;
.el-input {
height: 38px;
input {
height: 38px;
}
}
.input-icon {
height: 39px;
width: 14px;
margin-left: 2px;
}
}
.login-tip {
font-size: 13px;
text-align: center;
color: #bfbfbf;
}
.login-code {
width: 33%;
height: 38px;
float: right;
img {
cursor: pointer;
vertical-align: middle;
}
}
.el-login-footer {
height: 40px;
line-height: 40px;
position: fixed;
bottom: 0;
width: 100%;
text-align: center;
color: #fff;
font-family: Arial;
font-size: 12px;
letter-spacing: 1px;
}
.login-code-img {
height: 38px;
}
</style>
Loading…
Cancel
Save