Merge remote-tracking branch 'origin/master'

master
夜笙歌 2 years ago
commit 66c9654dcb

@ -71,4 +71,6 @@ public interface RemoteTdEngineService {
@PostMapping("/tdengine/alterTableTags")
public R<?> alterTableTags(@Validated @RequestBody List<AlterTagVo> alterTagVos, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
@PostMapping("/tdengine/dropTable")
R<?> dropTable(@Validated @RequestBody TdTableDropVo tdTableDropVo, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}

@ -0,0 +1,27 @@
package com.hw.tdengine.api.domain;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
/**
* @Description: drop
* @ClassName: TdTableDropVo
* @Author : xins
* @Date :2024-04-20 11:09
* @Version :1.0
*/
@Data
public class TdTableDropVo {
//数据库名称
@NotEmpty(message="databaseName cannot be empty")
private String databaseName;
//子表名称
@NotEmpty(message="tableName cannot be empty")
private String tableName;
}

@ -113,6 +113,11 @@ public class RemoteTdEngineFallbackFactory implements FallbackFactory<RemoteTdEn
return R.fail("批量修改子表tag值失败:" + throwable.getMessage());
}
@Override
public R<?> dropTable(TdTableDropVo tdTableDropVo, String source) {
return R.fail("drop子表失败:" + throwable.getMessage());
}
};
}
}

@ -150,6 +150,33 @@ public class Seq {
//检修计划序列类型
public static final String planRepairSeqType = "PLANREPAIR";
//检修计划接口序列数
private static AtomicInteger planRepairSeq = new AtomicInteger(1);
//检修记录标识
public static final String planRepairCode = "PR";
//检修工单序列类型
public static final String repairInstanceSeqTupe = "REPAIRINSTANCE";
//检修工单接口序列数
private static AtomicInteger repairInstanceSeq = new AtomicInteger(1);
//检修工单标识
public static final String repairInstanceCode = "RI";
//检修计划序列类型
public static final String planInspectSeqType = "PLANINSPECT";
//检修计划接口序列数
private static AtomicInteger planInspectSeq = new AtomicInteger(1);
//检修记录标识
public static final String planInspectCode = "PIC";
//检修工单序列类型
public static final String InspectInstanceSeqTupe = "INSPECTINSTANCE";
//检修工单接口序列数
private static AtomicInteger INSPECTInstanceSeq = new AtomicInteger(1);
//检修工单标识
public static final String InspectInstanceCode = "IIC";
// 保养计划序列类型
public static final String planMaintSeqType = "PLANMAINT";

@ -30,17 +30,7 @@ public class DmsApiController extends BaseController {
//APS-MyPuRz3G6HfBYcH8dw7Y2ai1D6iZRmXX apifox令牌
/**
* PDA-
*
*
* faultSourceType
* faultSourceId
* faultType
* faultDescription
* designOperations
* id deviceId
* repairType
* id outsrcId()
* imgUrl()
* */
@PostMapping("/PDAFault")
@ResponseBody

@ -48,6 +48,12 @@ public class DmsBaseDeviceSuplierController extends BaseController
}
//todo 新加一个con 拿掉分页
@GetMapping("/selectDmsBaseDeviceSuplierByDeviceId")
public AjaxResult selectDmsBaseDeviceSuplierByDeviceId(Long deviceId){
List<DmsBaseDeviceSuplier> dmsBaseDeviceSupliers = dmsBaseDeviceSuplierService.selectDmsBaseDeviceSuplierDeviceId(deviceId);
return success(dmsBaseDeviceSupliers);
}
/**
*
*/

@ -2,6 +2,7 @@ package com.hw.dms.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.hw.common.core.annotation.Excel;
@ -44,6 +45,12 @@ public class DmsPlanInspect extends BaseEntity
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "计划巡检时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date planTime;
/** 时限*/
@Excel(name ="时限")
private Long timeLimit;
/** 关联sysjob主键id */
@Excel(name = "关联sysjob主键id")
private Long jobId;
/** 循环周期 */
@Excel(name = "循环周期")
@ -59,10 +66,49 @@ public class DmsPlanInspect extends BaseEntity
private String cronExpression;
private Long timeLimitDays;
private Long timeLimitHours;
public Long getTimeLimitDays() {
return timeLimitDays;
}
public void setTimeLimitDays(Long timeLimitDays) {
this.timeLimitDays = timeLimitDays;
}
public Long getTimeLimitHours() {
return timeLimitHours;
}
public void setTimeLimitHours(Long timeLimitHours) {
this.timeLimitHours = timeLimitHours;
}
public String getCronExpression() {
return cronExpression;
}
public Long getTimeLimit() {
return timeLimit;
}
public void setTimeLimit(Long timeLimit) {
this.timeLimit = timeLimit;
}
public Long getJobId() {
return jobId;
}
public void setJobId(Long jobId) {
this.jobId = jobId;
}
public void setCronExpression(String cronExpression) {
this.cronExpression = cronExpression;
}
@ -160,22 +206,20 @@ public class DmsPlanInspect extends BaseEntity
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("planInspectId", getPlanInspectId())
.append("planInspectCode", getPlanInspectCode())
.append("planInspectName", getPlanInspectName())
.append("inspectType", getInspectType())
.append("inspectRouteId", getInspectRouteId())
.append("deviceAmount", getDeviceAmount())
.append("planTime", getPlanTime())
.append("cyclePeriod", getCyclePeriod())
.append("performer", getPerformer())
.append("isFlag", getIsFlag())
.append("remark", getRemark())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
return "DmsPlanInspect{" +
"planInspectId=" + planInspectId +
", planInspectCode='" + planInspectCode + '\'' +
", planInspectName='" + planInspectName + '\'' +
", inspectType='" + inspectType + '\'' +
", inspectRouteId=" + inspectRouteId +
", deviceAmount=" + deviceAmount +
", planTime=" + planTime +
", timeLimit=" + timeLimit +
", jobId=" + jobId +
", cyclePeriod='" + cyclePeriod + '\'' +
", performer='" + performer + '\'' +
", isFlag='" + isFlag + '\'' +
", cronExpression='" + cronExpression + '\'' +
'}';
}
}

@ -10,7 +10,7 @@ import com.hw.common.core.web.domain.BaseEntity;
/**
* dms_record_inspect
*
*
* @author Open Platform
* @date 2024-01-16
*/
@ -25,6 +25,8 @@ public class DmsRecordInspect extends BaseEntity
@Excel(name = "巡检单号")
private String billsInspectCode;
/** 计划ID*/
private Long planInspectId;
/** 检查类型(1巡检,2点检) */
@Excel(name = "检查类型(1巡检,2点检)")
private String inspectType;
@ -40,8 +42,11 @@ public class DmsRecordInspect extends BaseEntity
/** 计划巡检时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "计划巡检时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date planTime;
private Date planBeginTime;
/** 计划巡检结束时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "计划巡检时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date planEndTime;
/** 实际开始时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "实际开始时间", width = 30, dateFormat = "yyyy-MM-dd")
@ -68,135 +73,148 @@ public class DmsRecordInspect extends BaseEntity
@Excel(name = "是否标识1-是0-否")
private String isFlag;
public void setRecordInspectId(Long recordInspectId)
public void setRecordInspectId(Long recordInspectId)
{
this.recordInspectId = recordInspectId;
}
public Long getRecordInspectId()
public Long getRecordInspectId()
{
return recordInspectId;
}
public void setBillsInspectCode(String billsInspectCode)
public void setBillsInspectCode(String billsInspectCode)
{
this.billsInspectCode = billsInspectCode;
}
public String getBillsInspectCode()
public String getBillsInspectCode()
{
return billsInspectCode;
}
public void setInspectType(String inspectType)
public void setInspectType(String inspectType)
{
this.inspectType = inspectType;
}
public String getInspectType()
public String getInspectType()
{
return inspectType;
}
public void setInspectRouteId(Long inspectRouteId)
public void setInspectRouteId(Long inspectRouteId)
{
this.inspectRouteId = inspectRouteId;
}
public Long getInspectRouteId()
public Long getInspectRouteId()
{
return inspectRouteId;
}
public void setDeviceAmount(Long deviceAmount)
public void setDeviceAmount(Long deviceAmount)
{
this.deviceAmount = deviceAmount;
}
public Long getDeviceAmount()
public Long getDeviceAmount()
{
return deviceAmount;
}
public void setPlanTime(Date planTime)
{
this.planTime = planTime;
}
public Date getPlanTime()
{
return planTime;
}
public void setRealBeginTime(Date realBeginTime)
public void setRealBeginTime(Date realBeginTime)
{
this.realBeginTime = realBeginTime;
}
public Date getRealBeginTime()
public Date getRealBeginTime()
{
return realBeginTime;
}
public void setRealEndTime(Date realEndTime)
public void setRealEndTime(Date realEndTime)
{
this.realEndTime = realEndTime;
}
public Date getRealEndTime()
public Date getRealEndTime()
{
return realEndTime;
}
public void setPerformer(String performer)
public void setPerformer(String performer)
{
this.performer = performer;
}
public String getPerformer()
public String getPerformer()
{
return performer;
}
public void setInspectStatus(Long inspectStatus)
public void setInspectStatus(Long inspectStatus)
{
this.inspectStatus = inspectStatus;
}
public Long getInspectStatus()
public Long getInspectStatus()
{
return inspectStatus;
}
public void setInspectDuration(BigDecimal inspectDuration)
public void setInspectDuration(BigDecimal inspectDuration)
{
this.inspectDuration = inspectDuration;
}
public BigDecimal getInspectDuration()
public BigDecimal getInspectDuration()
{
return inspectDuration;
}
public void setIsFlag(String isFlag)
public void setIsFlag(String isFlag)
{
this.isFlag = isFlag;
}
public String getIsFlag()
public String getIsFlag()
{
return isFlag;
}
public Long getPlanInspectId() {
return planInspectId;
}
public void setPlanInspectId(Long planInspectId) {
this.planInspectId = planInspectId;
}
public Date getPlanBeginTime() {
return planBeginTime;
}
public void setPlanBeginTime(Date planBeginTime) {
this.planBeginTime = planBeginTime;
}
public Date getPlanEndTime() {
return planEndTime;
}
public void setPlanEndTime(Date planEndTime) {
this.planEndTime = planEndTime;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("recordInspectId", getRecordInspectId())
.append("billsInspectCode", getBillsInspectCode())
.append("inspectType", getInspectType())
.append("inspectRouteId", getInspectRouteId())
.append("deviceAmount", getDeviceAmount())
.append("planTime", getPlanTime())
.append("realBeginTime", getRealBeginTime())
.append("realEndTime", getRealEndTime())
.append("performer", getPerformer())
.append("inspectStatus", getInspectStatus())
.append("inspectDuration", getInspectDuration())
.append("isFlag", getIsFlag())
.append("remark", getRemark())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
return "DmsRecordInspect{" +
"recordInspectId=" + recordInspectId +
", billsInspectCode='" + billsInspectCode + '\'' +
", planInspectId=" + planInspectId +
", inspectType='" + inspectType + '\'' +
", inspectRouteId=" + inspectRouteId +
", deviceAmount=" + deviceAmount +
", planBeginTime=" + planBeginTime +
", planEndTime=" + planEndTime +
", realBeginTime=" + realBeginTime +
", realEndTime=" + realEndTime +
", performer='" + performer + '\'' +
", inspectStatus=" + inspectStatus +
", inspectDuration=" + inspectDuration +
", isFlag='" + isFlag + '\'' +
'}';
}
}

@ -5,15 +5,15 @@ import com.hw.dms.domain.DmsBaseDeviceSuplier;
/**
* Mapper
*
*
* @author xins
* @date 2023-12-28
*/
public interface DmsBaseDeviceSuplierMapper
public interface DmsBaseDeviceSuplierMapper
{
/**
*
*
*
* @param supplierId
* @return
*/
@ -21,7 +21,7 @@ public interface DmsBaseDeviceSuplierMapper
/**
*
*
*
* @param dmsBaseDeviceSuplier
* @return
*/
@ -29,7 +29,7 @@ public interface DmsBaseDeviceSuplierMapper
/**
*
*
*
* @param dmsBaseDeviceSuplier
* @return
*/
@ -37,7 +37,7 @@ public interface DmsBaseDeviceSuplierMapper
/**
*
*
*
* @param dmsBaseDeviceSuplier
* @return
*/
@ -45,7 +45,7 @@ public interface DmsBaseDeviceSuplierMapper
/**
*
*
*
* @param supplierId
* @return
*/
@ -53,9 +53,11 @@ public interface DmsBaseDeviceSuplierMapper
/**
*
*
*
* @param supplierIds
* @return
*/
public int deleteDmsBaseDeviceSuplierBySupplierIds(Long[] supplierIds);
List<DmsBaseDeviceSuplier> selectDmsBaseDeviceSuplierDeviceId(Long deviceId);
}

@ -5,15 +5,15 @@ import com.hw.dms.domain.DmsBaseInspectRoute;
/**
* 线Mapper
*
*
* @author Open Platform
* @date 2024-01-16
*/
public interface DmsBaseInspectRouteMapper
public interface DmsBaseInspectRouteMapper
{
/**
* 线
*
*
* @param inspectRouteId 线
* @return 线
*/
@ -21,7 +21,7 @@ public interface DmsBaseInspectRouteMapper
/**
* 线
*
*
* @param dmsBaseInspectRoute 线
* @return 线
*/
@ -29,7 +29,7 @@ public interface DmsBaseInspectRouteMapper
/**
* 线
*
*
* @param dmsBaseInspectRoute 线
* @return
*/
@ -37,7 +37,7 @@ public interface DmsBaseInspectRouteMapper
/**
* 线
*
*
* @param dmsBaseInspectRoute 线
* @return
*/
@ -45,7 +45,7 @@ public interface DmsBaseInspectRouteMapper
/**
* 线
*
*
* @param inspectRouteId 线
* @return
*/
@ -53,9 +53,11 @@ public interface DmsBaseInspectRouteMapper
/**
* 线
*
*
* @param inspectRouteIds
* @return
*/
public int deleteDmsBaseInspectRouteByInspectRouteIds(Long[] inspectRouteIds);
Long selectAmountByInspectRouteId(Long InspectRouteId);
}

@ -5,15 +5,15 @@ import com.hw.dms.domain.DmsPlanInspect;
/**
* Mapper
*
*
* @author Open Platform
* @date 2024-01-17
*/
public interface DmsPlanInspectMapper
public interface DmsPlanInspectMapper
{
/**
*
*
*
* @param planInspectId
* @return
*/
@ -21,7 +21,7 @@ public interface DmsPlanInspectMapper
/**
*
*
*
* @param dmsPlanInspect
* @return
*/
@ -29,7 +29,7 @@ public interface DmsPlanInspectMapper
/**
*
*
*
* @param dmsPlanInspect
* @return
*/
@ -37,7 +37,7 @@ public interface DmsPlanInspectMapper
/**
*
*
*
* @param dmsPlanInspect
* @return
*/
@ -45,7 +45,7 @@ public interface DmsPlanInspectMapper
/**
*
*
*
* @param planInspectId
* @return
*/
@ -53,9 +53,12 @@ public interface DmsPlanInspectMapper
/**
*
*
*
* @param planInspectIds
* @return
*/
public int deleteDmsPlanInspectByPlanInspectIds(Long[] planInspectIds);
DmsPlanInspect selectPlanInspectJoinJobByInspectId(Long planInspectId);
}

@ -1,19 +1,21 @@
package com.hw.dms.service;
import java.util.List;
import com.hw.dms.domain.DmsBaseDeviceBom;
import com.hw.dms.domain.DmsBaseDeviceSuplier;
/**
* Service
*
*
* @author xins
* @date 2023-12-28
*/
public interface IDmsBaseDeviceSuplierService
public interface IDmsBaseDeviceSuplierService
{
/**
*
*
*
* @param supplierId
* @return
*/
@ -21,7 +23,7 @@ public interface IDmsBaseDeviceSuplierService
/**
*
*
*
* @param dmsBaseDeviceSuplier
* @return
*/
@ -29,7 +31,7 @@ public interface IDmsBaseDeviceSuplierService
/**
*
*
*
* @param dmsBaseDeviceSuplier
* @return
*/
@ -37,7 +39,7 @@ public interface IDmsBaseDeviceSuplierService
/**
*
*
*
* @param dmsBaseDeviceSuplier
* @return
*/
@ -45,7 +47,7 @@ public interface IDmsBaseDeviceSuplierService
/**
*
*
*
* @param supplierIds
* @return
*/
@ -53,9 +55,12 @@ public interface IDmsBaseDeviceSuplierService
/**
*
*
*
* @param supplierId
* @return
*/
public int deleteDmsBaseDeviceSuplierBySupplierId(Long supplierId);
List<DmsBaseDeviceSuplier> selectDmsBaseDeviceSuplierDeviceId(Long deviceId);
}

@ -1,19 +1,21 @@
package com.hw.dms.service;
import java.util.List;
import java.util.function.LongPredicate;
import com.hw.dms.domain.DmsPlanInspect;
/**
* Service
*
*
* @author Open Platform
* @date 2024-01-17
*/
public interface IDmsPlanInspectService
public interface IDmsPlanInspectService
{
/**
*
*
*
* @param planInspectId
* @return
*/
@ -21,7 +23,7 @@ public interface IDmsPlanInspectService
/**
*
*
*
* @param dmsPlanInspect
* @return
*/
@ -29,7 +31,7 @@ public interface IDmsPlanInspectService
/**
*
*
*
* @param dmsPlanInspect
* @return
*/
@ -37,7 +39,7 @@ public interface IDmsPlanInspectService
/**
*
*
*
* @param dmsPlanInspect
* @return
*/
@ -45,7 +47,7 @@ public interface IDmsPlanInspectService
/**
*
*
*
* @param planInspectIds
* @return
*/
@ -53,9 +55,11 @@ public interface IDmsPlanInspectService
/**
*
*
*
* @param planInspectId
* @return
*/
public int deleteDmsPlanInspectByPlanInspectId(Long planInspectId);
DmsPlanInspect selectPlanInspectJoinJobByInspectId(Long planInspectId);
}

@ -100,4 +100,10 @@ public class DmsBaseDeviceSuplierServiceImpl implements IDmsBaseDeviceSuplierSer
{
return dmsBaseDeviceSuplierMapper.deleteDmsBaseDeviceSuplierBySupplierId(supplierId);
}
@Override
public List<DmsBaseDeviceSuplier> selectDmsBaseDeviceSuplierDeviceId(Long deviceId) {
return dmsBaseDeviceSuplierMapper.selectDmsBaseDeviceSuplierDeviceId(deviceId);
}
}

@ -4,9 +4,14 @@ import java.util.Date;
import java.util.List;
import com.hw.common.core.constant.SecurityConstants;
import com.hw.common.core.domain.R;
import com.hw.common.core.utils.DateUtils;
import com.hw.common.core.utils.uuid.Seq;
import com.hw.common.core.web.domain.AjaxResult;
import com.hw.common.security.utils.SecurityUtils;
import com.hw.dms.domain.DmsBaseInspectRoute;
import com.hw.dms.domain.DmsPlanMaint;
import com.hw.dms.mapper.DmsBaseInspectRouteMapper;
import com.hw.job.api.RemoteJobService;
import com.hw.job.api.domain.SysJob;
import com.hw.job.api.util.CronUtils;
@ -30,6 +35,8 @@ public class DmsPlanInspectServiceImpl implements IDmsPlanInspectService
private DmsPlanInspectMapper dmsPlanInspectMapper;
@Autowired
private RemoteJobService remoteJobService;
@Autowired
private DmsBaseInspectRouteMapper dmsBaseInspectRouteMapper;
/**
*
@ -40,7 +47,17 @@ public class DmsPlanInspectServiceImpl implements IDmsPlanInspectService
@Override
public DmsPlanInspect selectDmsPlanInspectByPlanInspectId(Long planInspectId)
{
return dmsPlanInspectMapper.selectDmsPlanInspectByPlanInspectId(planInspectId);
DmsPlanInspect dmsPlanInspect = dmsPlanInspectMapper.selectPlanInspectJoinJobByInspectId(planInspectId);
Long timeLimit = dmsPlanInspect.getTimeLimit();
if (timeLimit != null) {
Long days = timeLimit / (24 * 60 * 60l);
Long hours = timeLimit % (24 * 60 * 60l);
// System.out.println(days);
// System.out.println(hours);
dmsPlanInspect.setTimeLimitDays(days);
dmsPlanInspect.setTimeLimitHours(hours / (60 * 60l));
}
return dmsPlanInspect;
}
/**
@ -52,7 +69,13 @@ public class DmsPlanInspectServiceImpl implements IDmsPlanInspectService
@Override
public List<DmsPlanInspect> selectDmsPlanInspectList(DmsPlanInspect dmsPlanInspect)
{
return dmsPlanInspectMapper.selectDmsPlanInspectList(dmsPlanInspect);
List<DmsPlanInspect> dmsPlanInspects = dmsPlanInspectMapper.selectDmsPlanInspectList(dmsPlanInspect);
for (DmsPlanInspect d : dmsPlanInspects) {
Long timeLimit = d.getTimeLimit();
d.setTimeLimitDays(timeLimit / (24 * 60 * 60L));
d.setTimeLimitHours((timeLimit % (24 * 60 * 60L)) / (60 * 60l));
}
return dmsPlanInspects;
}
/**
@ -64,29 +87,38 @@ public class DmsPlanInspectServiceImpl implements IDmsPlanInspectService
@Override
public int insertDmsPlanInspect(DmsPlanInspect dmsPlanInspect)
{
String planInspectCode = Seq.getId(Seq.planInspectSeqType, Seq.planInspectCode);
SysJob job = new SysJob();
job.setJobName("点巡检计划编号" + planInspectCode + "工单任务");
job.setJobGroup("DEFAULT");
job.setInvokeTarget("ryTask.getDmsBillsInstance(\"" + planInspectCode + "\")");
job.setCronExpression(dmsPlanInspect.getCronExpression());
job.setMisfirePolicy("1");
job.setConcurrent("1");
job.setStatus("1");
R<Integer> jobIdR = remoteJobService.add(SecurityConstants.INNER, job);
String time = dmsPlanInspect.getCronExpression();
//通过cron表达式获取下一次执行时间
Date nextExecution = CronUtils.getNextExecution(time);
dmsPlanInspect.setPlanTime(nextExecution);
LoginUser user = SecurityUtils.getLoginUser();
dmsPlanInspect.setCreateBy(user.getUsername());
dmsPlanInspect.setPlanInspectCode(planInspectCode);
dmsPlanInspect.setJobId(jobIdR.getData().longValue());
Long timeLimitDays = dmsPlanInspect.getTimeLimitDays()==null?0L:dmsPlanInspect.getTimeLimitDays();
Long timeLimitHours = dmsPlanInspect.getTimeLimitHours() == null?0L:dmsPlanInspect.getTimeLimitHours();
dmsPlanInspect.setTimeLimit((timeLimitDays * 24 * 60 * 60)
+ (timeLimitHours * 60 * 60));
dmsPlanInspect.setIsFlag("1");
dmsPlanInspect.setCreateBy(SecurityUtils.getUsername());
dmsPlanInspect.setCreateTime(DateUtils.getNowDate());
int i = dmsPlanInspectMapper.insertDmsPlanInspect(dmsPlanInspect);
//获取设备总数
Long aLong = dmsBaseInspectRouteMapper.selectAmountByInspectRouteId(dmsPlanInspect.getInspectRouteId());
dmsPlanInspect.setDeviceAmount(aLong);
return dmsPlanInspectMapper.insertDmsPlanInspect(dmsPlanInspect);
List<DmsPlanInspect> dmsPlanInspects = dmsPlanInspectMapper.selectDmsPlanInspectList(dmsPlanInspect);
DmsPlanInspect dmsPlanInspect1 = dmsPlanInspects.get(0);
SysJob job = new SysJob();
job.setJobName("创建计划编号为"+dmsPlanInspect1.getPlanInspectCode()+"工单");
job.setJobGroup("DEFAULT");
job.setInvokeTarget("ryTask.getDmsRepairInstance(\""+dmsPlanInspect1.getPlanInspectId()+"\")");
job.setCronExpression(dmsPlanInspect1.getCronExpression());
job.setMisfirePolicy("1");
job.setConcurrent("1");
job.setStatus("1");
remoteJobService.add(SecurityConstants.INNER,job);
return i;
}
/**
@ -127,4 +159,10 @@ public class DmsPlanInspectServiceImpl implements IDmsPlanInspectService
{
return dmsPlanInspectMapper.deleteDmsPlanInspectByPlanInspectId(planInspectId);
}
@Override
public DmsPlanInspect selectPlanInspectJoinJobByInspectId(Long planInspectId) {
return dmsPlanInspectMapper.selectPlanInspectJoinJobByInspectId(planInspectId);
}
}

@ -1,7 +1,15 @@
package com.hw.dms.service.impl;
import java.util.Date;
import java.util.List;
import com.hw.common.core.constant.SecurityConstants;
import com.hw.common.core.domain.R;
import com.hw.common.core.utils.DateUtils;
import com.hw.common.core.utils.uuid.Seq;
import com.hw.job.api.RemoteJobService;
import com.hw.job.api.domain.SysJob;
import com.hw.job.api.util.CronUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
@ -24,6 +32,9 @@ public class DmsPlanRepairServiceImpl implements IDmsPlanRepairService
@Autowired
private DmsPlanRepairMapper dmsPlanRepairMapper;
@Autowired
private RemoteJobService remoteJobService;
/**
*
*
@ -85,6 +96,23 @@ public class DmsPlanRepairServiceImpl implements IDmsPlanRepairService
public int insertDmsPlanRepair(DmsPlanRepair dmsPlanRepair)
{
// String planRepairCode = Seq.getId(Seq.planRepairSeqType, Seq.planRepairCode);
//
// SysJob job = new SysJob();
// job.setJobName("保养计划编号" + planRepairCode + "工单任务");
// job.setJobGroup("DEFAULT");
// job.setInvokeTarget("ryTask.getDmsRepairInstance(\"" + planRepairCode + "\")");
// job.setCronExpression(dmsPlanRepair.getCronExpression());
// job.setMisfirePolicy("1");
// job.setConcurrent("1");
// job.setStatus("1");
// R<Integer> jobIdR = remoteJobService.add(SecurityConstants.INNER, job);
//
// String time = dmsPlanRepair.getCronExpression();
// Date nextExecution = CronUtils.getNextExecution(time);
// dmsPlanRepair.setRepairTime(nextExecution);
// dmsPlanRepair.setJobId(jobIdR.getData().longValue());
// dmsPlanRepair.setPlanRepairCode(planRepairCode);
dmsPlanRepair.setTimeLimit((dmsPlanRepair.getTimeLimitDays()*24*60*60)
+(dmsPlanRepair.getTimeLimitHours()*60*60));

@ -27,7 +27,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectDmsBaseDeviceSuplierList" parameterType="DmsBaseDeviceSuplier" resultMap="DmsBaseDeviceSuplierResult">
select a.supplier_id, a.suplier_code, a.suplier_name, a.suplier_person, a.suplier_tel, a.suplier_address, a.suplier_status, a.is_flag, a.remark, a.create_by, a.create_time, a.update_by, a.update_time
from dms_base_device_suplier a
left join dms_base_device_ledger b on a.supplier_id = b.supplier_id
<where>
<if test="suplierCode != null and suplierCode != ''"> and suplier_code = #{suplierCode}</if>
<if test="suplierName != null and suplierName != ''"> and suplier_name like concat('%', #{suplierName}, '%')</if>
@ -36,7 +35,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="suplierAddress != null and suplierAddress != ''"> and suplier_address = #{suplierAddress}</if>
<if test="suplierStatus != null "> and suplier_status = #{suplierStatus}</if>
<if test="isFlag != null "> and is_flag = #{isFlag}</if>
<if test="deviceId != null "> and b.device_id = #{deviceId}</if>
</where>
</select>
@ -106,4 +104,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{supplierId}
</foreach>
</delete>
<select id="selectDmsBaseDeviceSuplierDeviceId" parameterType="Long" resultMap="DmsBaseDeviceSuplierResult">
select * from dms_base_device_suplier where supplier_id =
( SELECT supplier_id from dms_base_device_ledger where device_id = #{deviceId} )
</select>
</mapper>

@ -99,4 +99,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{inspectRouteId}
</foreach>
</delete>
<select id="selectAmountByInspectRouteId" parameterType="Long" resultType="Long">
select count(*) from dms_inspect_route_detail where inspect_route_id = #{inspectRouteId}
</select>
</mapper>

@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hw.dms.mapper.DmsPlanInspectMapper">
<resultMap type="DmsPlanInspect" id="DmsPlanInspectResult">
<result property="planInspectId" column="plan_inspect_id" />
<result property="planInspectCode" column="plan_inspect_code" />
@ -12,6 +12,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="inspectRouteId" column="inspect_route_id" />
<result property="deviceAmount" column="device_amount" />
<result property="planTime" column="plan_time" />
<result property="timeLimit" column="time_limit" />
<result property="jobId" column="job_id" />
<result property="cyclePeriod" column="cycle_period" />
<result property="performer" column="performer" />
<result property="isFlag" column="is_flag" />
@ -20,32 +22,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="cronExpression" column="cron_expression" />
</resultMap>
<sql id="selectDmsPlanInspectVo">
select plan_inspect_id, plan_inspect_code, plan_inspect_name, inspect_type, inspect_route_id, device_amount, plan_time, cycle_period, performer, is_flag, remark, create_by, create_time, update_by, update_time from dms_plan_inspect
select plan_inspect_id, plan_inspect_code, plan_inspect_name, inspect_type, inspect_route_id, device_amount, plan_time, cycle_period,time_limit,job_id, performer, is_flag, remark, create_by, create_time, update_by, update_time from dms_plan_inspect
</sql>
<select id="selectDmsPlanInspectList" parameterType="DmsPlanInspect" resultMap="DmsPlanInspectResult">
<include refid="selectDmsPlanInspectVo"/>
<where>
<where>
<if test="planInspectCode != null and planInspectCode != ''"> and plan_inspect_code = #{planInspectCode}</if>
<if test="planInspectName != null and planInspectName != ''"> and plan_inspect_name like concat('%', #{planInspectName}, '%')</if>
<if test="inspectType != null and inspectType != ''"> and inspect_type = #{inspectType}</if>
<if test="inspectRouteId != null "> and inspect_route_id = #{inspectRouteId}</if>
<if test="deviceAmount != null "> and device_amount = #{deviceAmount}</if>
<if test="planTime != null "> and plan_time = #{planTime}</if>
<if test="timeLimit != null "> and time_limit = #{timeLimit}</if>
<if test="jobId != null "> and job_id = #{jobId}</if>
<if test="cyclePeriod != null and cyclePeriod != ''"> and cycle_period = #{cyclePeriod}</if>
<if test="performer != null and performer != ''"> and performer = #{performer}</if>
<if test="isFlag != null and isFlag != ''"> and is_flag = #{isFlag}</if>
</where>
</select>
<select id="selectDmsPlanInspectByPlanInspectId" parameterType="Long" resultMap="DmsPlanInspectResult">
<include refid="selectDmsPlanInspectVo"/>
where plan_inspect_id = #{planInspectId}
</select>
<insert id="insertDmsPlanInspect" parameterType="DmsPlanInspect" useGeneratedKeys="true" keyProperty="planInspectId">
insert into dms_plan_inspect
<trim prefix="(" suffix=")" suffixOverrides=",">
@ -55,6 +61,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="inspectRouteId != null">inspect_route_id,</if>
<if test="deviceAmount != null">device_amount,</if>
<if test="planTime != null">plan_time,</if>
<if test="timeLimit != null">time_limit,</if>
<if test="jobId != null">job_id,</if>
<if test="cyclePeriod != null">cycle_period,</if>
<if test="performer != null">performer,</if>
<if test="isFlag != null and isFlag != ''">is_flag,</if>
@ -71,6 +79,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="inspectRouteId != null">#{inspectRouteId},</if>
<if test="deviceAmount != null">#{deviceAmount},</if>
<if test="planTime != null">#{planTime},</if>
<if test="timeLimit != null">#{timeLimit},</if>
<if test="jobId != null">#{jobId},</if>
<if test="cyclePeriod != null">#{cyclePeriod},</if>
<if test="performer != null">#{performer},</if>
<if test="isFlag != null and isFlag != ''">#{isFlag},</if>
@ -91,6 +101,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="inspectRouteId != null">inspect_route_id = #{inspectRouteId},</if>
<if test="deviceAmount != null">device_amount = #{deviceAmount},</if>
<if test="planTime != null">plan_time = #{planTime},</if>
<if test="timeLimit != null">time_limit = #{timeLimit},</if>
<if test="jobId != null">job_id = #{jobId},</if>
<if test="cyclePeriod != null">cycle_period = #{cyclePeriod},</if>
<if test="performer != null">performer = #{performer},</if>
<if test="isFlag != null and isFlag != ''">is_flag = #{isFlag},</if>
@ -108,9 +120,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete id="deleteDmsPlanInspectByPlanInspectIds" parameterType="String">
delete from dms_plan_inspect where plan_inspect_id in
delete from dms_plan_inspect where plan_inspect_id in
<foreach item="planInspectId" collection="array" open="(" separator="," close=")">
#{planInspectId}
</foreach>
</delete>
</mapper>
<select id="selectPlanInspectJoinJobByInspectId" parameterType="Long" resultMap="DmsPlanInspectResult">
select a.plan_inspect_id, a.plan_inspect_code, a.plan_inspect_name, a.inspect_type,
a.inspect_route_id, a.device_amount, a.plan_time, a.cycle_period,a.time_limit,a.job_id,
a.performer, a.is_flag, a.remark, a.create_by, a.create_time, a.update_by, a.update_time,b.cron_expression from dms_plan_inspect a
left join sys_job b on a.job_id = b.job_id
where a.plan_inspect_id = #{planInspectId}
</select>
</mapper>

@ -6,11 +6,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="DmsRecordInspect" id="DmsRecordInspectResult">
<result property="recordInspectId" column="record_inspect_id" />
<result property="planInspectId" column="plan_inspect_id" />
<result property="billsInspectCode" column="bills_inspect_code" />
<result property="inspectType" column="inspect_type" />
<result property="inspectRouteId" column="inspect_route_id" />
<result property="deviceAmount" column="device_amount" />
<result property="planTime" column="plan_time" />
<result property="planBeginTime" column="plan_begin_time" />
<result property="planEndTime" column="plan_end_time" />
<result property="realBeginTime" column="real_begin_time" />
<result property="realEndTime" column="real_end_time" />
<result property="performer" column="performer" />
@ -25,7 +27,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectDmsRecordInspectVo">
select record_inspect_id, bills_inspect_code, inspect_type, inspect_route_id, device_amount, plan_time, real_begin_time, real_end_time, performer, inspect_status, inspect_duration, is_flag, remark, create_by, create_time, update_by, update_time from dms_record_inspect
select record_inspect_id,plan_inspect_id,bills_inspect_code, inspect_type, inspect_route_id, device_amount,
plan_begin_time,plan_end_time, real_begin_time, real_end_time, performer, inspect_status, inspect_duration,
is_flag, remark, create_by, create_time, update_by, update_time from dms_record_inspect
</sql>
<select id="selectDmsRecordInspectList" parameterType="DmsRecordInspect" resultMap="DmsRecordInspectResult">
@ -35,7 +39,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="inspectType != null and inspectType != ''"> and inspect_type = #{inspectType}</if>
<if test="inspectRouteId != null "> and inspect_route_id = #{inspectRouteId}</if>
<if test="deviceAmount != null "> and device_amount = #{deviceAmount}</if>
<if test="planTime != null "> and plan_time = #{planTime}</if>
<if test="planBeginTime != null "> and #{planBeginTime}>=plan_begin_time</if>
<if test="planEndTime != null "> and planEndTime >= #{plan_end_time}</if>
<if test="realBeginTime != null "> and #{realBeginTime}>=real_begin_time</if>
<if test="realEndTime != null "> and real_end_time >= #{realEndTime}</if>
<if test="performer != null and performer != ''"> and performer = #{performer}</if>
@ -54,10 +59,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
insert into dms_record_inspect
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="billsInspectCode != null">bills_inspect_code,</if>
<if test="planInspectId != null">plan_inspect_id,</if>
<if test="inspectType != null and inspectType != ''">inspect_type,</if>
<if test="inspectRouteId != null">inspect_route_id,</if>
<if test="deviceAmount != null">device_amount,</if>
<if test="planTime != null">plan_time,</if>
<if test="planBeginTime != null">plan_begin_time,</if>
<if test="planEndTime != null">plan_begin_time,</if>
<if test="realBeginTime != null">real_begin_time,</if>
<if test="realEndTime != null">real_end_time,</if>
<if test="performer != null">performer,</if>
@ -72,10 +79,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="billsInspectCode != null">#{billsInspectCode},</if>
<if test="planInspectId != null">#{planInspectId},</if>
<if test="inspectType != null and inspectType != ''">#{inspectType},</if>
<if test="inspectRouteId != null">#{inspectRouteId},</if>
<if test="deviceAmount != null">#{deviceAmount},</if>
<if test="planTime != null">#{planTime},</if>
<if test="planBeginTime != null">#{planBeginTime},</if>
<if test="planEndTime != null">#{planEndTime},</if>
<if test="realBeginTime != null">#{realBeginTime},</if>
<if test="realEndTime != null">#{realEndTime},</if>
<if test="performer != null">#{performer},</if>
@ -94,10 +103,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update dms_record_inspect
<trim prefix="SET" suffixOverrides=",">
<if test="billsInspectCode != null">bills_inspect_code = #{billsInspectCode},</if>
<if test="planInspectCode != null">plan_inspect_id = #{planInspectCode},</if>
<if test="inspectType != null and inspectType != ''">inspect_type = #{inspectType},</if>
<if test="inspectRouteId != null">inspect_route_id = #{inspectRouteId},</if>
<if test="deviceAmount != null">device_amount = #{deviceAmount},</if>
<if test="planTime != null">plan_time = #{planTime},</if>
<if test="planBeginTime != null">plan_begin_time = #{planBeginTime},</if>
<if test="planEndTime != null">plan_end_time = #{planEndTime},</if>
<if test="realBeginTime != null">real_begin_time = #{realBeginTime},</if>
<if test="realEndTime != null">real_end_time = #{realEndTime},</if>
<if test="performer != null">performer = #{performer},</if>

@ -23,6 +23,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.hw.tdengine.api.domain.AlterTagVo;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
/**
@ -84,6 +85,7 @@ public class BaseMonitorInfo1ServiceImpl implements IBaseMonitorInfo1Service {
* @param baseMonitorInfo
* @return
*/
@Transactional(rollbackFor = Exception.class)
@Override
//@DS("#header.poolName")
@ -92,14 +94,21 @@ public class BaseMonitorInfo1ServiceImpl implements IBaseMonitorInfo1Service {
if (baseMonitorInfos.size() != 0) {
throw new ServiceException("计量设备编号重复:" + baseMonitorInfo.getMonitorId());
}
//todo 新增父级为空判断,父级为空时会导致创建子表与创建计量设备与类型的对应对象失效
try {
BaseMonitorInfo monitor = baseMonitorInfoMapper.selectBaseMonitorInfoByObjid(baseMonitorInfo.getParentId());
if (baseMonitorInfo.getParentId()==0){
baseMonitorInfo.setAncestors(baseMonitorInfo.getMonitorId());
}
else {
if (monitor != null) {
monitor.setAncestors(monitor.getAncestors() + "," + monitor.getMonitorId());
String[] split = monitor.getAncestors().split(",");
monitor.setGrade(split.length);
if (monitor != null) {
baseMonitorInfo.setAncestors(monitor.getAncestors() + "," + baseMonitorInfo.getMonitorId());
String[] split = baseMonitorInfo.getAncestors().split(",");
monitor.setGrade(split.length);
}
}
this.insertOrUpdateBaseTypeRelation(baseMonitorInfo.getMonitorId(), baseMonitorInfo.getBuildId(),
baseMonitorInfo.getBusinessId(), baseMonitorInfo.getSubentryId());
@ -109,15 +118,18 @@ public class BaseMonitorInfo1ServiceImpl implements IBaseMonitorInfo1Service {
baseMonitorInfo.setCreateTime(DateUtils.getNowDate());
baseMonitorInfo.setCreateBy(SecurityUtils.getUsername());
//修改父级等级
// baseMonitorInfoMapper.updateBaseMonitorInfo(monitor);
int result = baseMonitorInfoMapper.insertBaseMonitorInfo(baseMonitorInfo);
//创建TDEngine子表
this.createEmsTbale(baseMonitorInfo.getMonitorId(), baseMonitorInfo.getBuildId(), baseMonitorInfo.getMonitorName(), baseMonitorInfo.getObjid());
return result;
} catch (Exception e) {
System.out.println("新增计量设备信息异常1111:" + e.getMessage());
//捕获异常时回滚
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
}
return 0;
@ -235,6 +247,7 @@ public class BaseMonitorInfo1ServiceImpl implements IBaseMonitorInfo1Service {
return result;
} catch (Exception e) {
e.printStackTrace();
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
}
return 0;
}
@ -265,6 +278,7 @@ public class BaseMonitorInfo1ServiceImpl implements IBaseMonitorInfo1Service {
* @author xins
* @date 2023-12-30 16:50
*/
private void updateTdEngineTable(BaseMonitorInfo baseMonitorInfo, BaseMonitorInfo dbBaseMonitorInfo) {
String databaseName = TdEngineConstants.EMS_DATABASE_NAME;
String tableName = TdEngineConstants.getEmsTableName(baseMonitorInfo.getMonitorId());
@ -301,6 +315,7 @@ public class BaseMonitorInfo1ServiceImpl implements IBaseMonitorInfo1Service {
tdReturnMsg = this.remoteTdEngineService.alterTableTags(alterTagVos, SecurityConstants.INNER);
if (tdReturnMsg.getCode() != Constants.SUCCESS) {//抛出异常,回滚事务
throw new RuntimeException(tdReturnMsg.getMsg());
}
}

@ -77,9 +77,9 @@ public class RecordDnbInstantController extends BaseController {
*
*/
@RequiresPermissions("record:dnbInstant:list")
@GetMapping("/list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(RecordDnbInstant recordDnbInstant)
public TableDataInfo list(@RequestBody RecordDnbInstant recordDnbInstant)
{
startPage();
RecordDnbInstantDataVo recordDnbInstantDataVo = recordDnbInstantService.selectRecordDnbInstantList(recordDnbInstant);

@ -28,6 +28,7 @@ import com.hw.ems.report.service.IReportPointDnbService;
import com.hw.tdengine.api.RemoteTdEngineService;
import com.hw.tdengine.api.domain.*;
import com.hw.tdengine.api.domain.ems.TdSuperTableEmsSelectVo;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -84,10 +85,24 @@ public class RecordDnbInstantServiceImpl implements IRecordDnbInstantService {
// @DataScope(deptAlias = "null")
public RecordDnbInstantDataVo selectRecordDnbInstantList(RecordDnbInstant recordDnbInstant) {
RecordDnbInstantDataVo recordDnbInstantDataVo = new RecordDnbInstantDataVo();
// recordDnbInstant.setMonitorId(recordDnbInstant.getMonitorSubset());
try {
Integer pageNum = Integer.valueOf((String) recordDnbInstant.getParams().get("pageNum"));
Integer pageSize = Integer.valueOf((String) recordDnbInstant.getParams().get("pageSize"));
// Integer pageNum = Integer.valueOf((String) recordDnbInstant.getParams().get("pageNum"));
Integer pageNum = null;
Integer pageSize = null;
if (recordDnbInstant.getParams().get("pageNum")!=null){
Object pageNum1 = recordDnbInstant.getParams().get("pageNum");
pageNum = Integer.valueOf(String.valueOf(pageNum1));
// pageNum = (Integer) recordDnbInstant.getParams().get("pageNum");
}
if (recordDnbInstant.getParams().get("pageSize")!=null){
//一步转出会导致导出时出现无法转换的错误
Object pageSize1 = recordDnbInstant.getParams().get("pageSize");
pageSize = Integer.valueOf(String.valueOf(pageSize1));
// pageSize = (Integer) recordDnbInstant.getParams().get("pageSize");
}
// Integer pageSize = Integer.valueOf((String) recordDnbInstant.getParams().get("pageSize"));
Integer offset = (pageNum - 1) * pageSize;
List<RecordDnbInstant> records = new ArrayList<RecordDnbInstant>();
BaseMonitorInfo queryMonitorInfo = new BaseMonitorInfo();
@ -97,11 +112,11 @@ public class RecordDnbInstantServiceImpl implements IRecordDnbInstantService {
String endTime = (String) recordDnbInstant.getParams().get("endTime");
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//todo 因为手动补录采集时间默认为空,且手动补录页面初始化需要展示出所有的历史数据
if (stratTime==null){
if (stratTime==null||stratTime == ""){
//开始事件设置的足够远,确保可以查询到所有数据
stratTime ="2023-01-01 00:00:00";
}
if (endTime==null){
if (endTime==null || endTime == ""){
//结束事件设置为当前时间
endTime = sdf.format(new Date(System.currentTimeMillis()));
}
@ -119,8 +134,9 @@ public class RecordDnbInstantServiceImpl implements IRecordDnbInstantService {
tdSuperTableCommonSelectVo.setOffset(offset);
tdSuperTableCommonSelectVo.setLimit(pageSize);
Object monitorObjidValue = recordDnbInstant.getParams().get("monitorObjid");
if (monitorObjidValue != null) {
// Object monitorObjidValue = recordDnbInstant.getParams().get("monitorObjid");
Object monitorObjidValue = recordDnbInstant.getObjid();
if (monitorObjidValue != null&&monitorObjidValue !="") {
tdSuperTableCommonSelectVo.setMonitorObjid(Long.valueOf(String.valueOf(monitorObjidValue)));
}
@ -129,11 +145,13 @@ public class RecordDnbInstantServiceImpl implements IRecordDnbInstantService {
return recordDnbInstantDataVo;
}
List<Map<String, Object>> dataList = tdReturnDataVo.getDataList();
//用于记录返回条数来正确分页
Integer flag = 0;
for (Map<String, Object> data : dataList) {
RecordDnbInstant recordDnbInstant1 = new RecordDnbInstant();
recordDnbInstant1.setObjid(Long.valueOf(String.valueOf(data.get(TdEngineConstants.ST_TAG_EMS_MONITOROBJID))));
recordDnbInstant1.setMonitorId(String.valueOf(data.get(TdEngineConstants.ST_TAG_EMS_MONITORID)));
recordDnbInstant1.setObjid(Long.valueOf(String.valueOf(data.get(TdEngineConstants.ST_TAG_EMS_MONITOROBJID))));
recordDnbInstant1.setMonitorName(String.valueOf(data.get(TdEngineConstants.ST_TAG_EMS_MONITORNAME)));
if (data.get("volatagea")!=null ){
recordDnbInstant1.setVA(BigDecimal.valueOf(Double.valueOf(String.valueOf(data.get("volatagea")))));
@ -170,12 +188,24 @@ public class RecordDnbInstantServiceImpl implements IRecordDnbInstantService {
String substring = String.valueOf(data.get("ts")).replaceAll("T", " ").substring(0, 19);
recordDnbInstant1.setCollectTime(sdf.parse(substring));
// recordDnbInstant.setConsumption(BigDecimal.valueOf(Double.valueOf(String.valueOf(data.get("consumption")))));
if (data.get("reactivepower")!=null ){
if (data.get("collecttype")!=null ){
recordDnbInstant1.setCollectType(Long.valueOf(String.valueOf(data.get("collecttype"))));
}
records.add(recordDnbInstant1);
//从手动补录进入时,会传入一个参数,如果时从手动补录进入,就过滤自动的数据
//目前定义 状态为1是自动的其他都是手动
if (recordDnbInstant.getCollectType()!=null){
if (data.get("collecttype")!=null && recordDnbInstant.getCollectType()==0)
{
if (recordDnbInstant1.getCollectType()!=1){ records.add(recordDnbInstant1);flag+=1;}
}
}
else{
flag+=1;
records.add(recordDnbInstant1);
}
}
recordDnbInstantDataVo.setCount(tdReturnDataVo.getCount());
recordDnbInstantDataVo.setCount(flag);
recordDnbInstantDataVo.setRecordDnbInstants(records);
return recordDnbInstantDataVo;
} catch (ParseException e) {
@ -438,14 +468,21 @@ public class RecordDnbInstantServiceImpl implements IRecordDnbInstantService {
//获取当前数据以及一小时前的数据
tdHistorySelectDto.setTableName(emsTableName);
List<Map<String, Object>> dnbInstant = remoteTdEngineService.getHistoryData(tdHistorySelectDto, SecurityConstants.INNER).getData().getDataList();
if (dnbInstant.size()==0){
return;
}
R<TdReturnDataVo> historyData = remoteTdEngineService.getHistoryData(tdHistorySelectDto, SecurityConstants.INNER);
ReportPointDnb report = new ReportPointDnb();
report.setMonitorId(baseMonitorInfo.getMonitorId());
report.setMonitorName(baseMonitorInfo.getMonitorName());
report.setpMonitorId(String.valueOf(baseMonitorInfo.getParentId()));
report.setAddress(baseMonitorInfo.getMonitorAddr());
BigDecimal MaxZXYG = BigDecimal.valueOf(Double.valueOf(String.valueOf(dnbInstant.get(dnbInstant.size() - 1).get("zxyg"))));
BigDecimal MinZXYG = BigDecimal.valueOf(Double.valueOf(String.valueOf(dnbInstant.get(0).get("zxyg"))));
BigDecimal MaxZXYG = BigDecimal.valueOf(Double.valueOf(String.valueOf(dnbInstant.get(dnbInstant.size() - 1).get("zxyg"))));
BigDecimal MinZXYG = BigDecimal.valueOf(Double.valueOf(String.valueOf(dnbInstant.get(0).get("zxyg"))));
//pt ct值暂时无用默认为1 需要时从计量设备信息中根据id获取
int pt = 1;
int ct = 1;
@ -477,5 +514,5 @@ public class RecordDnbInstantServiceImpl implements IRecordDnbInstantService {
}
}

@ -58,9 +58,9 @@ public class ReportPointDnbController extends BaseController {
*
*/
@RequiresPermissions("record:dnbInstant:list")
@GetMapping("/lists")
@PostMapping("/lists")
@ResponseBody
public TableDataInfo lists(ReportPointDnb reportPointDnb)
public TableDataInfo lists(@RequestBody ReportPointDnb reportPointDnb)
{
startPage();
List<ReportPointDnb> list = reportPointDnbService.selectReportPointDnbList(reportPointDnb);

@ -304,7 +304,8 @@ public class DataAnalysisServiceImpl implements IDataAnalysisService {
*/
@Override
// //@DS("#header.poolName")
public List<Map<String, String>> lineLossAnalysisData(@RequestBody BaseLineLoss baseLineLoss) {
// public List<Map<String, String>> lineLossAnalysisData(@RequestBody BaseLineLoss baseLineLoss) {
public List<Map<String, String>> lineLossAnalysisData(BaseLineLoss baseLineLoss) {
List<Map<String, String>> result = new ArrayList<>();
//todo

@ -6,11 +6,11 @@
#X-KDApi-ServerUrl=https://apiexp.open.kingdee.com/k3cloud/
#<!-- 当前使用的 账套ID(即数据中心id) -->
X-KDApi-AcctID =657953112be3c4
X-KDApi-AcctID =65e56ceb72f33b
#<!-- 第三方系统登录授权的 应用ID -->
X-KDApi-AppID=265686_SY0M09lvzkp/18wG4/RBRa1GRs2V2pls
X-KDApi-AppID=262997_5Y0vSaDv0MpW7a9JT54CRa9G6gT7SOlt
#<!-- 第三方系统登录授权的 应用密钥 -->
X-KDApi-AppSec =317a6730c9ec4fafa757ca4a3499d059
X-KDApi-AppSec =b75a20c9294c48648d49f69903d6dc86
#<!-- 第三方系统登录授权的 集成用户名称 -->
X-KDApi-UserName =张铭潇
#<!-- 账套语系默认2052 -->

@ -44,7 +44,7 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
String orderString = "";
int topRowCount = 0;
int startRow = 0;
int limit = 2000;
int limit = 100;
queryJson.put("FormId", formId);
queryJson.put("FieldKeys", fieldKeys);
queryJson.put("OrderString", orderString);
@ -77,13 +77,13 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
JSONObject queryJson = new JSONObject();
String formId = "BD_Material";
String fieldKeys = "FMaterialId,FNumber,FName,FBaseUnitId,FSpecification,FNETWEIGHT,FGROSSWEIGHT," +
"FCreateDate,FModifyDate,FApproveDate,FCreateOrgId,FUseOrgId";
"FCreateDate,FModifyDate,FApproveDate,FCreateOrgId,FUseOrgId,FPurchasePriceUnitId";
// String filterString = "FNumber='98010102'";
String filterString = "";
String orderString = "";
int topRowCount = 0;
int startRow = 0;
int limit = 23;
int limit = 99;
queryJson.put("FormId", formId);
queryJson.put("FieldKeys", fieldKeys);
queryJson.put("FilterString", filterString);
@ -179,12 +179,15 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
JSONObject queryJson = new JSONObject();
String formId = "SAL_SaleOrder";
String fieldKeys = "FID,FBillNo,FApproveDate,FSaleOrderEntry_FEntryID,FMaterialId.FNumber,FMaterialName,FQty,FModifyDate,FMinPlanDeliveryDate";
String fieldKeys = "FID,FBillNo,FApproveDate,FSaleOrderEntry_FEntryID,FMaterialId.FNumber,FMaterialName," +
"FQty,FModifyDate,FMinPlanDeliveryDate,FAuxPropId,FStockId,FOwnerId,FSaleDeptId,FPrice,FStockOrgId";
//
String filterString = "FNumber='98010102'";
filterString = "";
String orderString = "";
int topRowCount = 0;
int startRow = 0;
int limit = 2000;
int limit = 10;
queryJson.put("FormId", formId);
queryJson.put("FieldKeys", fieldKeys);
queryJson.put("FilterString", filterString);
@ -246,7 +249,8 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
JSONObject queryJson = new JSONObject();
String formId = "PUR_PurchaseOrder";
String fieldKeys = "FID,FBillNo,FApproveDate,FDocumentStatus,FPOOrderEntry_FEntryID,FMaterialId.FNumber,FMaterialId.FName,FQty,FDeliveryDate";
String fieldKeys = "FID,FBillNo,FApproveDate,FDocumentStatus,FPOOrderEntry_FEntryID,FMaterialId.FNumber,FMaterialId.FName," +
"FQty,FDeliveryDate,FUnitId,FStockUnitID,FPriceUnitID,FAuxPropId,FSrcBillNo,FPurchaseOrgId,F_TOND_Base,FSupplierId";
String filterString = "";
String orderString = "";
int topRowCount = 0;
@ -272,7 +276,7 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
// syncSupplierInfoFromErp();
// syncMaterialInfoFromErp();
// syncSaleOrderFromErp();
// syncPurchaseOrderFromErp();
syncPurchaseOrderFromErp();
// syncProjectInfoFromErp();
}

@ -94,4 +94,14 @@ public interface MesProductPlanMapper
* @return
*/
public List<MesProductPlan> selectMesProductPlanJoinList(MesProductPlan mesProductPlan);
/**
*
*
* @param planCode ()
* @return
*/
public MesProductPlan selectOnlyMesProductPlanByPlanCode(String planCode);
}

@ -397,8 +397,30 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService {
throw new ServiceException("此物料条码已经下发,无需重复下发");
}
//下发工位判断有没有派工和完成情况
String planCode = mesBaseBarcodeInfo.getPlanCode();
MesProductPlan mesProductPlan = mesProductPlanMapper.selectOnlyMesProductPlanByPlanCode(planCode);
Long stationId = mesAssignTaskVo.getStationId();
MesProductPlan queryProductPlan = new MesProductPlan();
queryProductPlan.setProductOrderId(mesProductPlan.getProductOrderId());
queryProductPlan.setStationId(stationId);
List<MesProductPlan> mesProductPlanList = mesProductPlanMapper.selectMesProductPlanList(queryProductPlan);
if (mesProductPlanList == null || mesProductPlanList.isEmpty()) {
throw new ServiceException("此工位没有派工");
}
BigDecimal totalPlanAmount = mesProductPlanList.stream().map(MesProductPlan::getPlanAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
MesMaterialAssignInfo queryMaterialAssignInfo = new MesMaterialAssignInfo();
queryMaterialAssignInfo.setStationId(stationId);
List<MesMaterialAssignInfo> mesMaterialAssignInfoList = mesMaterialAssignInfoMapper.selectMesMaterialAssignInfoList(queryMesMaterialAssignInfo);
BigDecimal assignedAmount = mesMaterialAssignInfoList == null ? BigDecimal.ZERO : BigDecimal.valueOf(mesMaterialAssignInfoList.size());
if (assignedAmount.add(BigDecimal.ONE).compareTo(totalPlanAmount) > 0) {
throw new ServiceException("此工位已经分配数量" + assignedAmount + ",计划数量" + totalPlanAmount + ",不能再分配");
}
Date currentDate = new Date();
MesMaterialAssignInfo mesMaterialAssignInfo = new MesMaterialAssignInfo();
mesMaterialAssignInfo.setMaterialBarcode(materialBarcode);
@ -408,13 +430,13 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService {
mesMaterialAssignInfoMapper.insertMesMaterialAssignInfo(mesMaterialAssignInfo);
Long stationNo = stationId % 10;
Long stationNo = stationId % 10;//第几个工位取个位数
JSONObject assignTaskMessageJson = new JSONObject();
assignTaskMessageJson.put("stationNo", stationNo);
assignTaskMessageJson.put("time", currentDate.getTime());
assignTaskMessageJson.put("materialBarcode", materialBarcode);
//2、订阅者读取此条信息后会给出反馈直接写入redis如果在10s内返回则成功如果10s内失败则失败
//如果在10s内返回则成功如果10s内失败则失败
String returnMsg = SocketUtils.
sendAndReceive(mesConfig.getSocketServerHost(), mesConfig.getSocketServerPort(), mesConfig.getSocketServerReadTimeOut(), assignTaskMessageJson.toString());
if (StringUtils.isEmpty(returnMsg)) {
@ -434,17 +456,18 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService {
/**
*
*
* @param hashMap (installType=1,installType=2)
* @return
*/
@Override
public List<HashMap<String, Object>> selectMaterialInstallationCircumstance(Map hashMap) {
List<HashMap<String, Object>> result = new ArrayList<>();
if (hashMap.containsKey("installType") && hashMap.get("installType").equals("1")){
if (hashMap.containsKey("installType") && hashMap.get("installType").equals("1")) {
result = mesMaterialCheckResultMapper.selectMaterialInstallationCircumstance(hashMap);
}
if (hashMap.containsKey("installType") && hashMap.get("installType").equals("2")
&& hashMap.containsKey("planDetailId") && hashMap.containsKey("materialBomId")){
&& hashMap.containsKey("planDetailId") && hashMap.containsKey("materialBomId")) {
result = mesMaterialCheckResultMapper.selectMaterialUnInstallationCircumstance(hashMap);
}
return result;

@ -332,4 +332,38 @@
</where>
</select>
<select id="selectOnlyMesProductPlanByPlanCode" parameterType="String" resultMap="MesProductPlanMesProductPlanDetailResult">
select a.plan_id,
a.product_order_id,
a.plan_code,
a.dispatch_code,
a.material_id,
a.material_bom_id,
a.process_id,
a.process_order,
a.last_process_id,
a.station_id,
a.user_id,
a.production_time,
a.plan_amount,
a.complete_amount,
a.plan_begin_time,
a.plan_end_time,
a.real_begin_time,
a.real_end_time,
a.attach_id,
a.sop_id,
a.plan_status,
a.is_flag,
a.remark,
a.create_by,
a.create_time,
a.update_by,
a.update_time
from mes_product_plan a
where a.plan_code = #{planCode}
</select>
</mapper>

@ -65,6 +65,8 @@ public class QmsCheckResultDetail extends BaseEntity
private String saleorderCode;
private List<QmsCheckResultDetailProject> checkResultDetailProjectLists;
/** 质检结果详情项目信息信息 */
private List<QmsCheckResultDetailProject> qmsCheckResultDetailProjectList;

@ -55,7 +55,18 @@ public class QmsCheckResultDetailServiceImpl implements IQmsCheckResultDetailSer
*/
@Override
public List<QmsCheckResultDetail> selectQmsCheckResultDetailList(QmsCheckResultDetail qmsCheckResultDetail) {
return qmsCheckResultDetailMapper.selectQmsCheckResultDetailList(qmsCheckResultDetail);
List<QmsCheckResultDetail> qmsCheckResultDetails = qmsCheckResultDetailMapper.selectQmsCheckResultDetailList(qmsCheckResultDetail);
for (QmsCheckResultDetail q:qmsCheckResultDetails){
QmsCheckResultDetailProject qmsCheckResultDetailProject = new QmsCheckResultDetailProject();
qmsCheckResultDetailProject.setCheckResultDetailId(q.getCheckResultDetailId());
List<QmsCheckResultDetailProject> qmsCheckResultDetailProjects = qmsCheckResultDetailProjectMapper.selectQmsCheckResultDetailProjectList(qmsCheckResultDetailProject);
q.setQmsCheckResultDetailProjectList(qmsCheckResultDetailProjects);
}
return qmsCheckResultDetails;
}
/**

@ -48,23 +48,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</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, check_rule_name from qms_check_result
select check_result_id,check_rule_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, check_rule_name from qms_check_result
</sql>
<select id="selectQmsCheckResultList" parameterType="QmsCheckResult" resultMap="QmsCheckResultResult">
<include refid="selectQmsCheckResultVo"/>
<where>
<if test="checkResultId != null and checkResultId != ''"> and check_result_id = #{checkResultId}</if>
<if test="checkRuleName != null and checkRuleName != ''"> and check_rule_name like concat('%',#{checkRuleName},'%') </if>
<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="planCode != null and planCode != ''"> and plan_code like concat('%',#{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="saleorderCode != null and saleorderCode != ''"> and saleorder_code like concat ('%',#{saleorderCode},'%') </if>
<if test="poNo != null and poNo != ''"> and po_no like concat('%',#{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="projectNo != null and projectNo != ''"> and project_no like concat('%',#{projectNo},'%') </if>
<if test="checkStatus != null and checkStatus != ''"> and check_status = #{checkStatus}</if>
</where>
</select>

@ -0,0 +1,109 @@
package com.hw.system.common.controller;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
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.system.common.domain.SysPointRouter;
import com.hw.system.common.service.ISysPointRouterService;
import com.hw.common.core.web.controller.BaseController;
import com.hw.common.core.web.domain.AjaxResult;
import com.hw.common.core.utils.poi.ExcelUtil;
import com.hw.common.core.web.page.TableDataInfo;
/**
* Controller
*
* @author Yinq
* @date 2024-04-22
*/
@RestController
@RequestMapping("/pointRouter")
public class SysPointRouterController extends BaseController {
@Autowired
private ISysPointRouterService sysPointRouterService;
/**
*
*/
@RequiresPermissions("system:pointRouter:list")
@GetMapping("/list")
public TableDataInfo list(SysPointRouter sysPointRouter) {
startPage();
List<SysPointRouter> list = sysPointRouterService.selectSysPointRouterList(sysPointRouter);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("system:pointRouter:export")
@Log(title = "提示路由信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, SysPointRouter sysPointRouter) {
List<SysPointRouter> list = sysPointRouterService.selectSysPointRouterList(sysPointRouter);
ExcelUtil<SysPointRouter> util = new ExcelUtil<SysPointRouter>(SysPointRouter.class);
util.exportExcel(response, list, "提示路由信息数据");
}
/**
*
*/
@RequiresPermissions("system:pointRouter:query")
@GetMapping(value = "/{pointRouterId}")
public AjaxResult getInfo(@PathVariable("pointRouterId") Long pointRouterId) {
return success(sysPointRouterService.selectSysPointRouterByPointRouterId(pointRouterId));
}
/**
*
*/
@RequiresPermissions("system:pointRouter:add")
@Log(title = "提示路由信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SysPointRouter sysPointRouter) {
return toAjax(sysPointRouterService.insertSysPointRouter(sysPointRouter));
}
/**
*
*/
@RequiresPermissions("system:pointRouter:edit")
@Log(title = "提示路由信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SysPointRouter sysPointRouter) {
return toAjax(sysPointRouterService.updateSysPointRouter(sysPointRouter));
}
/**
*
*/
@RequiresPermissions("system:pointRouter:remove")
@Log(title = "提示路由信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{pointRouterIds}")
public AjaxResult remove(@PathVariable Long[] pointRouterIds) {
return toAjax(sysPointRouterService.deleteSysPointRouterByPointRouterIds(pointRouterIds));
}
/**
*
* @param sysPointRouter
* @return
*/
@PostMapping("/insertPointRouterInfo")
public AjaxResult insertPointRouterInfo(@RequestBody SysPointRouter sysPointRouter) {
return toAjax(sysPointRouterService.insertSysPointRouter(sysPointRouter));
}
}

@ -0,0 +1,133 @@
package com.hw.system.common.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
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;
/**
* sys_point_router
*
* @author Yinq
* @date 2024-04-22
*/
public class SysPointRouter extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* ID
*/
private Long pointRouterId;
/**
*
*/
@Excel(name = "功能模块")
private String moduleCode;
/**
* (1=;2=)
*/
@Excel(name = "提示类型(1=报警;2=审核)")
private String pointType;
/**
*
*/
@Excel(name = "路由地址")
private String routerAddress;
/**
*
*/
@Excel(name = "路由地址详情")
private String routerAddressDetail;
/**
* (0=;1=)
*/
@Excel(name = "跳转标识(0=未跳转;1=已跳转)")
private String routerFlag;
/** 提示信息 */
@Excel(name = "提示信息")
private String remark;
@Override
public String getRemark() {
return remark;
}
@Override
public void setRemark(String remark) {
this.remark = remark;
}
public void setPointRouterId(Long pointRouterId) {
this.pointRouterId = pointRouterId;
}
public Long getPointRouterId() {
return pointRouterId;
}
public void setModuleCode(String moduleCode) {
this.moduleCode = moduleCode;
}
public String getModuleCode() {
return moduleCode;
}
public void setPointType(String pointType) {
this.pointType = pointType;
}
public String getPointType() {
return pointType;
}
public void setRouterAddress(String routerAddress) {
this.routerAddress = routerAddress;
}
public String getRouterAddress() {
return routerAddress;
}
public void setRouterAddressDetail(String routerAddressDetail) {
this.routerAddressDetail = routerAddressDetail;
}
public String getRouterAddressDetail() {
return routerAddressDetail;
}
public void setRouterFlag(String routerFlag) {
this.routerFlag = routerFlag;
}
public String getRouterFlag() {
return routerFlag;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("pointRouterId", getPointRouterId())
.append("moduleCode", getModuleCode())
.append("pointType", getPointType())
.append("routerAddress", getRouterAddress())
.append("routerAddressDetail", getRouterAddressDetail())
.append("routerFlag", getRouterFlag())
.append("remark", getRemark())
.append("createBy", getCreateBy())
.append("updateBy", getUpdateBy())
.toString();
}
}

@ -0,0 +1,61 @@
package com.hw.system.common.mapper;
import java.util.List;
import com.hw.system.common.domain.SysPointRouter;
/**
* Mapper
*
* @author Yinq
* @date 2024-04-22
*/
public interface SysPointRouterMapper
{
/**
*
*
* @param pointRouterId
* @return
*/
public SysPointRouter selectSysPointRouterByPointRouterId(Long pointRouterId);
/**
*
*
* @param sysPointRouter
* @return
*/
public List<SysPointRouter> selectSysPointRouterList(SysPointRouter sysPointRouter);
/**
*
*
* @param sysPointRouter
* @return
*/
public int insertSysPointRouter(SysPointRouter sysPointRouter);
/**
*
*
* @param sysPointRouter
* @return
*/
public int updateSysPointRouter(SysPointRouter sysPointRouter);
/**
*
*
* @param pointRouterId
* @return
*/
public int deleteSysPointRouterByPointRouterId(Long pointRouterId);
/**
*
*
* @param pointRouterIds
* @return
*/
public int deleteSysPointRouterByPointRouterIds(Long[] pointRouterIds);
}

@ -0,0 +1,61 @@
package com.hw.system.common.service;
import java.util.List;
import com.hw.system.common.domain.SysPointRouter;
/**
* Service
*
* @author Yinq
* @date 2024-04-22
*/
public interface ISysPointRouterService
{
/**
*
*
* @param pointRouterId
* @return
*/
public SysPointRouter selectSysPointRouterByPointRouterId(Long pointRouterId);
/**
*
*
* @param sysPointRouter
* @return
*/
public List<SysPointRouter> selectSysPointRouterList(SysPointRouter sysPointRouter);
/**
*
*
* @param sysPointRouter
* @return
*/
public int insertSysPointRouter(SysPointRouter sysPointRouter);
/**
*
*
* @param sysPointRouter
* @return
*/
public int updateSysPointRouter(SysPointRouter sysPointRouter);
/**
*
*
* @param pointRouterIds
* @return
*/
public int deleteSysPointRouterByPointRouterIds(Long[] pointRouterIds);
/**
*
*
* @param pointRouterId
* @return
*/
public int deleteSysPointRouterByPointRouterId(Long pointRouterId);
}

@ -0,0 +1,95 @@
package com.hw.system.common.service.impl;
import java.io.IOException;
import java.io.OutputStream;
import java.util.List;
import com.hw.common.core.utils.DateUtils;
import com.hw.common.security.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hw.system.common.mapper.SysPointRouterMapper;
import com.hw.system.common.domain.SysPointRouter;
import com.hw.system.common.service.ISysPointRouterService;
/**
* Service
*
* @author Yinq
* @date 2024-04-22
*/
@Service
public class SysPointRouterServiceImpl implements ISysPointRouterService {
@Autowired
private SysPointRouterMapper sysPointRouterMapper;
/**
*
*
* @param pointRouterId
* @return
*/
@Override
public SysPointRouter selectSysPointRouterByPointRouterId(Long pointRouterId) {
return sysPointRouterMapper.selectSysPointRouterByPointRouterId(pointRouterId);
}
/**
*
*
* @param sysPointRouter
* @return
*/
@Override
public List<SysPointRouter> selectSysPointRouterList(SysPointRouter sysPointRouter) {
return sysPointRouterMapper.selectSysPointRouterList(sysPointRouter);
}
/**
*
*
* @param sysPointRouter
* @return
*/
@Override
public int insertSysPointRouter(SysPointRouter sysPointRouter) {
sysPointRouter.setCreateBy(SecurityUtils.getUsername());
sysPointRouter.setCreateTime(DateUtils.getNowDate());
return sysPointRouterMapper.insertSysPointRouter(sysPointRouter);
}
/**
*
*
* @param sysPointRouter
* @return
*/
@Override
public int updateSysPointRouter(SysPointRouter sysPointRouter) {
sysPointRouter.setUpdateBy(SecurityUtils.getUsername());
sysPointRouter.setUpdateTime(DateUtils.getNowDate());
return sysPointRouterMapper.updateSysPointRouter(sysPointRouter);
}
/**
*
*
* @param pointRouterIds
* @return
*/
@Override
public int deleteSysPointRouterByPointRouterIds(Long[] pointRouterIds) {
return sysPointRouterMapper.deleteSysPointRouterByPointRouterIds(pointRouterIds);
}
/**
*
*
* @param pointRouterId
* @return
*/
@Override
public int deleteSysPointRouterByPointRouterId(Long pointRouterId) {
return sysPointRouterMapper.deleteSysPointRouterByPointRouterId(pointRouterId);
}
}

@ -0,0 +1,118 @@
<?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.system.common.mapper.SysPointRouterMapper">
<resultMap type="SysPointRouter" id="SysPointRouterResult">
<result property="pointRouterId" column="point_router_id"/>
<result property="moduleCode" column="module_code"/>
<result property="pointType" column="point_type"/>
<result property="routerAddress" column="router_address"/>
<result property="routerAddressDetail" column="router_address_detail"/>
<result property="routerFlag" column="router_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"/>
</resultMap>
<sql id="selectSysPointRouterVo">
select point_router_id,
module_code,
point_type,
router_address,
router_address_detail,
router_flag,
remark,
create_by,
create_time,
update_by,
update_time
from sys_point_router
</sql>
<select id="selectSysPointRouterList" parameterType="SysPointRouter" resultMap="SysPointRouterResult">
<include refid="selectSysPointRouterVo"/>
<where>
<if test="moduleCode != null and moduleCode != ''">and module_code = #{moduleCode}</if>
<if test="pointType != null and pointType != ''">and point_type = #{pointType}</if>
<if test="routerAddress != null and routerAddress != ''">and router_address = #{routerAddress}</if>
<if test="routerAddressDetail != null and routerAddressDetail != ''">and router_address_detail =
#{routerAddressDetail}
</if>
<if test="routerFlag != null and routerFlag != ''">and router_flag = #{routerFlag}</if>
<if test="params.begincreateTime != null and params.begincreateTime != '' and params.endcreateTime != null and params.endcreateTime != ''">
and create_time between #{params.begincreateTime} and #{params.endcreateTime}
</if>
<if test="params.beginupdateTime != null and params.beginupdateTime != '' and params.endupdateTime != null and params.endupdateTime != ''">
and update_time between #{params.beginupdateTime} and #{params.endupdateTime}
</if>
</where>
</select>
<select id="selectSysPointRouterByPointRouterId" parameterType="Long" resultMap="SysPointRouterResult">
<include refid="selectSysPointRouterVo"/>
where point_router_id = #{pointRouterId}
</select>
<insert id="insertSysPointRouter" parameterType="SysPointRouter" useGeneratedKeys="true"
keyProperty="pointRouterId">
insert into sys_point_router
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="moduleCode != null and moduleCode != ''">module_code,</if>
<if test="pointType != null and pointType != ''">point_type,</if>
<if test="routerAddress != null and routerAddress != ''">router_address,</if>
<if test="routerAddressDetail != null">router_address_detail,</if>
<if test="routerFlag != null">router_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>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="moduleCode != null and moduleCode != ''">#{moduleCode},</if>
<if test="pointType != null and pointType != ''">#{pointType},</if>
<if test="routerAddress != null and routerAddress != ''">#{routerAddress},</if>
<if test="routerAddressDetail != null">#{routerAddressDetail},</if>
<if test="routerFlag != null">#{routerFlag},</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="updateSysPointRouter" parameterType="SysPointRouter">
update sys_point_router
<trim prefix="SET" suffixOverrides=",">
<if test="moduleCode != null and moduleCode != ''">module_code = #{moduleCode},</if>
<if test="pointType != null and pointType != ''">point_type = #{pointType},</if>
<if test="routerAddress != null and routerAddress != ''">router_address = #{routerAddress},</if>
<if test="routerAddressDetail != null">router_address_detail = #{routerAddressDetail},</if>
<if test="routerFlag != null">router_flag = #{routerFlag},</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 point_router_id = #{pointRouterId}
</update>
<delete id="deleteSysPointRouterByPointRouterId" parameterType="Long">
delete
from sys_point_router
where point_router_id = #{pointRouterId}
</delete>
<delete id="deleteSysPointRouterByPointRouterIds" parameterType="String">
delete from sys_point_router where point_router_id in
<foreach item="pointRouterId" collection="array" open="(" separator="," close=")">
#{pointRouterId}
</foreach>
</delete>
</mapper>

@ -538,4 +538,33 @@ public class TdEngineController {
}
/**
* @return R<?>
* @param: tableDto
* @description
* @author xins
* @date 2023-08-28 16:17
*/
@InnerAuth
@PostMapping("/dropTable")
public R<?> dropTable(@Validated @RequestBody TdTableDropVo tdTableDropVo) {
try {
String databaseName = tdTableDropVo.getDatabaseName();
String tableName = tdTableDropVo.getTableName();
this.tdEngineService.dropTable(databaseName, tableName);
log.info("successfully droped table " + tableName);
return R.ok("successfully droped table " + tableName);
} catch (Exception e) {
String message = e.getCause().getMessage();
try {
message = message.substring(message.lastIndexOf("invalid operation"));
} catch (Exception ex) {
log.error(ex.getMessage());
}
log.error(message);
return R.fail(message);
}
}
}

@ -166,6 +166,14 @@ public interface TdEngineMapper {
int getCountOfSuperTableHistoryData(TdSuperTableEmsSelectVo tdSuperTableEmsSelectVo);
/**
* drop
*
* @param databaseName
* @param tableName
*/
void dropTable(@Param("databaseName") String databaseName,
@Param("tableName") String tableName);
// /**
// * 检查表是否存在

@ -158,6 +158,18 @@ public interface ITdEngineService {
* @param alterTagVos
*/
public void alterTableTags(List<AlterTagVo> alterTagVos);
/**
* @param: databaseName
* @param: tableName
* @description drop
* @author xins
* @date 2024-04-20 11:08
*/
public void dropTable(String databaseName, String tableName) throws Exception;
// void initSTableFrame(String msg) throws Exception;
// List<Map<String, Object>> getRealtimeData(SelectVisualDto selectVisualDto);

@ -282,6 +282,19 @@ public class TdEngineServiceImpl implements ITdEngineService {
}
/**
* @param: databaseName
* @param: tableName
* @description drop
* @author xins
* @date 2024-04-20 11:08
*/
@Override
public void dropTable(String databaseName, String tableName) throws Exception {
this.tdEngineMapper.dropTable(databaseName, tableName);
}
//
// /**
// * 检查数据库表是否存在

@ -361,6 +361,10 @@
</select>
<update id="dropTable">
drop table #{databaseName}.#{tableName}
</update>
<!--
<select id="checkTableExists" resultType="java.lang.Integer">

@ -38,7 +38,7 @@ public class WmsProductStockController extends BaseController
/**
*
*/
@RequiresPermissions("wms:productstock:list")
// @RequiresPermissions("wms:productstock:list")
@GetMapping("/list")
public TableDataInfo list(WmsProductStock wmsProductStock)
{

@ -38,7 +38,7 @@ public class WmsRawStockController extends BaseController
/**
*
*/
@RequiresPermissions("wms:rawstock:list")
// @RequiresPermissions("wms:rawstock:list")
@GetMapping("/list")
public TableDataInfo list(WmsRawStock wmsRawStock)
{

@ -1,7 +1,6 @@
package com.hw.wms.controller;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@ -23,7 +22,7 @@ import com.hw.common.core.utils.poi.ExcelUtil;
import com.hw.common.core.web.page.TableDataInfo;
/**
* Controller
* /Controller
*
* @author xins
* @date 2024-03-14
@ -36,7 +35,7 @@ public class WmsStockTotalController extends BaseController
private IWmsStockTotalService wmsStockTotalService;
/**
*
* /
*/
@RequiresPermissions("wms:stocktotal:list")
@GetMapping("/list")
@ -48,20 +47,20 @@ public class WmsStockTotalController extends BaseController
}
/**
*
* /
*/
@RequiresPermissions("wms:stocktotal:export")
@Log(title = "原材料库存", businessType = BusinessType.EXPORT)
@Log(title = "原材料/成品库存", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WmsStockTotal wmsStockTotal)
{
List<WmsStockTotal> list = wmsStockTotalService.selectWmsStockTotalList(wmsStockTotal);
ExcelUtil<WmsStockTotal> util = new ExcelUtil<WmsStockTotal>(WmsStockTotal.class);
util.exportExcel(response, list, "原材料库存数据");
util.exportExcel(response, list, "原材料/成品库存数据");
}
/**
*
* /
*/
@RequiresPermissions("wms:stocktotal:query")
@GetMapping(value = "/{stockTotalId}")
@ -71,10 +70,10 @@ public class WmsStockTotalController extends BaseController
}
/**
*
* /
*/
@RequiresPermissions("wms:stocktotal:add")
@Log(title = "原材料库存", businessType = BusinessType.INSERT)
@Log(title = "原材料/成品库存", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WmsStockTotal wmsStockTotal)
{
@ -82,10 +81,10 @@ public class WmsStockTotalController extends BaseController
}
/**
*
* /
*/
@RequiresPermissions("wms:stocktotal:edit")
@Log(title = "原材料库存", businessType = BusinessType.UPDATE)
@Log(title = "原材料/成品库存", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WmsStockTotal wmsStockTotal)
{
@ -93,10 +92,10 @@ public class WmsStockTotalController extends BaseController
}
/**
*
* /
*/
@RequiresPermissions("wms:stocktotal:remove")
@Log(title = "原材料库存", businessType = BusinessType.DELETE)
@Log(title = "原材料/成品库存", businessType = BusinessType.DELETE)
@DeleteMapping("/{stockTotalIds}")
public AjaxResult remove(@PathVariable Long[] stockTotalIds)
{

@ -25,6 +25,10 @@ public class WmsProductStock extends BaseEntity
@Excel(name = "仓库ID")
private Long warehouseId;
/** 仓库名称 */
@Excel(name = "仓库名称")
private String warehouseName;
/** 仓库楼层 */
@Excel(name = "仓库楼层")
private Long warehouseFloor;
@ -49,6 +53,14 @@ public class WmsProductStock extends BaseEntity
@Excel(name = "产品ID")
private Long productId;
/** 产品编码 */
@Excel(name = "产品编码")
private String materialCode;
/** 产品名称 */
@Excel(name = "产品名称")
private String materialName;
/**
* ,pd_base_plan_infoplan_id
*/
@ -79,13 +91,13 @@ public class WmsProductStock extends BaseEntity
private BigDecimal occupyAmount;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date createDate;
/** 最后更新时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "最后更新时间", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "最后更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date updateDate;
/** 有效标记 */
@ -96,17 +108,10 @@ public class WmsProductStock extends BaseEntity
@Excel(name = "入库时间", readConverterExp = "预=留")
private Date instockDate;
private String materialCode;
private String materialName;
private BigDecimal orderAmount;
private String warehouseName;
private BigDecimal applyAmount;
public void setProductStockId(Long productStockId)
{
this.productStockId = productStockId;

@ -25,6 +25,10 @@ public class WmsRawStock extends BaseEntity
@Excel(name = "仓库ID")
private Long warehouseId;
/** 仓库名称 */
@Excel(name = "仓库名称")
private String warehouseName;
/** 仓库楼层 */
@Excel(name = "仓库楼层")
private Long warehouseFloor;
@ -34,13 +38,21 @@ public class WmsRawStock extends BaseEntity
private String locationCode;
/** 库存类型1原材料 2半成品 */
@Excel(name = "库存类型1原材料 2半成品")
@Excel(name = "库存类型")
private String stockType;
/** 物料ID */
@Excel(name = "物料ID")
private Long materialId;
/** 物料编号 */
@Excel(name = "物料编号")
private String materialCode;
/** 物料名称 */
@Excel(name = "物料名称")
private String materialName;
/** 入库批次号 */
@Excel(name = "入库批次号")
private String instockBatch;
@ -49,21 +61,21 @@ public class WmsRawStock extends BaseEntity
private String palletInfoCode;
/** 入库时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "入库时间", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "入库时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date instockDate;
/** 最晚出库时间;入库时,根据物料信“存放周期“计算出来的时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "最晚出库时间;入库时,根据物料信“存放周期“计算出来的时间", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "最晚出库时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date lastOutstockTime;
/** 质检状态(1检验中,2质检通过,3质检不通过) */
@Excel(name = "质检状态(1检验中,2质检通过,3质检不通过)")
@Excel(name = "质检状态")
private String qualityStatus;
/** 质检状态(1检验中,2质检通过,3质检不通过) */
@Excel(name = "完整标识(1是0否)拆分后为0")
/** 完整标识 */
@Excel(name = "完整标识")
private String completeFlag;
/** 总数量 */
@ -83,19 +95,43 @@ public class WmsRawStock extends BaseEntity
private Long supplierId;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date createDate;
/** 最后更新时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "最后更新时间", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "最后更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date updateDate;
/** 有效标记 */
@Excel(name = "有效标记")
private String activeFlag;
public String getWarehouseName() {
return warehouseName;
}
public void setWarehouseName(String warehouseName) {
this.warehouseName = warehouseName;
}
public String getMaterialCode() {
return materialCode;
}
public void setMaterialCode(String materialCode) {
this.materialCode = materialCode;
}
public String getMaterialName() {
return materialName;
}
public void setMaterialName(String materialName) {
this.materialName = materialName;
}
public void setRawStockId(Long rawStockId)
{
this.rawStockId = rawStockId;

@ -25,6 +25,10 @@ public class WmsStockTotal extends BaseEntity
@Excel(name = "仓库ID")
private Long warehouseId;
/** 仓库名称 */
@Excel(name = "仓库名称")
private String warehouseName;
/** 仓库楼层 */
@Excel(name = "仓库楼层")
private Long warehouseFloor;
@ -37,6 +41,14 @@ public class WmsStockTotal extends BaseEntity
@Excel(name = "物料ID")
private Long materialId;
/** 物料编号 */
@Excel(name = "物料编号")
private String materialCode;
/** 物料名称 */
@Excel(name = "物料名称")
private String materialName;
/** 总数量;仓库存放的总数量 */
@Excel(name = "总数量;仓库存放的总数量")
private BigDecimal totalAmount;
@ -50,22 +62,27 @@ public class WmsStockTotal extends BaseEntity
private BigDecimal occupyAmount;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date createDate;
/** 最后更新时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "最后更新时间", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "最后更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date updateDate;
/** 有效标记 */
@Excel(name = "有效标记")
private String activeFlag;
private String materialCode;
private String materialName;
public String getWarehouseName() {
return warehouseName;
}
public void setWarehouseName(String warehouseName) {
this.warehouseName = warehouseName;
}
public void setStockTotalId(Long stockTotalId)
{

@ -1,70 +1,99 @@
<?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">
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hw.wms.mapper.WmsProductStockMapper">
<resultMap type="WmsProductStock" id="WmsProductStockResult">
<result property="productStockId" column="product_stock_id" />
<result property="warehouseId" column="warehouse_id" />
<result property="warehouseFloor" column="warehouse_floor" />
<result property="locationCode" column="location_code" />
<result property="stockType" column="stock_type" />
<result property="productBatch" column="product_batch" />
<result property="qualityStatus" column="quality_status" />
<result property="productId" column="product_id" />
<result property="planCode" column="plan_code" />
<result property="planDetailCode" column="plan_detail_code" />
<result property="saleOrderId" column="sale_order_id" />
<result property="saleorderCode" column="saleorder_code" />
<result property="totalAmount" column="total_amount" />
<result property="frozenAmount" column="frozen_amount" />
<result property="occupyAmount" column="occupy_amount" />
<result property="createBy" column="create_by" />
<result property="createDate" column="create_date" />
<result property="updateBy" column="update_by" />
<result property="updateDate" column="update_date" />
<result property="activeFlag" column="active_flag" />
<result property="instockDate" column="instock_date" />
<result property="materialCode" column="material_code" />
<result property="materialName" column="material_name" />
<result property="orderAmount" column="order_amount" />
<result property="warehouseName" column="warehouse_name" />
<result property="applyAmount" column="apply_amount" />
<result property="productStockId" column="product_stock_id"/>
<result property="warehouseId" column="warehouse_id"/>
<result property="warehouseFloor" column="warehouse_floor"/>
<result property="locationCode" column="location_code"/>
<result property="stockType" column="stock_type"/>
<result property="productBatch" column="product_batch"/>
<result property="qualityStatus" column="quality_status"/>
<result property="productId" column="product_id"/>
<result property="planCode" column="plan_code"/>
<result property="planDetailCode" column="plan_detail_code"/>
<result property="saleOrderId" column="sale_order_id"/>
<result property="saleorderCode" column="saleorder_code"/>
<result property="totalAmount" column="total_amount"/>
<result property="frozenAmount" column="frozen_amount"/>
<result property="occupyAmount" column="occupy_amount"/>
<result property="createBy" column="create_by"/>
<result property="createDate" column="create_date"/>
<result property="updateBy" column="update_by"/>
<result property="updateDate" column="update_date"/>
<result property="activeFlag" column="active_flag"/>
<result property="instockDate" column="instock_date"/>
<result property="materialCode" column="material_code"/>
<result property="materialName" column="material_name"/>
<result property="orderAmount" column="order_amount"/>
<result property="warehouseName" column="warehouse_name"/>
<result property="applyAmount" column="apply_amount"/>
</resultMap>
<sql id="selectWmsProductStockVo">
select product_stock_id, warehouse_id, location_code, stock_type, product_batch, quality_status, product_id, plan_code, plan_detail_code,sale_order_id,saleorder_code, total_amount, frozen_amount, occupy_amount, create_by, create_date, update_by, update_date, active_flag, instock_date from wms_product_stock
select wps.product_stock_id,
wps.warehouse_id,
wbw.warehouse_name,
wbw.warehouse_floor,
wps.location_code,
wps.stock_type,
wps.product_batch,
wps.quality_status,
wps.product_id,
mbmi.material_code,
mbmi.material_name,
wps.plan_code,
wps.plan_detail_code,
wps.sale_order_id,
wps.saleorder_code,
wps.total_amount,
wps.frozen_amount,
wps.occupy_amount,
wps.create_by,
wps.create_date,
wps.update_by,
wps.update_date,
wps.active_flag,
wps.instock_date
from wms_product_stock wps
left join wms_base_warehouse wbw on wbw.warehouse_id = wps.warehouse_id
left join mes_base_material_info mbmi on mbmi.material_id = wps.product_id
</sql>
<select id="selectWmsProductStockList" parameterType="WmsProductStock" resultMap="WmsProductStockResult">
<include refid="selectWmsProductStockVo"/>
<where>
<if test="warehouseId != null "> and warehouse_id = #{warehouseId}</if>
<if test="locationCode != null and locationCode != ''"> and location_code = #{locationCode}</if>
<if test="stockType != null and stockType != ''"> and stock_type = #{stockType}</if>
<if test="productBatch != null and productBatch != ''"> and product_batch = #{productBatch}</if>
<if test="qualityStatus != null and qualityStatus != ''"> and quality_status = #{qualityStatus}</if>
<if test="productId != null "> and product_id = #{productId}</if>
<if test="planCode != null "> and plan_code = #{planCode}</if>
<if test="planDetailCode != null "> and plan_detail_code = #{planDetailCode}</if>
<if test="saleorderCode != null "> and saleorder_code = #{saleorderCode}</if>
<if test="totalAmount != null "> and total_amount = #{totalAmount}</if>
<if test="frozenAmount != null "> and frozen_amount = #{frozenAmount}</if>
<if test="occupyAmount != null "> and occupy_amount = #{occupyAmount}</if>
<if test="createDate != null "> and create_date = #{createDate}</if>
<if test="updateDate != null "> and update_date = #{updateDate}</if>
<if test="activeFlag != null and activeFlag != ''"> and active_flag = #{activeFlag}</if>
<if test="instockDate != null "> and instock_date = #{instockDate}</if>
<if test="warehouseId != null ">and wps.warehouse_id = #{warehouseId}</if>
<if test="locationCode != null and locationCode != ''">and wps.location_code = #{locationCode}</if>
<if test="stockType != null and stockType != ''">and wps.stock_type = #{stockType}</if>
<if test="productBatch != null and productBatch != ''">and wps.product_batch = #{productBatch}</if>
<if test="qualityStatus != null and qualityStatus != ''">and wps.quality_status = #{qualityStatus}</if>
<if test="productId != null ">and wps.product_id = #{productId}</if>
<if test="planCode != null ">and wps.plan_code = #{planCode}</if>
<if test="planDetailCode != null ">and wps.plan_detail_code = #{planDetailCode}</if>
<if test="saleorderCode != null ">and wps.saleorder_code = #{saleorderCode}</if>
<if test="totalAmount != null ">and wps.total_amount = #{totalAmount}</if>
<if test="frozenAmount != null ">and wps.frozen_amount = #{frozenAmount}</if>
<if test="occupyAmount != null ">and wps.occupy_amount = #{occupyAmount}</if>
<if test="updateDate != null ">and wps.update_date = #{updateDate}</if>
<if test="activeFlag != null and activeFlag != ''">and wps.active_flag = #{activeFlag}</if>
<if test="instockDate != null ">and wps.instock_date = #{instockDate}</if>
<if test="params.beginCreateDate != null and params.beginCreateDate != '' and params.endCreateDate != null and params.endCreateDate != ''">
and wps.create_date between #{params.beginCreateDate} and #{params.endCreateDate}
</if>
</where>
</select>
<select id="selectWmsProductStockByProductStockId" parameterType="Long" resultMap="WmsProductStockResult">
<include refid="selectWmsProductStockVo"/>
where product_stock_id = #{productStockId}
where wps.product_stock_id = #{productStockId}
</select>
<insert id="insertWmsProductStock" parameterType="WmsProductStock" useGeneratedKeys="true" keyProperty="productStockId">
<insert id="insertWmsProductStock" parameterType="WmsProductStock" useGeneratedKeys="true"
keyProperty="productStockId">
insert into wms_product_stock
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="warehouseId != null">warehouse_id,</if>
@ -86,7 +115,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateDate != null">update_date,</if>
<if test="activeFlag != null">active_flag,</if>
<if test="instockDate != null">instock_date,</if>
</trim>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="warehouseId != null">#{warehouseId},</if>
<if test="warehouseFloor != null">#{warehouseFloor},</if>
@ -107,7 +136,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateDate != null">#{updateDate},</if>
<if test="activeFlag != null">#{activeFlag},</if>
<if test="instockDate != null">#{instockDate},</if>
</trim>
</trim>
</insert>
<update id="updateWmsProductStock" parameterType="WmsProductStock">
@ -136,7 +165,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update>
<delete id="deleteWmsProductStockByProductStockId" parameterType="Long">
delete from wms_product_stock where product_stock_id = #{productStockId}
delete
from wms_product_stock
where product_stock_id = #{productStockId}
</delete>
<delete id="deleteWmsProductStockByProductStockIds" parameterType="String">
@ -147,17 +178,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<select id="getProductStockTotalAmount" resultType="BigDecimal" parameterType="WmsProductStock">
select sum(total_amount) from wms_product_stock
<where>
<if test="locationCode != null and locationCode != ''"> and location_code = #{locationCode}</if>
<if test="locationCode != null and locationCode != ''">and location_code = #{locationCode}</if>
and total_amount > 0
</where>
</select>
@ -169,12 +193,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectProductStockByLocationAndBatchAndSaleOrderId" resultMap="WmsProductStockResult">
<include refid="selectWmsProductStockVo"/>
where location_code = #{locationCode} and product_batch = #{productBatch} and sale_order_id=#{saleOrderId} and stock_type = #{stockType}
where location_code = #{locationCode} and product_batch = #{productBatch} and sale_order_id=#{saleOrderId} and
stock_type = #{stockType}
</select>
<select id="selectWmsProductStockInList" parameterType="WmsProductStock" resultMap="WmsProductStockResult">
<include refid="selectWmsProductStockVo"/>
<where>
@ -197,45 +220,49 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectWmsProductStockJoinList" parameterType="WmsProductStock" resultMap="WmsProductStockResult">
select wps.product_stock_id, wps.warehouse_id, wps.location_code, wps.stock_type, wps.product_batch, wps.quality_status, wps.product_id,
wps.plan_code, wps.plan_detail_code, wps.total_amount, wps.frozen_amount, wps.occupy_amount, wps.active_flag, wps.instock_date,
select wps.product_stock_id, wps.warehouse_id, wps.location_code, wps.stock_type, wps.product_batch,
wps.quality_status, wps.product_id,
wps.plan_code, wps.plan_detail_code, wps.total_amount, wps.frozen_amount, wps.occupy_amount, wps.active_flag,
wps.instock_date,
mai.material_code,mai.material_name
from wms_product_stock wps left join mes_base_material_info mai on wps.product_id = mai.material_id
<where>
<if test="warehouseId != null "> and warehouse_id = #{warehouseId}</if>
<if test="locationCode != null and locationCode != ''"> and location_code = #{locationCode}</if>
<if test="stockType != null and stockType != ''"> and stock_type = #{stockType}</if>
<if test="productBatch != null and productBatch != ''"> and product_batch = #{productBatch}</if>
<if test="qualityStatus != null and qualityStatus != ''"> and quality_status = #{qualityStatus}</if>
<if test="productId != null "> and product_id = #{productId}</if>
<if test="planCode != null "> and plan_code = #{planCode}</if>
<if test="planDetailCode != null "> and plan_detail_code = #{planDetailCode}</if>
<if test="totalAmount != null "> and total_amount = #{totalAmount}</if>
<if test="frozenAmount != null "> and frozen_amount = #{frozenAmount}</if>
<if test="occupyAmount != null "> and occupy_amount = #{occupyAmount}</if>
<if test="createDate != null "> and create_date = #{createDate}</if>
<if test="updateDate != null "> and update_date = #{updateDate}</if>
<if test="activeFlag != null and activeFlag != ''"> and active_flag = #{activeFlag}</if>
<if test="instockDate != null "> and instock_date = #{instockDate}</if>
<if test="warehouseId != null ">and warehouse_id = #{warehouseId}</if>
<if test="locationCode != null and locationCode != ''">and location_code = #{locationCode}</if>
<if test="stockType != null and stockType != ''">and stock_type = #{stockType}</if>
<if test="productBatch != null and productBatch != ''">and product_batch = #{productBatch}</if>
<if test="qualityStatus != null and qualityStatus != ''">and quality_status = #{qualityStatus}</if>
<if test="productId != null ">and product_id = #{productId}</if>
<if test="planCode != null ">and plan_code = #{planCode}</if>
<if test="planDetailCode != null ">and plan_detail_code = #{planDetailCode}</if>
<if test="totalAmount != null ">and total_amount = #{totalAmount}</if>
<if test="frozenAmount != null ">and frozen_amount = #{frozenAmount}</if>
<if test="occupyAmount != null ">and occupy_amount = #{occupyAmount}</if>
<if test="createDate != null ">and create_date = #{createDate}</if>
<if test="updateDate != null ">and update_date = #{updateDate}</if>
<if test="activeFlag != null and activeFlag != ''">and active_flag = #{activeFlag}</if>
<if test="instockDate != null ">and instock_date = #{instockDate}</if>
and totalAmount>0
</where>
</select>
<select id="selectWmsProductStocksBySaleorder" parameterType="WmsProductStock" resultMap="WmsProductStockResult">
select wps.warehouse_id,wps.sale_order_id,wps.product_id,sum(total_amount) total_amount,sum(frozen_amount) frozen_amount,sum(occupy_amount) occupy_amount,
select wps.warehouse_id,wps.sale_order_id,wps.product_id,sum(total_amount) total_amount,sum(frozen_amount)
frozen_amount,sum(occupy_amount) occupy_amount,
mbmi.material_code,mbmi.material_name,
wbw.warehouse_name,mso.order_amount,mso.saleorder_code,
(select sum(wpo.apply_qty) from wms_product_outstock wpo where wpo.sale_order_id=wps.sale_order_id and wpo.warehouse_id=wps.warehouse_id and wpo.product_id=wps.product_id and (wpo.execute_status='0' or wpo.execute_status='1')) apply_amount
(select sum(wpo.apply_qty) from wms_product_outstock wpo where wpo.sale_order_id=wps.sale_order_id and
wpo.warehouse_id=wps.warehouse_id and wpo.product_id=wps.product_id and (wpo.execute_status='0' or
wpo.execute_status='1')) apply_amount
from wms_product_stock wps
left join mes_base_material_info mbmi on wps.product_id=mbmi.material_id
left join wms_base_warehouse wbw on wps.warehouse_id=wbw.warehouse_id
left join wms_base_warehouse wbw on wps.warehouse_id=wbw.warehouse_id
left join mes_sale_order mso on wps.sale_order_id=mso.sale_order_id
<where>
wps.total_amount>0 and wps.stock_type='3'
<if test="saleorderCode != null and saleorderCode != ''"> and mso.saleorder_code = #{saleorderCode}</if>
<if test="saleorderCode != null and saleorderCode != ''">and mso.saleorder_code = #{saleorderCode}</if>
<if test="warehouseId != null ">and wps.warehouse_id = #{warehouseId}</if>
<if test="productId != null ">and wps.product_id = #{productId}</if>
</where>
@ -243,7 +270,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<!--select id="selectWmsProductStocksBySaleorder" parameterType="WmsProductStock" resultMap="WmsProductStockResult">
select wgb.warehouse_id,wgb.saleorder_code,wgb.product_id,mso.order_amount,wgb.total_amount,wgb.frozen_amount,wgb.occupy_amount,wbw.warehouse_name,mbmi.material_code,mbmi.material_name from mes_sale_order mso left join
(select wps.warehouse_id,wps.saleorder_code,wps.product_id,sum(total_amount) total_amount,sum(frozen_amount) frozen_amount,sum(occupy_amount) occupy_amount from wms_product_stock wps where wps.total_amount>0 and wps.stock_type='3'

@ -1,61 +1,92 @@
<?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">
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hw.wms.mapper.WmsRawStockMapper">
<resultMap type="WmsRawStock" id="WmsRawStockResult">
<result property="rawStockId" column="raw_stock_id" />
<result property="warehouseId" column="warehouse_id" />
<result property="warehouseFloor" column="warehouse_floor" />
<result property="locationCode" column="location_code" />
<result property="stockType" column="stock_type" />
<result property="materialId" column="material_id" />
<result property="instockBatch" column="instock_batch" />
<result property="palletInfoCode" column="pallet_info_code" />
<result property="instockDate" column="instock_date" />
<result property="lastOutstockTime" column="last_outstock_time" />
<result property="qualityStatus" column="quality_status" />
<result property="completeFlag" column="complete_flag" />
<result property="totalAmount" column="total_amount" />
<result property="frozenAmount" column="frozen_amount" />
<result property="occupyAmount" column="occupy_amount" />
<result property="supplierId" column="supplier_id" />
<result property="createBy" column="create_by" />
<result property="createDate" column="create_date" />
<result property="updateBy" column="update_by" />
<result property="updateDate" column="update_date" />
<result property="activeFlag" column="active_flag" />
<result property="rawStockId" column="raw_stock_id"/>
<result property="warehouseId" column="warehouse_id"/>
<result property="warehouseFloor" column="warehouse_floor"/>
<result property="locationCode" column="location_code"/>
<result property="stockType" column="stock_type"/>
<result property="materialId" column="material_id"/>
<result property="instockBatch" column="instock_batch"/>
<result property="palletInfoCode" column="pallet_info_code"/>
<result property="instockDate" column="instock_date"/>
<result property="lastOutstockTime" column="last_outstock_time"/>
<result property="qualityStatus" column="quality_status"/>
<result property="completeFlag" column="complete_flag"/>
<result property="totalAmount" column="total_amount"/>
<result property="frozenAmount" column="frozen_amount"/>
<result property="occupyAmount" column="occupy_amount"/>
<result property="supplierId" column="supplier_id"/>
<result property="createBy" column="create_by"/>
<result property="createDate" column="create_date"/>
<result property="updateBy" column="update_by"/>
<result property="updateDate" column="update_date"/>
<result property="activeFlag" column="active_flag"/>
<result property="materialCode" column="material_code"/>
<result property="materialName" column="material_name"/>
<result property="warehouseName" column="warehouse_name"/>
</resultMap>
<sql id="selectWmsRawStockVo">
select raw_stock_id, warehouse_id, location_code, stock_type, material_id, instock_batch,pallet_info_code, instock_date, last_outstock_time, quality_status, complete_flag,total_amount, frozen_amount, occupy_amount, supplier_id, create_by, create_date, update_by, update_date, active_flag from wms_raw_stock
select wrs.raw_stock_id,
wrs.warehouse_id,
wbw.warehouse_name,
wbw.warehouse_floor,
wrs.location_code,
wrs.stock_type,
wrs.material_id,
mbmi.material_code,
mbmi.material_name,
wrs.instock_batch,
wrs.pallet_info_code,
wrs.instock_date,
wrs.last_outstock_time,
wrs.quality_status,
wrs.complete_flag,
wrs.total_amount,
wrs.frozen_amount,
wrs.occupy_amount,
wrs.supplier_id,
wrs.create_by,
wrs.create_date,
wrs.update_by,
wrs.update_date,
wrs.active_flag
from wms_raw_stock wrs
left join wms_base_warehouse wbw on wbw.warehouse_id = wrs.warehouse_id
left join mes_base_material_info mbmi on mbmi.material_id = wrs.material_id
</sql>
<select id="selectWmsRawStockList" parameterType="WmsRawStock" resultMap="WmsRawStockResult">
<include refid="selectWmsRawStockVo"/>
<where>
<if test="warehouseId != null "> and warehouse_id = #{warehouseId}</if>
<if test="locationCode != null and locationCode != ''"> and location_code = #{locationCode}</if>
<if test="stockType != null and stockType != ''"> and stock_type = #{stockType}</if>
<if test="materialId != null "> and material_id = #{materialId}</if>
<if test="instockBatch != null and instockBatch != ''"> and instock_batch = #{instockBatch}</if>
<if test="instockDate != null "> and instock_date = #{instockDate}</if>
<if test="lastOutstockTime != null "> and last_outstock_time = #{lastOutstockTime}</if>
<if test="qualityStatus != null and qualityStatus != ''"> and quality_status = #{qualityStatus}</if>
<if test="totalAmount != null "> and total_amount = #{totalAmount}</if>
<if test="frozenAmount != null "> and frozen_amount = #{frozenAmount}</if>
<if test="occupyAmount != null "> and occupy_amount = #{occupyAmount}</if>
<if test="supplierId != null "> and supplier_id = #{supplierId}</if>
<if test="createDate != null "> and create_date = #{createDate}</if>
<if test="updateDate != null "> and update_date = #{updateDate}</if>
<if test="activeFlag != null and activeFlag != ''"> and active_flag = #{activeFlag}</if>
<if test="warehouseId != null ">and wrs.warehouse_id = #{warehouseId}</if>
<if test="locationCode != null and locationCode != ''">and wrs.location_code = #{locationCode}</if>
<if test="stockType != null and stockType != ''">and wrs.stock_type = #{stockType}</if>
<if test="materialId != null ">and wrs.material_id = #{materialId}</if>
<if test="instockBatch != null and instockBatch != ''">and wrs.instock_batch = #{instockBatch}</if>
<if test="instockDate != null ">and wrs.instock_date = #{instockDate}</if>
<if test="lastOutstockTime != null ">and wrs.last_outstock_time = #{lastOutstockTime}</if>
<if test="qualityStatus != null and qualityStatus != ''">and wrs.quality_status = #{qualityStatus}</if>
<if test="totalAmount != null ">and wrs.total_amount = #{totalAmount}</if>
<if test="frozenAmount != null ">and wrs.frozen_amount = #{frozenAmount}</if>
<if test="occupyAmount != null ">and wrs.occupy_amount = #{occupyAmount}</if>
<if test="supplierId != null ">and wrs.supplier_id = #{supplierId}</if>
<if test="updateDate != null ">and wrs.update_date = #{updateDate}</if>
<if test="activeFlag != null and activeFlag != ''">and wrs.active_flag = #{activeFlag}</if>
<if test="params.beginCreateDate != null and params.beginCreateDate != '' and params.endCreateDate != null and params.endCreateDate != ''">
and wrs.create_date between #{params.beginCreateDate} and #{params.endCreateDate}
</if>
</where>
</select>
<select id="selectWmsRawStockByRawStockId" parameterType="Long" resultMap="WmsRawStockResult">
<include refid="selectWmsRawStockVo"/>
where raw_stock_id = #{rawStockId}
where wrs.raw_stock_id = #{rawStockId}
</select>
<insert id="insertWmsRawStock" parameterType="WmsRawStock" useGeneratedKeys="true" keyProperty="rawStockId">
@ -80,7 +111,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">update_by,</if>
<if test="updateDate != null">update_date,</if>
<if test="activeFlag != null">active_flag,</if>
</trim>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="warehouseId != null">#{warehouseId},</if>
<if test="warehouseFloor != null">#{warehouseFloor},</if>
@ -101,7 +132,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">#{updateBy},</if>
<if test="updateDate != null">#{updateDate},</if>
<if test="activeFlag != null">#{activeFlag},</if>
</trim>
</trim>
</insert>
<update id="updateWmsRawStock" parameterType="WmsRawStock">
@ -130,7 +161,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update>
<delete id="deleteWmsRawStockByRawStockId" parameterType="Long">
delete from wms_raw_stock where raw_stock_id = #{rawStockId}
delete
from wms_raw_stock
where raw_stock_id = #{rawStockId}
</delete>
<delete id="deleteWmsRawStockByRawStockIds" parameterType="String">
@ -141,8 +174,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<select id="selectRawStockByLocationAndBatch" resultMap="WmsRawStockResult">
<include refid="selectWmsRawStockVo"/>
where location_code = #{locationCode} and instock_batch = #{instockBatch}
@ -151,53 +182,46 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getRawStockTotalAmount" resultType="BigDecimal" parameterType="WmsRawStock">
select sum(total_amount) from wms_raw_stock
<where>
<if test="locationCode != null and locationCode != ''"> and location_code = #{locationCode}</if>
<if test="locationCode != null and locationCode != ''">and location_code = #{locationCode}</if>
and total_amount > 0
</where>
</select>
<select id="selectWmsRawStocks4Apply" parameterType="WmsRawStock" resultMap="WmsRawStockResult">
<include refid="selectWmsRawStockVo"/>
<where>
<if test="warehouseId != null "> and warehouse_id = #{warehouseId}</if>
<if test="materialId != null "> and material_id = #{materialId}</if>
<if test="qualityStatus != null and qualityStatus != ''"> and quality_status = #{qualityStatus}</if>
<if test="warehouseId != null ">and warehouse_id = #{warehouseId}</if>
<if test="materialId != null ">and material_id = #{materialId}</if>
<if test="qualityStatus != null and qualityStatus != ''">and quality_status = #{qualityStatus}</if>
</where>
order by instock_date asc
</select>
<select id="selectWmsRawStockInList" parameterType="WmsRawStock" resultMap="WmsRawStockResult">
<include refid="selectWmsRawStockVo"/>
<where>
<if test="warehouseId != null "> and warehouse_id = #{warehouseId}</if>
<if test="locationCode != null and locationCode != ''"> and location_code = #{locationCode}</if>
<if test="stockType != null and stockType != ''"> and stock_type = #{stockType}</if>
<if test="materialId != null "> and material_id = #{materialId}</if>
<if test="instockBatch != null and instockBatch != ''"> and instock_batch = #{instockBatch}</if>
<if test="instockDate != null "> and instock_date = #{instockDate}</if>
<if test="lastOutstockTime != null "> and last_outstock_time = #{lastOutstockTime}</if>
<if test="qualityStatus != null and qualityStatus != ''"> and quality_status = #{qualityStatus}</if>
<if test="completeFlag != null and completeFlag != ''"> and complete_flag = #{completeFlag}</if>
<if test="frozenAmount != null "> and frozen_amount = #{frozenAmount}</if>
<if test="occupyAmount != null "> and occupy_amount = #{occupyAmount}</if>
<if test="supplierId != null "> and supplier_id = #{supplierId}</if>
<if test="createDate != null "> and create_date = #{createDate}</if>
<if test="updateDate != null "> and update_date = #{updateDate}</if>
<if test="activeFlag != null and activeFlag != ''"> and active_flag = #{activeFlag}</if>
<if test="warehouseId != null ">and warehouse_id = #{warehouseId}</if>
<if test="locationCode != null and locationCode != ''">and location_code = #{locationCode}</if>
<if test="stockType != null and stockType != ''">and stock_type = #{stockType}</if>
<if test="materialId != null ">and material_id = #{materialId}</if>
<if test="instockBatch != null and instockBatch != ''">and instock_batch = #{instockBatch}</if>
<if test="instockDate != null ">and instock_date = #{instockDate}</if>
<if test="lastOutstockTime != null ">and last_outstock_time = #{lastOutstockTime}</if>
<if test="qualityStatus != null and qualityStatus != ''">and quality_status = #{qualityStatus}</if>
<if test="completeFlag != null and completeFlag != ''">and complete_flag = #{completeFlag}</if>
<if test="frozenAmount != null ">and frozen_amount = #{frozenAmount}</if>
<if test="occupyAmount != null ">and occupy_amount = #{occupyAmount}</if>
<if test="supplierId != null ">and supplier_id = #{supplierId}</if>
<if test="createDate != null ">and create_date = #{createDate}</if>
<if test="updateDate != null ">and update_date = #{updateDate}</if>
<if test="activeFlag != null and activeFlag != ''">and active_flag = #{activeFlag}</if>
and total_amount > 0
and total_amount > 0
</where>
</select>
</mapper>

@ -1,50 +1,69 @@
<?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">
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hw.wms.mapper.WmsStockTotalMapper">
<resultMap type="WmsStockTotal" id="WmsStockTotalResult">
<result property="stockTotalId" column="stock_total_id" />
<result property="warehouseId" column="warehouse_id" />
<result property="warehouseFloor" column="warehouse_floor" />
<result property="stockType" column="stock_type" />
<result property="materialId" column="material_id" />
<result property="totalAmount" column="total_amount" />
<result property="frozenAmount" column="frozen_amount" />
<result property="occupyAmount" column="occupy_amount" />
<result property="createBy" column="create_by" />
<result property="createDate" column="create_date" />
<result property="updateBy" column="update_by" />
<result property="updateDate" column="update_date" />
<result property="activeFlag" column="active_flag" />
<result property="materialCode" column="material_code" />
<result property="materialName" column="material_name" />
<result property="stockTotalId" column="stock_total_id"/>
<result property="warehouseId" column="warehouse_id"/>
<result property="warehouseFloor" column="warehouse_floor"/>
<result property="stockType" column="stock_type"/>
<result property="materialId" column="material_id"/>
<result property="totalAmount" column="total_amount"/>
<result property="frozenAmount" column="frozen_amount"/>
<result property="occupyAmount" column="occupy_amount"/>
<result property="createBy" column="create_by"/>
<result property="createDate" column="create_date"/>
<result property="updateBy" column="update_by"/>
<result property="updateDate" column="update_date"/>
<result property="activeFlag" column="active_flag"/>
<result property="materialCode" column="material_code"/>
<result property="materialName" column="material_name"/>
<result property="warehouseName" column="warehouse_name"/>
</resultMap>
<sql id="selectWmsStockTotalVo">
select stock_total_id, warehouse_id, warehouse_floor, stock_type, material_id, total_amount, frozen_amount, occupy_amount, create_by, create_date, update_by, update_date, active_flag from wms_stock_total
select wst.stock_total_id,
wst.warehouse_id,
wbw.warehouse_name,
wst.warehouse_floor,
wst.stock_type,
wst.material_id,
mbmi.material_code,
mbmi.material_name,
wst.total_amount,
wst.frozen_amount,
wst.occupy_amount,
wst.create_by,
wst.create_date,
wst.update_by,
wst.update_date,
wst.active_flag
from wms_stock_total wst
left join wms_base_warehouse wbw on wbw.warehouse_id = wst.warehouse_id
left join mes_base_material_info mbmi on mbmi.material_id = wst.material_id
</sql>
<select id="selectWmsStockTotalList" parameterType="WmsStockTotal" resultMap="WmsStockTotalResult">
<include refid="selectWmsStockTotalVo"/>
<where>
<if test="warehouseId != null "> and warehouse_id = #{warehouseId}</if>
<if test="warehouseFloor != null "> and warehouse_floor = #{warehouseFloor}</if>
<if test="stockType != null and stockType != ''"> and stock_type = #{stockType}</if>
<if test="materialId != null "> and material_id = #{materialId}</if>
<if test="totalAmount != null "> and total_amount = #{totalAmount}</if>
<if test="frozenAmount != null "> and frozen_amount = #{frozenAmount}</if>
<if test="occupyAmount != null "> and occupy_amount = #{occupyAmount}</if>
<if test="createDate != null "> and create_date = #{createDate}</if>
<if test="updateDate != null "> and update_date = #{updateDate}</if>
<if test="activeFlag != null and activeFlag != ''"> and active_flag = #{activeFlag}</if>
<if test="warehouseId != null ">and wst.warehouse_id = #{warehouseId}</if>
<if test="warehouseFloor != null ">and wst.warehouse_floor = #{warehouseFloor}</if>
<if test="stockType != null and stockType != ''">and wst.stock_type = #{stockType}</if>
<if test="materialId != null ">and wst.material_id = #{materialId}</if>
<if test="totalAmount != null ">and wst.total_amount = #{totalAmount}</if>
<if test="frozenAmount != null ">and wst.frozen_amount = #{frozenAmount}</if>
<if test="occupyAmount != null ">and wst.occupy_amount = #{occupyAmount}</if>
<if test="createDate != null ">and wst.create_date = #{createDate}</if>
<if test="updateDate != null ">and wst.update_date = #{updateDate}</if>
<if test="activeFlag != null and activeFlag != ''">and wst.active_flag = #{activeFlag}</if>
</where>
</select>
<select id="selectWmsStockTotalByStockTotalId" parameterType="Long" resultMap="WmsStockTotalResult">
<include refid="selectWmsStockTotalVo"/>
where stock_total_id = #{stockTotalId}
where wst.stock_total_id = #{stockTotalId}
</select>
<insert id="insertWmsStockTotal" parameterType="WmsStockTotal" useGeneratedKeys="true" keyProperty="stockTotalId">
@ -62,7 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">update_by,</if>
<if test="updateDate != null">update_date,</if>
<if test="activeFlag != null">active_flag,</if>
</trim>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="warehouseId != null">#{warehouseId},</if>
<if test="warehouseFloor != null">#{warehouseFloor},</if>
@ -76,7 +95,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">#{updateBy},</if>
<if test="updateDate != null">#{updateDate},</if>
<if test="activeFlag != null">#{activeFlag},</if>
</trim>
</trim>
</insert>
<update id="updateWmsStockTotal" parameterType="WmsStockTotal">
@ -99,7 +118,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update>
<delete id="deleteWmsStockTotalByStockTotalId" parameterType="Long">
delete from wms_stock_total where stock_total_id = #{stockTotalId}
delete
from wms_stock_total
where stock_total_id = #{stockTotalId}
</delete>
<delete id="deleteWmsStockTotalByStockTotalIds" parameterType="String">
@ -110,24 +131,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<select id="selectWmsStockTotalJoinList" parameterType="WmsStockTotal" resultMap="WmsStockTotalResult">
select wst.stock_total_id, wst.warehouse_id, wst.warehouse_floor, wst.stock_type, wst.material_id,
wst.total_amount, wst.frozen_amount, wst.occupy_amount,
mbmi.material_code,mbmi.material_name
wst.total_amount, wst.frozen_amount, wst.occupy_amount,
mbmi.material_code,mbmi.material_name
from wms_stock_total wst left join mes_base_material_info mbmi on wst.material_id = mbmi.material_id
<where>
<if test="warehouseId != null "> and wst.warehouse_id = #{warehouseId}</if>
<if test="warehouseFloor != null "> and wst.warehouse_floor = #{warehouseFloor}</if>
<if test="stockType != null and stockType != ''"> and wst.stock_type = #{stockType}</if>
<if test="materialId != null "> and wst.material_id = #{materialId}</if>
<if test="materialName != null and materialName != ''">and mbmi.material_name like concat('%', #{materialName},
<if test="warehouseId != null ">and wst.warehouse_id = #{warehouseId}</if>
<if test="warehouseFloor != null ">and wst.warehouse_floor = #{warehouseFloor}</if>
<if test="stockType != null and stockType != ''">and wst.stock_type = #{stockType}</if>
<if test="materialId != null ">and wst.material_id = #{materialId}</if>
<if test="materialName != null and materialName != ''">and mbmi.material_name like concat('%',
#{materialName},
'%')
</if>
</where>

@ -8,6 +8,14 @@ export function listSuplier(query) {
params: query
})
}
//
export function selectDmsBaseDeviceSuplierByDeviceId(query) {
return request({
url: '/dms/suplier/selectDmsBaseDeviceSuplierByDeviceId',
method: 'get',
params: query
})
}
// 查询设备供应商信息详细
export function getSuplier(supplierId) {

@ -14,7 +14,9 @@ export function listUser(data) {
export function listUsers(data) {
return request({
url: '/ems/report/pointDnb/lists',
method: 'get',
method: 'post',
// data: qs.stringify(data),
// contentType:'application/x-www-form-urlencoded',
data: data,
})
}
@ -28,7 +30,7 @@ export function listUser2(data) {
// contentType:'application/x-www-form-urlencoded',
})
}
// 柱状图1
// 柱状图1-电整点数据能耗统计
export function dnbCountingData(query) {
return request({
url: '/ems/report/board/dnbCountingData',

@ -6,8 +6,8 @@ export function listHistory(query) {
console.log("listUser1:", query);
return request({
url: '/ems/record/dnbInstant/list',
method: 'get',
params: query
method: 'post',
data: query
})
}

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询提示路由信息列表
export function listPointRouter(query) {
return request({
url: '/system/pointRouter/list',
method: 'get',
params: query
})
}
// 查询提示路由信息详细
export function getPointRouter(pointRouterId) {
return request({
url: '/system/pointRouter/' + pointRouterId,
method: 'get'
})
}
// 新增提示路由信息
export function addPointRouter(data) {
return request({
url: '/system/pointRouter',
method: 'post',
data: data
})
}
// 修改提示路由信息
export function updatePointRouter(data) {
return request({
url: '/system/pointRouter',
method: 'put',
data: data
})
}
// 删除提示路由信息
export function delPointRouter(pointRouterId) {
return request({
url: '/system/pointRouter/' + pointRouterId,
method: 'delete'
})
}

@ -42,3 +42,21 @@ export function delStocktotal(stockTotalId) {
method: 'delete'
})
}
// 查询原材料库存列表
export function listRawstock(query) {
return request({
url: '/wms/rawstock/list',
method: 'get',
params: query
})
}
// 查询成品库存列表
export function listProductstock(query) {
return request({
url: '/wms/productstock/list',
method: 'get',
params: query
})
}

@ -57,6 +57,7 @@ export default {
let DDate = this.dateArr[3];
let MDate = this.dateArr[4];
let YDate = this.dateArr[5];
//
let sIdx = this.getIndex(sDate, nSecond);
let mIdx = this.getIndex(mDate, nMin);
@ -448,9 +449,11 @@ export default {
this.dateArr[1] = this.getCycleArr(rule, 60, true)
} else if (rule.indexOf('/') >= 0) {
this.dateArr[1] = this.getAverageArr(rule, 59)
} else if (rule !== '*') {
} else if (rule !== '*' && rule !=='0') {
this.dateArr[1] = this.getAssignArr(rule)
}
} else if (rule =='*'){
this.dateArr[1] = '0';
}
},
// ""
getSecondArr(rule) {
@ -459,9 +462,13 @@ export default {
this.dateArr[0] = this.getCycleArr(rule, 60, true)
} else if (rule.indexOf('/') >= 0) {
this.dateArr[0] = this.getAverageArr(rule, 59)
} else if (rule !== '*') {
} else if (rule !== '*' &&rule!=='0') {
this.dateArr[0] = this.getAssignArr(rule)
}
//0
else if (rule=='*'){
this.dateArr[0] = '0';
}
},
// min-max
getOrderArr(min, max) {

@ -9,25 +9,25 @@
<template v-if="device!=='mobile'">
<search id="header-search" class="right-menu-item" />
<el-tooltip content="源码地址" effect="dark" placement="bottom">
<ruo-yi-git id="ruoyi-git" class="right-menu-item hover-effect" />
</el-tooltip>
<!-- <el-tooltip content="源码地址" effect="dark" placement="bottom">-->
<!-- <ruo-yi-git id="ruoyi-git" class="right-menu-item hover-effect" />-->
<!-- </el-tooltip>-->
<el-tooltip content="文档地址" effect="dark" placement="bottom">
<ruo-yi-doc id="ruoyi-doc" class="right-menu-item hover-effect" />
</el-tooltip>
<!-- <el-tooltip content="文档地址" effect="dark" placement="bottom">-->
<!-- <ruo-yi-doc id="ruoyi-doc" class="right-menu-item hover-effect" />-->
<!-- </el-tooltip>-->
<screenfull id="screenfull" class="right-menu-item hover-effect" />
<el-tooltip content="异常处理">
<el-tooltip content="异常处理" class="right-menu-item hover-effect" >
<span
class="exceptionHandling"
:class="{ warnTxt: (typeList && typeList.length) || 0 }"
:class="{ warnTxt: (pointRouterList && pointRouterList.length) || 0 }"
@click="getAlarmData(true)"
><i class="el-icon-message"></i>{{
(typeList && typeList.length > 0 && typeList.length) || ""
(pointRouterList && pointRouterList.length > 0 && pointRouterList.length) || ""
}}
</span>
</el-tooltip>
<screenfull id="screenfull" class="right-menu-item hover-effect" />
<el-tooltip content="布局大小" effect="dark" placement="bottom">
<size-select id="size-select" class="right-menu-item hover-effect" />
</el-tooltip>
@ -54,57 +54,55 @@
</div>
<!-- 警告对话框 -->
<el-dialog
:title="title1"
:visible.sync="open1"
:title="alarmTitle"
:visible.sync="alarmOpen"
width="800px"
append-to-body
>
<el-table
v-loading="deviceloading"
:data="typeList"
@selection-change="handleSelectionChange1"
v-loading="alarmLoading"
:data="pointRouterList"
@selection-change="handleSelectionChangeAlarm"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column
label="计量设备名称"
align="center"
prop="monitorName"
/>
<el-table-column
label="采集设备编号"
align="center"
prop="collectDeviceId"
/>
<el-table-column label="记录时间" align="center" prop="collectTime" />
<el-table-column label="异常类型" align="center" prop="alarmType">
<!-- <el-table-column type="selection" width="55" align="center" />-->
<el-table-column label="功能模块" align="center" prop="moduleCode" >
<template slot-scope="scope">
<dict-tag
:options="dict.type.alarm_type"
:value="scope.row.alarmType"
/>
<dict-tag :options="dict.type.module_code" :value="scope.row.moduleCode"/>
</template>
</el-table-column>
<el-table-column label="异常状态" align="center" prop="alarmStatus">
<el-table-column label="提示类型" align="center" prop="pointType" >
<template slot-scope="scope">
<dict-tag
:options="dict.type.alarmStatus"
:value="scope.row.alarmStatus"
/>
<dict-tag :options="dict.type.point_type" :value="scope.row.pointType"/>
</template>
</el-table-column>
<el-table-column label="提示信息" align="center" prop="remark" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column align="center" class-name="small-padding fixed-width" label="操作" width="100">
<template slot-scope="scope">
<el-button
icon="el-icon-d-arrow-right"
size="small"
type="Info"
@click="jumpProcessing(scope.row)"
>跳转
</el-button>
</template>
</el-table-column>
<el-table-column label="异常数据" align="center" prop="alarmData" />
<el-table-column label="备注" align="center" prop="cause" />
</el-table>
<!-- <pagination
v-show="devicetotal > 0"
:total="devicetotal"
:page.sync="queryParams1.pageNum"
:limit.sync="queryParams1.pageSize"
@pagination="getDeviceList"
/> -->
<pagination
v-show="pointRouterTotal > 0"
:total="pointRouterTotal"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageNum"
@pagination="getPointRouterList"
/>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="editAlarmStatus"> </el-button>
<el-button @click="open1 = false"> </el-button>
<!-- <el-button type="primary" @click="editAlarmStatus"> </el-button>-->
<el-button @click="alarmOpen = false"> </el-button>
</div>
</el-dialog>
</div>
@ -120,41 +118,40 @@ import SizeSelect from '@/components/SizeSelect'
import Search from '@/components/HeaderSearch'
import RuoYiGit from '@/components/RuoYi/Git'
import RuoYiDoc from '@/components/RuoYi/Doc'
import { listData, editAlarmStatus } from "@/api/ems/base/exception/data.js";
import { changePoolName } from "@/api/system/user";
import {listPointRouter, updatePointRouter} from "@//api/system/common/pointRouter";
import router from "@//router";
export default {
dicts: ["alarm_type", "alarmStatus"],
dicts: ['point_type', 'router_flag', 'module_code'],
data() {
return {
poolNameList: [],
poolName: "",
title1: "异常处理",
open1: false,
deviceloading: false,
typeList: null,
devicetotal: null,
alarmTitle: "异常处理",
alarmOpen: false,
alarmLoading: false,
pointRouterList: [],
pointRouterTotal: 0,
//
ids1: [],
routerIds: [],
//
single1: true,
single: true,
//
multiple1: true,
multiple: true,
//
queryParams: {
pageNum: 1,
pageSize: 10,
routerFlag: '0',
},
};
},
created() {
localStorage.setItem("this.devicetotal", 0);
localStorage.setItem("this.pointRouterTotal", 0);
},
mounted() {
// this.getAlarmData();
//
this.getAlarmData();
// setInterval(() => this.getAlarmData(), 1000 * 60);
// this.poolNameList = JSON.parse(localStorage.getItem("POOL_NAME_LIST"));
// this.poolName = localStorage.getItem("USER_POOL_NAME_CURRENT");
// if(this.$route.query.id) {
// changePoolName(this.$route.query.id).then((res) => {
// localStorage.setItem("USER_POOL_NAME_CURRENT", this.$route.query.id);
// this.poolName = this.$route.query.id;
// });
// }
},
components: {
Breadcrumb,
@ -208,36 +205,52 @@ export default {
),
});
},
//
editAlarmStatus() {
editAlarmStatus({ objIds: this.ids1 }).then((res) => {
this.$message({
type: "success",
message: "异常数据已处理!",
duration: 1500,
});
this.getAlarmData();
/** 跳转处理 */
jumpProcessing(row) {
let params = {};
if (row.routerAddressDetail != null){
params = JSON.parse(row.routerAddressDetail)
}
updatePointRouter({pointRouterId: row.pointRouterId, routerFlag: '1'}).then(response => {
this.$tab.openPage(row.moduleCode + this.selectDictLabel(this.dict.type.point_type, row.pointType),
row.routerAddress, params);
this.alarmOpen = false;
});
},
//
// editAlarmStatus() {
// editAlarmStatus({ objIds: this.routerIds }).then((res) => {
// this.$message({
// type: "success",
// message: "",
// duration: 1500,
// });
// this.getAlarmData();
// });
// },
/** 报警列表 */
getAlarmData(open) {
this.open1 = open;
this.deviceloading = true;
listData({ alarmStatus: 1 }).then((response) => {
this.typeList = response.rows;
this.devicetotal = response.total;
this.deviceloading = false;
if (localStorage.getItem("this.devicetotal") != this.devicetotal) {
localStorage.setItem("this.devicetotal", this.devicetotal);
this.openAlarm();
}
this.alarmOpen = open;
this.alarmLoading = true;
this.getPointRouterList();
},
getPointRouterList() {
listPointRouter(this.queryParams).then((response) => {
this.pointRouterList = response.rows;
this.pointRouterTotal = response.total;
this.alarmLoading = false;
// if (localStorage.getItem("this.pointRouterTotal") != this.pointRouterTotal) {
// localStorage.setItem("this.pointRouterTotal", this.pointRouterTotal);
// this.openAlarm();
// }
});
},
//
handleSelectionChange1(selection) {
this.ids1 = selection.map((item) => item.objId);
this.single1 = selection.length !== 1;
this.multiple1 = !selection.length;
handleSelectionChangeAlarm(selection) {
this.routerIds = selection.map((item) => item.pointRouterId);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
toggleSideBar() {
this.$store.dispatch('app/toggleSideBar')

@ -388,6 +388,7 @@ export const dynamicRoutes = [
},
],
},
//审批保养工单路由
{
path: "/dms/dmsMaintInstanceActivity",
@ -513,6 +514,21 @@ export const dynamicRoutes = [
}
]
},
//质检结果详细
{
path: "/qms/base/checkresultdetail",
component: Layout,
hidden: true,
permissions: ["tool:gen:edit"],
children: [
{
path: "index/:checkResultId(\\d+)",
component: () => import("@/views/qms/base/checkresultdetail/index"),
name: "checkResultDetail",
meta: { title: "质检结果详细", activeMenu: "/qms/base/checkresultdetail" },
},
],
},
]

@ -169,7 +169,8 @@
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="父级标识" prop="parentId">
<treeselect v-model="form.parentId" :options="bomOptions" :normalizer="normalizer" placeholder="请选择父级标识" />
<treeselect @input="change" v-model="form.parentId" :options="bomOptions" :normalizer="normalizer"
placeholder="请选择父级标识" />
</el-form-item>
<!-- <el-form-item label="设备ID">-->
<!-- <el-input v-model="form.deviceId" placeholder="请输入设备ID关联dms_base_device_ledger的device_id" />-->
@ -184,7 +185,7 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label="bom数量" prop="bomAmount">
<el-form-item label="bom数量" prop="bomAmount" v-if="isShowBom">
<el-input v-model="form.bomAmount" placeholder="请输入bom数量" />
</el-form-item>
<!-- <el-form-item label="是否标识1-是2-否" prop="isFlag">-->
@ -232,6 +233,7 @@ export default {
children: "children",
label: "typeName"
},
isShowBom:false,
deptName:undefined,
ledgerList:[],
//
@ -286,6 +288,16 @@ export default {
this.getTreeselectDeviceType();
},
methods: {
change(){
if (this.form.parentId != 0){
this.isShowBom = true;
this.form.bomAmount = null;
}
if (this.form.parentId ==0){
this.isShowBom = false;
this.form.bomAmount = 1;
}
},
/** 查询设备台账信息列表 */
getDeviceLedger() {
@ -437,6 +449,7 @@ export default {
this.getList();
});
} else {
addBom(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;

@ -197,7 +197,7 @@
<!-- <el-input v-model="form.deviceId" placeholder="请输入设备ID。关联dms_base_device_ledger的device_id" />-->
<!-- </el-form-item>-->
<el-form-item label="设备名称" prop="deviceId" >
<el-select v-model="form.deviceId" placeholder="请选择设备" :disabled=isDis>
<el-select v-model="form.deviceId" placeholder="请选择设备" >
<el-option
v-for="item in ledgerList"
:key="item.deviceId"

@ -133,18 +133,18 @@
</template>
</el-table-column>
<!-- <el-table-column label="设备类型ID关联dms_base_device_type的device_type_id" align="center" prop="deviceTypeId" />-->
<el-table-column label="设备类型" align="center" prop="deviceTypeId" >
<template slot-scope="scope">
<span
v-for="(item, index) in devicetypeList"
:key="index"
:value="item.devicetypeList"
v-if="scope.row.deviceTypeId == item.deviceTypeId"
>
{{ item.typeName }}
</span>
</template>
</el-table-column>
<!-- <el-table-column label="设备类型" align="center" prop="deviceTypeId" >-->
<!-- <template slot-scope="scope">-->
<!-- <span-->
<!-- v-for="(item, index) in devicetypeList"-->
<!-- :key="index"-->
<!-- :value="item.devicetypeList"-->
<!-- v-if="scope.row.deviceTypeId == item.deviceTypeId"-->
<!-- >-->
<!-- {{ item.typeName }}-->
<!-- </span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="是否标识1-是0-否" align="center" prop="isFlag" />-->
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
@ -199,16 +199,16 @@
<!-- <el-form-item label="设备类型ID关联dms_base_device_type的device_type_id" prop="deviceTypeId">-->
<!-- <el-input v-model="form.deviceTypeId" placeholder="请输入设备类型ID关联dms_base_device_type的device_type_id" />-->
<!-- </el-form-item>-->
<el-form-item label="设备类型" prop="deviceTypeId" >
<el-select v-model="form.deviceTypeId" placeholder="请输入设备类型">
<el-option
v-for="item in devicetypeList"
:key="item.deviceTypeId"
:label="item.typeName"
:value="item.deviceTypeId">
</el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="设备类型" prop="deviceTypeId" >-->
<!-- <el-select v-model="form.deviceTypeId" placeholder="请输入设备类型">-->
<!-- <el-option-->
<!-- v-for="item in devicetypeList"-->
<!-- :key="item.deviceTypeId"-->
<!-- :label="item.typeName"-->
<!-- :value="item.deviceTypeId">-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="线路类型" prop="checkState">
<el-radio-group v-model="form.inspectType">
<el-radio

@ -166,8 +166,8 @@
<!-- <el-form-item label="巡检项目ID关联dms_base_inspect_project的inspect_project_id" prop="inspectProjectId">-->
<!-- <el-input v-model="form.inspectProjectId" placeholder="请输入巡检项目ID关联dms_base_inspect_project的inspect_project_id" />-->
<!-- </el-form-item>-->
<el-form-item label="巡检线路" prop="inspectProjectId" >
<el-select v-model="form.inspectProjectId" placeholder="请输入设备类型">
<el-form-item label="巡检项目" prop="inspectProjectId" >
<el-select v-model="form.inspectProjectId" placeholder="请选择巡检项目">
<el-option
v-for="item in dmsBaseInspectProjectList"
:key="item.inspectProjectId"

@ -219,13 +219,13 @@
<!-- <el-form-item label="巡检标准" prop="inspectStandard">-->
<!-- <el-input v-model="form.inspectStandard" placeholder="请输入巡检标准" />-->
<!-- </el-form-item>-->
<el-form-item label="巡检标准" prop="inspectStandard" >
<el-form-item label="巡检标准" prop="inspectStandardId" >
<el-select v-model="form.inspectStandard" placeholder="请输入巡检标准">
<el-option
v-for="item in dmsBaseInspectStandardList"
:key="item.inspectStandardId"
:key="item.inspectStandardId.toString()"
:label="item.standardName"
:value="item.inspectStandardId">
:value="item.inspectStandardId.toString()">
</el-option>
</el-select>
</el-form-item>
@ -321,6 +321,7 @@ export default {
getInspectStandard() {
listDmsBaseInspectStandard(this.queryParams).then(response => {
this.dmsBaseInspectStandardList = response.rows;
console.log(this.dmsBaseInspectStandardList)
});
},
//

@ -64,12 +64,12 @@
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="润滑组别" prop="maintGroup">
<el-form-item label="保养组别" prop="maintGroup">
<el-input v-model="form.maintGroup" placeholder="请输入检修组别" :disabled=true />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="润滑负责人" prop="maintSupervisor">
<el-form-item label="保养负责人" prop="maintSupervisor">
<el-input v-model="form.maintSupervisor" placeholder="请输入检修负责人" :disabled=true />
</el-form-item>
</el-col>

@ -163,6 +163,14 @@
<span>{{ parseTime(scope.row.planTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="时限" align="center" prop="timeLimit" >
<template slot-scope="scope">
<span v-show="scope.row.timeLimitDays!=0&&scope.row.timeLimitDays!=null">{{scope.row.timeLimitDays}}</span>
<span v-show="scope.row.timeLimitHours!=0&&scope.row.timeLimitHours!=null">{{scope.row.timeLimitHours}}</span>
</template>
</el-table-column>
<!-- <el-table-column label="循环周期" align="center" prop="cyclePeriod" />-->
<!-- <el-table-column label="循环周期" align="center" prop="cyclePeriod">-->
<!-- <template slot-scope="scope">-->
@ -213,7 +221,7 @@
<!-- <el-input v-model="form.inspectRouteId" placeholder="请输入巡检线路ID关联dm_base_inspect_route的inspect_route_id" />-->
<!-- </el-form-item>-->
<el-form-item label="巡检线路" prop="inspectRouteId" >
<el-select v-model="form.inspectRouteId" placeholder="请输入设备类型">
<el-select v-model="form.inspectRouteId" placeholder="请选择巡检线路">
<el-option
v-for="item in dmsBaseInspectRouteList"
:key="item.inspectRouteId"
@ -231,9 +239,18 @@
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="设备总数" prop="deviceAmount">
<el-input v-model="form.deviceAmount" placeholder="请输入设备总数" />
<el-form-item label="设备总数" prop="deviceAmount" >
<el-input v-model="form.deviceAmount" placeholder="请输入设备总数" :disabled=true >
</el-input>
</el-form-item>
<el-row>
<el-col :span="12">
<el-form-item label="时限" prop="timeLimitDays">
<el-input-number v-model="form.timeLimitDays" placeholder="请输入天数" :precision="0" :min="0" :max="10000"/>
<el-input-number v-model="form.timeLimitHours" placeholder="请输入小时" :precision="0" :min="0" :max="23"/>
</el-form-item>
</el-col>
</el-row>
<!-- <el-form-item label="计划巡检时间" prop="planTime">-->
<!-- <el-date-picker clearable-->
<!-- v-model="form.planTime"-->

@ -364,7 +364,8 @@
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
>
</el-table>
<el-table v-loading="loading" :data="supplierList" v-if=deviceSuplierIf>
<el-table v-loading="loading" :data="supplierLists" v-if=deviceSuplierIf>
<!-- <el-table v-loading="loading" :data="supplierLists">-->
<el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="主键标识" align="center" prop="supplierId" key="sup5"/>-->
<el-table-column label="供应商编号" align="center" prop="suplierCode" key="sup1"/>
@ -625,7 +626,7 @@
<script>
import { listLedger, getLedger, delLedger, addLedger, updateLedger } from "@/api/dms/ledger";
import { listDevicetype ,selectDevicetypeByDeviceId}from "@/api/dms/devicetype";
import { getSuplier, listSuplier } from '@/api/dms/suplier'
import { getSuplier, listSuplier,selectDmsBaseDeviceSuplierByDeviceId } from '@/api/dms/suplier'
import { listDevicedepreciation } from '@/api/dms/devicedepreciation'
import Treeselect from '@riophae/vue-treeselect'
import { listCheckplan } from '@/api/dms/checkplan'
@ -682,6 +683,7 @@ export default {
installList:[],
//
supplierList:[],
supplierLists:[],
//
title: "",
//
@ -1223,11 +1225,13 @@ export default {
getSuplier(){
listSuplier().then(response => {
this.supplierList = response.rows;
// this.supplierLists = this.supplierList;
})
},
getSuplier2(){
listSuplier(this.queryParams).then(response => {
this.supplierList = response.rows;
selectDmsBaseDeviceSuplierByDeviceId(this.queryParams).then(response => {
this.supplierLists = response.data;
console.log(response)
this.deviceTypeIf = false;
this.deviceSuplierIf = true;
this.deviceInstallIf = false;

@ -98,7 +98,7 @@
<el-form-item label="计划编号" prop="planLubeCode">
<el-input v-model="form.planLubeCode" :disabled="true"/>
</el-form-item>
<el-form-item label="保养级别" prop="lubeLevel">
<el-form-item label="润滑级别" prop="lubeLevel">
<el-radio-group v-model="form.lubeLevel" :disabled="true">
<el-radio
v-for="dict in dict.type.dms_lube_level"
@ -107,8 +107,8 @@
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="保养组别" prop="lubeGroup" >
<el-input v-model="form.lubeGroup" placeholder="请输入保养组别":disabled="true" />
<el-form-item label="润滑组别" prop="lubeGroup" >
<el-input v-model="form.lubeGroup" placeholder="请输入润滑组别":disabled="true" />
</el-form-item>
<el-form-item label="循环周期" prop="cyclePeriod" >
@ -127,19 +127,19 @@
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="保养负责人" prop="lubeSupervisor">
<el-input v-model="form.lubeSupervisor" placeholder="请输入保养负责人" />
<el-form-item label="润滑负责人" prop="lubeSupervisor">
<el-input v-model="form.lubeSupervisor" placeholder="请输入润滑负责人" />
</el-form-item>
<el-form-item label="本次保养时间" prop="lubeTime">
<el-form-item label="本次润滑时间" prop="lubeTime">
<el-date-picker clearable
v-model="form.lubeTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择本次保养时间">
placeholder="请选择本次润滑时间">
</el-date-picker>
</el-form-item>
<el-form-item label="保养状态" prop="lubeStatus">
<el-form-item label="润滑状态" prop="lubeStatus">
<el-radio-group v-model="form.lubeStatus">
<el-radio
v-for="dict in dict.type.dms_lube_status"
@ -175,7 +175,7 @@
</el-select>
</el-form-item>
<el-form-item label="保养部位" prop="lubeStationId" >
<el-form-item label="润滑部位" prop="lubeStationId" >
<el-select v-model="form.lubeStationId" placeholder="请选择设备">
<el-option
v-for="item in stationList"
@ -187,7 +187,7 @@
</el-form-item>
<el-form-item label="保养标准" prop="lubeStandardId" >
<el-form-item label="润滑标准" prop="lubeStandardId" >
<el-select v-model="form.lubeStandardId" placeholder="请选择标准">
<el-option
v-for="item in standardList"
@ -364,7 +364,7 @@ export default {
this.reset();
this.form.planLubeId = this.planLubeId;
this.open = true;
this.title = "添加保养计划明细";
this.title = "添加润滑计划明细";
},
/** 修改按钮操作 */
handleUpdate(row) {
@ -373,7 +373,7 @@ export default {
getDmsPlanLubeDetail(planLubeDetailId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改保养计划明细信息";
this.title = "修改润滑计划明细信息";
});
},
/** 修改按钮操作 */
@ -383,7 +383,7 @@ export default {
getLube(planLubeId).then(response => {
this.form = response.data;
this.openCheck = true;
this.titleCheck = "修改保养计划信息";
this.titleCheck = "修改润滑计划信息";
});
},
/** 提交按钮 */
@ -409,7 +409,7 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
const planLubeDetailIds = row.planLubeDetailId || this.ids;
this.$modal.confirm('是否确认删除保养计划明细编号为"' + planLubeDetailIds + '"的数据项?').then(function() {
this.$modal.confirm('是否确认删除润滑计划明细编号为"' + planLubeDetailIds + '"的数据项?').then(function() {
return delDmsPlanLubeDetail(planLubeDetailIds);
}).then(() => {
this.getList();

@ -264,6 +264,7 @@ export default {
getList() {
this.loading = true;
listSuplier(this.queryParams).then(response => {
console.log(response)
this.suplierList = response.rows;
this.total = response.total;
this.loading = false;

@ -32,7 +32,8 @@
<!-- <el-input disabled v-model="unitIdname" />-->
<!-- </div>-->
<!-- </el-form-item>-->
<el-form-item label="统计时间段" prop="status" label-width="auto">
<!-- <el-form-item label="统计时间段" prop="status" label-width="auto">-->
<el-form-item label="统计时间段" prop="status" >
<el-select
v-model="queryParams.type"
placeholder="请选择"
@ -144,27 +145,28 @@
></div>
</el-card>
</el-col>
</el-row>
<el-card style="margin-bottom: 30px" class="box-card">
<el-row :gutter="20">
<el-col :span="24" :xs="24">
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出</el-button
>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
:columns="columns"
></right-toolbar>
</el-row>
<!-- <el-row :gutter="10" class="mb8">-->
<!--&lt;!&ndash; <el-col :span="1.5">&ndash;&gt;-->
<!--&lt;!&ndash; <el-button&ndash;&gt;-->
<!--&lt;!&ndash; type="warning"&ndash;&gt;-->
<!--&lt;!&ndash; plain&ndash;&gt;-->
<!--&lt;!&ndash; icon="el-icon-download"&ndash;&gt;-->
<!--&lt;!&ndash; size="mini"&ndash;&gt;-->
<!--&lt;!&ndash; @click="handleExport"&ndash;&gt;-->
<!--&lt;!&ndash; >导出</el-button&ndash;&gt;-->
<!--&lt;!&ndash; >&ndash;&gt;-->
<!--&lt;!&ndash; </el-col>&ndash;&gt;-->
<!-- <right-toolbar-->
<!-- :showSearch.sync="showSearch"-->
<!-- @queryTable="getList"-->
<!-- :columns="columns"-->
<!-- ></right-toolbar>-->
<!-- </el-row>-->
<!-- 用户表格 -->
<el-table
header-cell-class-name="columnclassname"
@ -628,9 +630,13 @@ export default {
":" +
s1;
//this.dateRangetwo = d1.getFullYear()+ '-'+m1+ '-'+tian1+ ' '+ h1+ ':'+M1+':'+s1;
this.dateRangeone = this.queryParams.startTime;
this.dateRangetwo = this.queryParams.endTime;
console.log(this.queryParams.startTime)
},
mounted() {
this.handleQuery();
},
methods: {
canceltwo() {
@ -795,12 +801,20 @@ export default {
// console.log('expendSum',this.hejidata)
this.total = response.total;
this.loading = false;
let xData = [];
// console.log('response.rows[0].expendSum', response.rows[0].expendSum)
//echart
let xData = Object.keys(response.rows?.[0]);
// let xData = Object.keys(response.rows?.[0]);
for (var i = 0; i < response.rows.length; i++) {
if (response.rows[i].expendSum != undefined) {
xData = Object.keys(response.rows[i]);
}
}
let xData1 = xData.filter(
(val) =>
!!val && !["unitName", "state", "expendSum", "type"].includes(val)
);
// console.log('xData1',xData1)
let yData = [];
xData1.forEach((val) => {
let num = 0;
@ -810,6 +824,9 @@ export default {
yData.push(parseFloat(num.toFixed(2)) || 0);
});
let xData2 = xData1.map((val) => val.split("expend")[1] + ":00:00");
console.log(xData2);
console.log("============================================================")
let arr = xData2.map((e, index) => {
return {
name: e,
@ -820,7 +837,7 @@ export default {
arr.sort((a, b) => {
return a.time - b.time;
});
let yData1 = arr.map((e) => e.value);
let yData1 = arr.map((e) => e.value);
console.log("///", yData1);
myChart.setOption({
dataZoom: [
@ -864,13 +881,13 @@ export default {
// this.handleQuery();
},
//
canceltwo() {
this.formaaa.monitorName = "";
this.formaaa.monitorId = "";
this.opentwo = false;
//this.reset();
},
// //
// canceltwo() {
// this.formaaa.monitorName = "";
// this.formaaa.monitorId = "";
// this.opentwo = false;
// //this.reset();
// },
//
submitFormtwo: function () {
this.opentwo = false;
@ -888,12 +905,12 @@ export default {
this.timeList = [];
this.energyList = [];
this.timeList.push(
{
title: "用电类型",
field: "type",
align: "center",
rowspan: 2,
},
// {
// title: "",
// field: "type",
// align: "center",
// rowspan: 2,
// },
{
title: "用电类型名称",
field: "unitName",
@ -907,12 +924,20 @@ export default {
rowspan: 2,
}
);
console.log(columns.length);
//
if(columns.length>750){
columns = columns.slice(0,751)
}
for (let i in columns) {
this.timeList.push({
title: columns[i],
align: "center",
colspan: 1,
field: "expend" + columns[i].substring(0, 13),
});
this.energyList.push({
field: "expend" + columns[i].substring(0, 13),
@ -1027,8 +1052,8 @@ export default {
//this.dateRange = [];
this.unitIdname = "";
this.queryParams.unit = "";
this.queryParams.startTime = "";
this.queryParams.endTime = "";
this.queryParams.startTime = this.dateRangeone;
this.queryParams.endTime = this.dateRangetwo;
//this.resetForm("queryForm");
//this.queryParams.deptId = undefined;
//this.$refs.tree.setCurrentKey(null);

@ -85,16 +85,16 @@
>筛选计量设备</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出</el-button
>
</el-col>
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="warning"-->
<!-- plain-->
<!-- icon="el-icon-download"-->
<!-- size="mini"-->
<!-- @click="handleExport"-->
<!-- >导出</el-button-->
<!-- >-->
<!-- </el-col>-->
<div class="total">
<div class="number">合计电量:</div>
<div class="alltotal">
@ -310,6 +310,8 @@ export default {
dateRange: [],
dateRangeone: "",
dateRangetwo: "",
dateRangeoneSelect:"",
dateRangetwoSelect:"",
//
postOptions: [],
deptOptionsselect: [],
@ -428,6 +430,7 @@ export default {
console.log("d", d);
this.dateRangeone = d.getFullYear() + "-" + m + "-" + tian;
this.dateRangeoneSelect = this.dateRangeone;
this.dateRangetwo = new Date(
new Date().setHours(0, 0, 0, 0) + 24 * 60 * 60 * 1000 - 1
);
@ -439,6 +442,7 @@ export default {
let s1 = ("0" + d1.getSeconds()).slice(-2);
console.log("tian1.length", tian1);
this.dateRangetwo = d1.getFullYear() + "-" + m1 + "-" + tian1;
this.dateRangetwoSelect = this.dateRangetwo
//this.dateRangetwo = d1.getFullYear()+ '-'+m1+ '-'+tian1+ ' '+ h1+ ':'+M1+':'+s1;
this.getList();
@ -466,9 +470,10 @@ export default {
this.queryParams.type = 0;
this.queryParams.energyType = 2;
this.queryParams.relationId = 1;
previewPolyline(this.queryParams).then((res) => {
this.number = res.data.sumEnergyValue;
})
// previewPolyline(this.queryParams).then((res) => {
// this.number = res.data.sumEnergyValue;
// alert("1")
// })
}
this.loading = false;
});
@ -511,7 +516,7 @@ export default {
item, (item.oid = item.id), (item.lable = item.name);
});
this.deptOptionsselect = this.tranListToTreeData(response);
console.log(this.deptOptionsselect);
// console.log(this.deptOptionsselect);
this.opentwo = true;
this.title2 = "设备计量信息选择";
//this.deptOptions = response.data;
@ -604,8 +609,9 @@ export default {
/** 重置按钮操作 */
resetQuery() {
//this.dateRange = [];
this.dateRangeone = "";
this.dateRangetwo = "";
this.dateRangeone = this.dateRangeoneSelect;
this.dateRangetwo = this.dateRangetwoSelect;
this.queryParams.monitorIdList = "";
//this.resetForm("queryForm");
//this.queryParams.deptId = undefined;
//this.$refs.tree.setCurrentKey(null);

@ -189,8 +189,8 @@ export default {
//
queryParams: {
collectType: '',
objid:"",
params:{
monitorObjid:'',
pageNum: 1,
pageSize: 10,
}
@ -349,7 +349,7 @@ export default {
},
//
handleNodeClick(data) {
this.queryParams.params.monitorObjid = data.id;
this.queryParams.objid = data.id;
this.getList();
},
//
@ -391,7 +391,7 @@ export default {
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams.params.monitorObjid = '';
this.queryParams.objid = '';
this.dateRangeone = '';
this.dateRangetwo = '';
this.setDataRange();

@ -469,8 +469,19 @@ export default {
//
handleNodeClick(data) {
console.log("data", data);
var flag = 1;
this.queryParams.monitorId = data.monitorId;
this.dynamicTags.push({ label: data.name, value: data.monitorId });
for (var i = 0; i < this.dynamicTags.length; i++) {
if (this.dynamicTags[i].value==this.queryParams.monitorId){
flag = 0;
}
}
if (flag == 1){
this.dynamicTags.push({ label: data.name, value: data.monitorId });
}
console.log(this.dynamicTags)
console.log("====================================================================================")
this.handleQuery();
},
//tag

@ -521,6 +521,8 @@ export default {
//
handleNodeClick(data) {
this.queryParams.monitorSubset = data.monitorId;
console.log(this.queryParams.monitorSubset);
console.log("===================================");
this.getList();
this.dnbCountingData();
},
@ -629,7 +631,7 @@ export default {
delete paramsexport.pageNum;
delete paramsexport.pageSize;
this.download(
"/energy/report/pointDnb/export",
"ems/report/pointDnb/export",
{
...paramsexport,
orderByColumn: null,

@ -378,9 +378,10 @@ export default {
pageNum: 1,
pageSize: 10,
// orderByColumn: "collectTime",
objid:"",
collectType: 0,
// isAsc: "desc",
monitorSubset: "",
monitorId: "",
params: {
beginCollectTime: "",
endCollectTime: "",
@ -451,6 +452,7 @@ export default {
this.queryParams.params.pageNum = this.queryParams.pageNum;
this.queryParams.params.pageSize = this.queryParams.pageSize;
listUser(this.queryParams).then((response) => {
// console.log(response)
this.userList = response.rows;
this.total = response.total;
this.loading = false;
@ -505,7 +507,9 @@ export default {
},
//
handleNodeClick(data) {
this.queryParams.monitorSubset = data.monitorId;
console.log(data)
this.queryParams.objid = data.id;
this.queryParams.monitorId = data.monitorId;
this.handleQuery();
},
//
@ -702,7 +706,7 @@ export default {
delete paramsexport.pageSize;
delete paramsexport.pageNum;
this.download(
"/energy/record/dnbInstant/export",
"ems/record/dnbInstant/export",
{
...paramsexport,
},

@ -128,7 +128,9 @@
/>
</template>
</el-table-column>
<el-table-column label="仪表状态" align="center" prop="meterStatus" />
<!-- 能源也没找到对应的字典也为使用暂时先不使用-->
<!-- <el-table-column label="仪表状态" align="center" prop="meterStatus" />-->
<el-table-column label="终端地址" align="center" prop="meterIp" />
<el-table-column label="心跳频率" align="center" prop="heartInterval" />
<el-table-column
@ -579,7 +581,7 @@ export default {
/** 导出按钮操作 */
handleExport() {
this.download(
"energy/communicate/export",
"ems/communicate/export",
{
...this.queryParams,
},

@ -631,16 +631,16 @@ export default {
children: node.children,
};
},
/** 查询计量设备信息下拉树结构 */
getTreeselect() {
this.queryParams.monitorType = 2;
listShuiMeasurement(this.queryParams).then((response) => {
this.ShuiMeasurementOptions = [];
const data = { objid: 0, monitorName: "顶级节点", children: [] };
data.children = this.handleTree(response.data, "objid", "parentId");
this.ShuiMeasurementOptions.push(data);
});
},
// /** */
// getTreeselect() {
// this.queryParams.monitorType = 2;
// listShuiMeasurement(this.queryParams).then((response) => {
// this.ShuiMeasurementOptions = [];
// const data = { objid: 0, monitorName: "", children: [] };
// data.children = this.handleTree(response.data, "objid", "parentId");
// this.ShuiMeasurementOptions.push(data);
// });
// },
//
cancel() {
this.open = false;

@ -532,9 +532,7 @@ export default {
this.$refs["form"].validate(valid => {
if (valid) {
this.form.mesBaseProcessProdlineList = this.mesBaseProcessProdlineList;
if (!/^[0-9]\d*$/.test(this.form.productionTimeDays)
|| !/^[0-9]\d*$/.test(this.form.productionTimeHours)
|| !/^[0-9]\d*$/.test(this.form.productionTimeMinutes)) {
if (this.form.productionTime <= 0) {
this.$modal.msgError("标准工时天、小时、分钟需为大于等于0的正整数");
return;
}

@ -0,0 +1,436 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="功能模块" prop="moduleCode">
<el-select v-model="queryParams.moduleCode" placeholder="请选择功能模块" clearable>
<el-option
v-for="dict in dict.type.module_code"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="提示类型" prop="pointType">
<el-select v-model="queryParams.pointType" placeholder="请选择提示类型" clearable>
<el-option
v-for="dict in dict.type.point_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<!-- <el-form-item label="路由地址" prop="routerAddress">-->
<!-- <el-input-->
<!-- v-model="queryParams.routerAddress"-->
<!-- placeholder="请输入路由地址"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="路由地址详情" prop="routerAddressDetail">-->
<!-- <el-input-->
<!-- v-model="queryParams.routerAddressDetail"-->
<!-- placeholder="请输入路由地址详情"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<el-form-item label="跳转标识" prop="routerFlag">
<el-select v-model="queryParams.routerFlag" placeholder="请选择跳转标识" clearable>
<el-option
v-for="dict in dict.type.router_flag"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="创建时间">
<el-date-picker
v-model="daterangecreateTime"
style="width: 340px"
value-format="yyyy-MM-dd HH:mm:ss"
type="datetimerange"
range-separator="-"
start-placeholder="开始时间"
end-placeholder="结束时间"
></el-date-picker>
</el-form-item>
<!-- <el-form-item label="更新时间">-->
<!-- <el-date-picker-->
<!-- v-model="daterangeupdateTime"-->
<!-- style="width: 240px"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- type="daterange"-->
<!-- range-separator="-"-->
<!-- start-placeholder="开始日期"-->
<!-- end-placeholder="结束日期"-->
<!-- ></el-date-picker>-->
<!-- </el-form-item>-->
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:pointRouter:add']"
>新增
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:pointRouter:edit']"
>修改
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:pointRouter:remove']"
>删除
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:pointRouter:export']"
>导出
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="pointRouterList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="提示路由ID" align="center" prop="pointRouterId" v-if="columns[0].visible"/>
<el-table-column label="功能模块" align="center" prop="moduleCode" v-if="columns[1].visible">
<template slot-scope="scope">
<dict-tag :options="dict.type.module_code" :value="scope.row.moduleCode"/>
</template>
</el-table-column>
<el-table-column label="提示类型" align="center" prop="pointType" v-if="columns[2].visible">
<template slot-scope="scope">
<dict-tag :options="dict.type.point_type" :value="scope.row.pointType"/>
</template>
</el-table-column>
<el-table-column label="路由地址" align="center" prop="routerAddress" v-if="columns[3].visible"/>
<el-table-column label="路由地址详情" align="center" prop="routerAddressDetail" v-if="columns[4].visible"/>
<el-table-column label="跳转标识" align="center" prop="routerFlag" v-if="columns[5].visible">
<template slot-scope="scope">
<dict-tag :options="dict.type.router_flag" :value="scope.row.routerFlag"/>
</template>
</el-table-column>
<el-table-column label="提示信息" align="center" prop="remark" v-if="columns[6].visible"/>
<el-table-column label="创建时间" align="center" prop="createTime" width="180" v-if="columns[8].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="更新时间" align="center" prop="updateTime" width="180" v-if="columns[10].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:pointRouter:edit']"
>修改
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:pointRouter:remove']"
>删除
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改提示路由信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="功能模块" prop="moduleCode">
<el-select v-model="form.moduleCode" placeholder="请选择功能模块">
<el-option
v-for="dict in dict.type.module_code"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="提示类型" prop="pointType">
<el-radio-group v-model="form.pointType">
<el-radio
v-for="dict in dict.type.point_type"
:key="dict.value"
:label="dict.value"
>{{ dict.label }}
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="路由地址" prop="routerAddress">
<el-input v-model="form.routerAddress" placeholder="请输入路由地址"/>
</el-form-item>
<el-form-item label="路由地址详情" prop="routerAddressDetail">
<el-input v-model="form.routerAddressDetail" placeholder="请输入路由地址详情"/>
</el-form-item>
<!-- <el-form-item label="跳转标识" prop="routerFlag">-->
<!-- <el-radio-group v-model="form.routerFlag">-->
<!-- <el-radio-->
<!-- v-for="dict in dict.type.router_flag"-->
<!-- :key="dict.value"-->
<!-- :label="dict.value"-->
<!-- >{{ dict.label }}-->
<!-- </el-radio>-->
<!-- </el-radio-group>-->
<!-- </el-form-item>-->
<el-form-item label="提示信息" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listPointRouter,
getPointRouter,
delPointRouter,
addPointRouter,
updatePointRouter
} from "@/api/system/common/pointRouter";
export default {
name: "PointRouter",
dicts: ['point_type', 'router_flag', 'module_code'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
pointRouterList: [],
//
title: "",
//
open: false,
//
daterangecreateTime: [],
//
daterangeupdateTime: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
moduleCode: null,
pointType: null,
routerAddress: null,
routerAddressDetail: null,
routerFlag: '0',
createTime: null,
updateTime: null
},
//
form: {},
//
rules: {
moduleCode: [
{required: true, message: "功能模块不能为空", trigger: "change"}
],
pointType: [
{required: true, message: "提示类型不能为空", trigger: "change"}
],
routerAddress: [
{required: true, message: "路由地址不能为空", trigger: "blur"}
],
},
columns: [
{key: 0, label: `提示路由ID`, visible: false},
{key: 1, label: `功能模块`, visible: true},
{key: 2, label: `提示类型`, visible: true},
{key: 3, label: `路由地址`, visible: true},
{key: 4, label: `路由地址详情`, visible: true},
{key: 5, label: `跳转标识`, visible: true},
{key: 6, label: `提示信息`, visible: false},
{key: 7, label: `创建人`, visible: false},
{key: 8, label: `创建时间`, visible: true},
{key: 9, label: `更新人`, visible: false},
{key: 10, label: `更新时间`, visible: false},
],
};
},
created() {
console.log('url参数',this.$route.query)
this.getList();
},
methods: {
/** 查询提示路由信息列表 */
getList() {
this.loading = true;
this.queryParams.params = {};
if (null != this.daterangecreateTime && '' != this.daterangecreateTime) {
this.queryParams.params["begincreateTime"] = this.daterangecreateTime[0];
this.queryParams.params["endcreateTime"] = this.daterangecreateTime[1];
}
if (null != this.daterangeupdateTime && '' != this.daterangeupdateTime) {
this.queryParams.params["beginupdateTime"] = this.daterangeupdateTime[0];
this.queryParams.params["endupdateTime"] = this.daterangeupdateTime[1];
}
listPointRouter(this.queryParams).then(response => {
this.pointRouterList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
pointRouterId: null,
moduleCode: null,
pointType: '1',
routerAddress: null,
routerAddressDetail: null,
routerFlag: null,
remark: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.daterangecreateTime = [];
this.daterangeupdateTime = [];
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.pointRouterId)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加提示路由信息";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const pointRouterId = row.pointRouterId || this.ids
getPointRouter(pointRouterId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改提示路由信息";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.pointRouterId != null) {
updatePointRouter(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
this.form.routerFlag = '0'
addPointRouter(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const pointRouterIds = row.pointRouterId || this.ids;
this.$modal.confirm('是否确认删除提示路由信息编号为"' + pointRouterIds + '"的数据项?').then(function () {
return delPointRouter(pointRouterIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/pointRouter/export', {
...this.queryParams
}, `pointRouter_${new Date().getTime()}.xlsx`)
}
}
};
</script>

@ -1,218 +1,245 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="仓库ID" prop="warehouseId">
<el-input
v-model="queryParams.warehouseId"
placeholder="请输入仓库ID"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="仓库楼层" prop="warehouseFloor">
<el-input
v-model="queryParams.warehouseFloor"
placeholder="请输入仓库楼层"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="物料ID" prop="materialId">
<el-input
v-model="queryParams.materialId"
placeholder="请输入物料ID"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="总数量;仓库存放的总数量" prop="totalAmount">
<el-input
v-model="queryParams.totalAmount"
placeholder="请输入总数量;仓库存放的总数量"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="冻结数量;手动冻结的,暂时可不用" prop="frozenAmount">
<el-input
v-model="queryParams.frozenAmount"
placeholder="请输入冻结数量;手动冻结的,暂时可不用"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="占用数量;申请时占用的数量,在出库时要减去出库数量,并且总数量要同步更新;" prop="occupyAmount">
<el-input
v-model="queryParams.occupyAmount"
placeholder="请输入占用数量;申请时占用的数量,在出库时要减去出库数量,并且总数量要同步更新;"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="创建时间" prop="createDate">
<el-date-picker clearable
v-model="queryParams.createDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择创建时间">
</el-date-picker>
</el-form-item>
<el-form-item label="最后更新时间" prop="updateDate">
<el-date-picker clearable
v-model="queryParams.updateDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择最后更新时间">
</el-date-picker>
</el-form-item>
<el-form-item label="有效标记" prop="activeFlag">
<el-input
v-model="queryParams.activeFlag"
placeholder="请输入有效标记"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-row :gutter="20">
<!--仓库数据-->
<el-col :span="4" :xs="24">
<div class="head-container">
<el-input
v-model="warehouseName"
placeholder="请输入仓库名称"
clearable
size="small"
prefix-icon="el-icon-search"
style="margin-bottom: 20px"
/>
</div>
<div class="head-container">
<el-tree
:data="warehouseList"
:props="defaultProps"
:expand-on-click-node="false"
:filter-node-method="filterNode"
ref="tree"
node-key="warehouseId"
default-expand-all
highlight-current
@node-click="handleNodeClick"
/>
</div>
</el-col>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['wms:stocktotal:add']"
>新增</el-button>
<el-col :span="20" :xs="24">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
label-width="68px">
<!-- <el-form-item label="仓库ID" prop="warehouseId">-->
<!-- <el-input-->
<!-- v-model="queryParams.warehouseId"-->
<!-- placeholder="请输入仓库ID"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<el-form-item label="创建时间">
<el-date-picker
v-model="daterangeCreateDate"
style="width: 340px"
value-format="yyyy-MM-dd HH:mm:ss"
type="datetimerange"
range-separator="-"
start-placeholder="开始时间"
end-placeholder="结束时间"
></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="primary"-->
<!-- plain-->
<!-- icon="el-icon-plus"-->
<!-- size="mini"-->
<!-- @click="handleAdd"-->
<!-- v-hasPermi="['wms:stocktotal:add']"-->
<!-- >新增-->
<!-- </el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="success"-->
<!-- plain-->
<!-- icon="el-icon-edit"-->
<!-- size="mini"-->
<!-- :disabled="single"-->
<!-- @click="handleUpdate"-->
<!-- v-hasPermi="['wms:stocktotal:edit']"-->
<!-- >修改-->
<!-- </el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="danger"-->
<!-- plain-->
<!-- icon="el-icon-delete"-->
<!-- size="mini"-->
<!-- :disabled="multiple"-->
<!-- @click="handleDelete"-->
<!-- v-hasPermi="['wms:stocktotal:remove']"-->
<!-- >删除-->
<!-- </el-button>-->
<!-- </el-col>-->
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['wms:stocktotal:export']"
>导出
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="stocktotalList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"/>
<!-- <el-table-column label="总库存ID" align="center" prop="stockTotalId"/>-->
<!-- <el-table-column label="仓库ID" align="center" prop="warehouseId"/>-->
<el-table-column label="仓库名称" align="center" prop="warehouseName"/>
<el-table-column label="仓库楼层" align="center" prop="warehouseFloor"/>
<!-- <el-table-column label="库存类型" align="center" prop="stockType"/>-->
<el-table-column label="物料ID" align="center" prop="materialId"/>
<el-table-column label="物料编号" align="center" prop="materialCode"/>
<el-table-column label="物料名称" align="center" prop="materialName"/>
<el-table-column label="总数量" align="center" prop="totalAmount"/>
<el-table-column label="冻结数量" align="center" prop="frozenAmount"/>
<el-table-column label="占用数量" align="center" prop="occupyAmount"/>
<!-- <el-table-column label="创建时间" align="center" prop="createDate" width="180">-->
<!-- <template slot-scope="scope">-->
<!-- <span>{{ parseTime(scope.row.createDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="最后更新时间" align="center" prop="updateDate" width="180">-->
<!-- <template slot-scope="scope">-->
<!-- <span>{{ parseTime(scope.row.updateDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="有效标记" align="center" prop="activeFlag"/>-->
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['wms:stocktotal:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['wms:stocktotal:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['wms:stocktotal:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-row :gutter="20">
<el-col :span="20" :offset="4" :xs="20">
<el-divider content-position="center">库位库存明细信息</el-divider>
<el-table v-loading="loading" :data="stocktotalList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="总库存ID" align="center" prop="stockTotalId" />
<el-table-column label="仓库ID" align="center" prop="warehouseId" />
<el-table-column label="仓库楼层" align="center" prop="warehouseFloor" />
<el-table-column label="库存类型1原材料2半成品3成品" align="center" prop="stockType" />
<el-table-column label="物料ID" align="center" prop="materialId" />
<el-table-column label="总数量;仓库存放的总数量" align="center" prop="totalAmount" />
<el-table-column label="冻结数量;手动冻结的,暂时可不用" align="center" prop="frozenAmount" />
<el-table-column label="占用数量;申请时占用的数量,在出库时要减去出库数量,并且总数量要同步更新;" align="center" prop="occupyAmount" />
<el-table-column label="创建时间" align="center" prop="createDate" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="最后更新时间" align="center" prop="updateDate" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.updateDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="有效标记" align="center" prop="activeFlag" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['wms:stocktotal:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['wms:stocktotal:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<el-table v-loading="loadingTwo" :data="rawstockList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"/>
<!-- <el-table-column label="原材料库存ID" align="center" prop="rawStockId" />-->
<!-- <el-table-column label="仓库ID" align="center" prop="warehouseId"/>-->
<el-table-column label="仓库名称" align="center" prop="warehouseName" width="120" v-if="columns[0].visible"/>
<el-table-column label="仓库楼层" align="center" prop="warehouseFloor" v-if="columns[1].visible"/>
<el-table-column label="库位编码" align="center" prop="locationCode" v-if="columns[2].visible"/>
<!-- <el-table-column label="库存类型" align="center" prop="stockType"/>-->
<el-table-column label="物料编号" align="center" prop="materialCode" width="120" v-if="columns[3].visible"/>
<el-table-column label="物料名称" align="center" prop="materialName" width="150" v-if="columns[4].visible"/>
<el-table-column label="成品编号" align="center" prop="materialCode" width="120" v-if="columns[10].visible"/>
<el-table-column label="成品名称" align="center" prop="materialName" width="150" v-if="columns[11].visible"/>
<el-table-column label="计划编号" align="center" prop="planCode" width="100" v-if="columns[12].visible"/>
<el-table-column label="计划明细编号" align="center" prop="planDetailCode" width="120" v-if="columns[13].visible"/>
<el-table-column label="销售订单编号" align="center" prop="saleorderCode" width="120" v-if="columns[14].visible"/>
<el-table-column label="入库批次号" align="center" prop="instockBatch" width="100" v-if="columns[5].visible"/>
<el-table-column label="托盘RFID代码" align="center" prop="palletInfoCode" width="120" v-if="columns[6].visible"/>
<!-- <el-table-column label="入库时间" align="center" prop="instockDate" width="180">-->
<!-- <template slot-scope="scope">-->
<!-- <span>{{ parseTime(scope.row.instockDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="最晚出库时间" align="center" prop="lastOutstockTime" width="180">-->
<!-- <template slot-scope="scope">-->
<!-- <span>{{ parseTime(scope.row.lastOutstockTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="质检状态" align="center" prop="qualityStatus" />-->
<!-- <el-table-column label="完整标识" align="center" prop="completeFlag" />-->
<el-table-column label="总数量" align="center" prop="totalAmount" v-if="columns[7].visible"/>
<!-- <el-table-column label="冻结数量" align="center" prop="frozenAmount"/>-->
<el-table-column label="占用数量" align="center" prop="occupyAmount" v-if="columns[8].visible"/>
<!-- <el-table-column label="供应商ID" align="center" prop="supplierId" />-->
<el-table-column label="创建时间" align="center" prop="createDate" width="180" v-if="columns[9].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<!-- <el-table-column label="最后更新时间" align="center" prop="updateDate" width="180" >-->
<!-- <template slot-scope="scope">-->
<!-- <span>{{ parseTime(scope.row.updateDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="有效标记" align="center" prop="activeFlag" />-->
</el-table>
<pagination
v-show="twoPTotal>0"
:total="twoPTotal"
:page.sync="queryTwoParams.pageNum"
:limit.sync="queryTwoParams.pageSize"
@pagination="getTwoList"
/>
</el-col>
</el-row>
<!-- 添加或修改原材料库存对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="仓库ID" prop="warehouseId">
<el-input v-model="form.warehouseId" placeholder="请输入仓库ID" />
<el-input v-model="form.warehouseId" placeholder="请输入仓库ID"/>
</el-form-item>
<el-form-item label="仓库楼层" prop="warehouseFloor">
<el-input v-model="form.warehouseFloor" placeholder="请输入仓库楼层" />
<el-input v-model="form.warehouseFloor" placeholder="请输入仓库楼层"/>
</el-form-item>
<el-form-item label="物料ID" prop="materialId">
<el-input v-model="form.materialId" placeholder="请输入物料ID" />
<el-input v-model="form.materialId" placeholder="请输入物料ID"/>
</el-form-item>
<el-form-item label="总数量;仓库存放的总数量" prop="totalAmount">
<el-input v-model="form.totalAmount" placeholder="请输入总数量;仓库存放的总数量" />
<el-input v-model="form.totalAmount" placeholder="请输入总数量;仓库存放的总数量"/>
</el-form-item>
<el-form-item label="冻结数量;手动冻结的,暂时可不用" prop="frozenAmount">
<el-input v-model="form.frozenAmount" placeholder="请输入冻结数量;手动冻结的,暂时可不用" />
<el-input v-model="form.frozenAmount" placeholder="请输入冻结数量;手动冻结的,暂时可不用"/>
</el-form-item>
<el-form-item label="占用数量;申请时占用的数量,在出库时要减去出库数量,并且总数量要同步更新;" prop="occupyAmount">
<el-input v-model="form.occupyAmount" placeholder="请输入占用数量;申请时占用的数量,在出库时要减去出库数量,并且总数量要同步更新;" />
<el-input v-model="form.occupyAmount" placeholder="请输入占用数量;申请时占用的数量,在出库时要减去出库数量,并且总数量要同步更新;"/>
</el-form-item>
<el-form-item label="创建时间" prop="createDate">
<el-date-picker clearable
v-model="form.createDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择创建时间">
v-model="form.createDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择创建时间">
</el-date-picker>
</el-form-item>
<el-form-item label="最后更新时间" prop="updateDate">
<el-date-picker clearable
v-model="form.updateDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择最后更新时间">
v-model="form.updateDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择最后更新时间">
</el-date-picker>
</el-form-item>
<el-form-item label="有效标记" prop="activeFlag">
<el-input v-model="form.activeFlag" placeholder="请输入有效标记" />
<el-input v-model="form.activeFlag" placeholder="请输入有效标记"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
@ -224,7 +251,16 @@
</template>
<script>
import { listStocktotal, getStocktotal, delStocktotal, addStocktotal, updateStocktotal } from "@/api/wms/stocktotal";
import {
listStocktotal,
getStocktotal,
delStocktotal,
addStocktotal,
updateStocktotal,
listRawstock,
listProductstock
} from "@/api/wms/stocktotal";
import {getWarehouses} from "@//api/wms/wmslocation";
export default {
name: "Stocktotal",
@ -232,6 +268,7 @@ export default {
return {
//
loading: true,
loadingTwo: true,
//
ids: [],
//
@ -242,16 +279,30 @@ export default {
showSearch: true,
//
total: 0,
//
twoPTotal: 0,
//
stocktotalList: [],
//
title: "",
//
open: false,
// =1=2
type: null,
// List
warehouseList: [],
//
warehouseName: undefined,
//
daterangeCreateDate: [],
defaultProps: {
children: "children",
label: "warehouseName"
},
//
queryParams: {
pageNum: 1,
pageSize: 10,
pageSize: 2,
warehouseId: null,
warehouseFloor: null,
stockType: null,
@ -263,31 +314,63 @@ export default {
updateDate: null,
activeFlag: null
},
queryTwoParams: {
pageNum: 1,
pageSize: 2
},
//
form: {},
//
rules: {
warehouseId: [
{ required: true, message: "仓库ID不能为空", trigger: "blur" }
],
warehouseFloor: [
{ required: true, message: "仓库楼层不能为空", trigger: "blur" }
],
stockType: [
{ required: true, message: "库存类型1原材料2半成品3成品不能为空", trigger: "change" }
],
materialId: [
{ required: true, message: "物料ID不能为空", trigger: "blur" }
],
totalAmount: [
{ required: true, message: "总数量;仓库存放的总数量不能为空", trigger: "blur" }
],
}
//
rawstockList: [],
//
columns: [],
};
},
created() {
const type = this.$route.query && this.$route.query.type;
this.type = this.$route.query && this.$route.query.type;
if (this.type === '1') {
this.columns =
[
{key: 0, label: `仓库名称`, visible: true},
{key: 1, label: `仓库楼层`, visible: true},
{key: 2, label: `库位编码`, visible: true},
{key: 3, label: `物料编号`, visible: true},
{key: 4, label: `物料名称`, visible: true},
{key: 5, label: `入库批次号`, visible: true},
{key: 6, label: `托盘RFID代码`, visible: true},
{key: 7, label: `总数量`, visible: true},
{key: 8, label: `占用数量`, visible: true},
{key: 9, label: `创建时间`, visible: true},
{key: 10, label: `成品编号`, visible: false},
{key: 11, label: `成品名称`, visible: false},
{key: 12, label: `计划编号`, visible: false},
{key: 13, label: `计划明细编号`, visible: false},
{key: 14, label: `销售订单编号`, visible: false},
]
}
if (this.type === '3') {
this.columns =
[
{key: 0, label: `仓库名称`, visible: true},
{key: 1, label: `仓库楼层`, visible: true},
{key: 2, label: `库位编码`, visible: true},
{key: 3, label: `物料编号`, visible: false},
{key: 4, label: `物料名称`, visible: false},
{key: 5, label: `入库批次号`, visible: false},
{key: 6, label: `托盘RFID代码`, visible: true},
{key: 7, label: `总数量`, visible: true},
{key: 8, label: `占用数量`, visible: true},
{key: 9, label: `创建时间`, visible: true},
{key: 10, label: `成品编号`, visible: true},
{key: 11, label: `成品名称`, visible: true},
{key: 12, label: `计划编号`, visible: true},
{key: 13, label: `计划明细编号`, visible: true},
{key: 14, label: `销售订单编号`, visible: true},
]
}
this.getWarehouseList();
this.getList();
this.getTwoList();
},
methods: {
@ -300,6 +383,29 @@ export default {
this.loading = false;
});
},
/** 查询库位库存明细列表 */
getTwoList() {
this.loadingTwo = true;
this.queryTwoParams.params = {};
if (null != this.daterangeCreateDate && '' != this.daterangeCreateDate) {
this.queryTwoParams.params["beginCreateDate"] = this.daterangeCreateDate[0];
this.queryTwoParams.params["endCreateDate"] = this.daterangeCreateDate[1];
}
if (this.type === '1') {
listRawstock(this.queryTwoParams).then(response => {
this.rawstockList = response.rows;
this.twoPTotal = response.total;
this.loadingTwo = false;
});
}
if (this.type === '3') {
listProductstock(this.queryTwoParams).then(response => {
this.rawstockList = response.rows;
this.twoPTotal = response.total;
this.loadingTwo = false;
});
}
},
//
cancel() {
this.open = false;
@ -327,7 +433,9 @@ export default {
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.queryTwoParams.pageNum = 1;
this.getList();
this.getTwoList();
},
/** 重置按钮操作 */
resetQuery() {
@ -337,7 +445,7 @@ export default {
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.stockTotalId)
this.single = selection.length!==1
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
@ -346,6 +454,32 @@ export default {
this.open = true;
this.title = "添加原材料库存";
},
//
filterNode(value, data) {
if (!value) return true;
return data.warehouseName.indexOf(value) !== -1;
},
//
handleNodeClick(data) {
this.queryParams.warehouseId = data.warehouseId;
this.queryTwoParams.warehouseId = data.warehouseId;
this.handleQuery();
},
// List
getWarehouseList() {
this.loading = true;
this.loadingTwo = true;
getWarehouses({warehouseInstockType: this.type}).then(response => {
this.warehouseList = response.data;
// this.queryParams.warehouseId = this.warehouseList[0].warehouseId;
// this.queryTwoParams.warehouseId = this.warehouseList[0].warehouseId;
this.loading = false;
this.loadingTwo = false;
});
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
@ -376,15 +510,17 @@ export default {
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const stockTotalIds = row.stockTotalId || this.ids;
this.$modal.confirm('是否确认删除原材料库存编号为"' + stockTotalIds + '"的数据项?').then(function() {
this.$modal.confirm('是否确认删除原材料库存编号为"' + stockTotalIds + '"的数据项?').then(function () {
return delStocktotal(stockTotalIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
}).catch(() => {
});
},
/** 导出按钮操作 */
handleExport() {

@ -6,11 +6,11 @@
#X-KDApi-ServerUrl=https://apiexp.open.kingdee.com/k3cloud/
#<!-- 当前使用的 账套ID(即数据中心id) -->
X-KDApi-AcctID =657953112be3c4
X-KDApi-AcctID =65e56ceb72f33b
#<!-- 第三方系统登录授权的 应用ID -->
X-KDApi-AppID=265686_SY0M09lvzkp/18wG4/RBRa1GRs2V2pls
X-KDApi-AppID=262997_5Y0vSaDv0MpW7a9JT54CRa9G6gT7SOlt
#<!-- 第三方系统登录授权的 应用密钥 -->
X-KDApi-AppSec =317a6730c9ec4fafa757ca4a3499d059
X-KDApi-AppSec =b75a20c9294c48648d49f69903d6dc86
#<!-- 第三方系统登录授权的 集成用户名称 -->
X-KDApi-UserName =张铭潇
#<!-- 账套语系默认2052 -->

Loading…
Cancel
Save