问题修复4

master
zhaoxiaolin 4 months ago
parent 71c2c09b2f
commit b0c5d5e8c6

@ -1,6 +1,8 @@
package com.op.quality.controller;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.bean.BeanUtils;
import com.op.common.core.utils.poi.ExcelUtil;
import com.op.common.core.web.controller.BaseController;
import com.op.common.core.web.domain.AjaxResult;
@ -9,10 +11,7 @@ import com.op.common.log.annotation.Log;
import com.op.common.log.enums.BusinessType;
import com.op.common.security.annotation.RequiresPermissions;
import com.op.common.security.utils.SecurityUtils;
import com.op.quality.domain.QcBomComponent;
import com.op.quality.domain.QcCheckReportIncome;
import com.op.quality.domain.QcCheckTaskDetail;
import com.op.quality.domain.QcSupplier;
import com.op.quality.domain.*;
import com.op.quality.service.IQcCheckReportProductService;
import com.op.system.api.domain.SysUser;
import org.apache.commons.lang.StringUtils;
@ -22,6 +21,7 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
/**
@ -67,7 +67,7 @@ public class QcCheckReportProductController extends BaseController {
*
*/
@RequiresPermissions("quality:productReport:export")
@Log(title = "来料检验", businessType = BusinessType.EXPORT)
@Log(title = "成品检验报告明细数据", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, QcCheckReportIncome qcCheckReportIncome) {
@ -86,9 +86,15 @@ public class QcCheckReportProductController extends BaseController {
// qcCheckReportIncome.setCheckTimeEnd(qcCheckReportIncome.getIncomeTimeStart());//end
// }
List<QcCheckReportIncome> list = qcCheckReportProductService.selectQcCheckReportIncomeList(qcCheckReportIncome);
ExcelUtil<QcCheckReportIncome> util = new ExcelUtil<QcCheckReportIncome>(QcCheckReportIncome.class);
util.exportExcel(response, list, "来料检验数据");
List<QcCheckReportIncome> list0 = qcCheckReportProductService.selectQcCheckReportIncomeList(qcCheckReportIncome);
List<ProductReportDTO> list = new ArrayList<>();
for(QcCheckReportIncome idto:list0){
ProductReportDTO pdto = new ProductReportDTO();
BeanUtils.copyProperties(idto,pdto);
list.add(pdto);
}
ExcelUtil<ProductReportDTO> util = new ExcelUtil<ProductReportDTO>(ProductReportDTO.class);
util.exportExcel(response, list, "成品检验报告明细数据");
}
/**

@ -0,0 +1,340 @@
package com.op.quality.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
*
* @author Open Platform
* @date 2023-10-19
*/
public class ProductReportDTO extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
*
*/
@Excel(name = "检验任务编号")
private String checkNo;
/**
*
*/
@Excel(name = "来料批次号")
private String incomeBatchNo;
/**
*
*/
@Excel(name = "工单号")
private String orderNo;
@Excel(name = "订单号")
private String workorderCodeSap;
/**
*
*/
@Excel(name = "物料号")
private String materialCode;
/**
*
*/
@Excel(name = "物料名称")
private String materialName;
/**
*
*/
@Excel(name = "收货数量")
private BigDecimal quality;
/**
*
*/
@Excel(name = "单位")
private String unit;
/**
*
*/
@Excel(name = "供应商/车间编码")
private String supplierCode;
/**
*
*/
@Excel(name = "供应商/车间名称")
private String supplierName;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "任务时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date incomeTime;
/**
*
*/
@Excel(name = "检测地点")
private String checkLoc;
/**
*
*/
@Excel(name = "检测状态")
private String checkStatus;
/**
*
*/
@Excel(name = "检测人工号")
private String checkManCode;
/**
*
*/
@Excel(name = "检测人姓名")
private String checkManName;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "检验时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date checkTime;
/**
* Y
*/
@Excel(name = "检验结果Y合格")
private String checkResult;
/**
* 10
*/
@Excel(name = "是否启用1启用0停用")
private String status;
/**
*
*/
@Excel(name = "工厂编码")
private String factoryCode;
/**
* 10
*/
private String delFlag;
@Excel(name = "抽样数量ST")
private BigDecimal sampleQuality;
public String getWorkorderCodeSap() {
return workorderCodeSap;
}
public void setWorkorderCodeSap(String workorderCodeSap) {
this.workorderCodeSap = workorderCodeSap;
}
public BigDecimal getSampleQuality() {
return sampleQuality;
}
public void setSampleQuality(BigDecimal sampleQuality) {
this.sampleQuality = sampleQuality;
}
public void setCheckNo(String checkNo) {
this.checkNo = checkNo;
}
public String getCheckNo() {
return checkNo;
}
public void setIncomeBatchNo(String incomeBatchNo) {
this.incomeBatchNo = incomeBatchNo;
}
public String getIncomeBatchNo() {
return incomeBatchNo;
}
public void setOrderNo(String orderNo) {
this.orderNo = orderNo;
}
public String getOrderNo() {
return orderNo;
}
public void setMaterialCode(String materialCode) {
this.materialCode = materialCode;
}
public String getMaterialCode() {
return materialCode;
}
public void setMaterialName(String materialName) {
this.materialName = materialName;
}
public String getMaterialName() {
return materialName;
}
public void setQuality(BigDecimal quality) {
this.quality = quality;
}
public BigDecimal getQuality() {
return quality;
}
public void setUnit(String unit) {
this.unit = unit;
}
public String getUnit() {
return unit;
}
public void setSupplierCode(String supplierCode) {
this.supplierCode = supplierCode;
}
public String getSupplierCode() {
return supplierCode;
}
public void setSupplierName(String supplierName) {
this.supplierName = supplierName;
}
public String getSupplierName() {
return supplierName;
}
public void setIncomeTime(Date incomeTime) {
this.incomeTime = incomeTime;
}
public Date getIncomeTime() {
return incomeTime;
}
public void setCheckLoc(String checkLoc) {
this.checkLoc = checkLoc;
}
public String getCheckLoc() {
return checkLoc;
}
public void setCheckStatus(String checkStatus) {
this.checkStatus = checkStatus;
}
public String getCheckStatus() {
return checkStatus;
}
public void setCheckManCode(String checkManCode) {
this.checkManCode = checkManCode;
}
public String getCheckManCode() {
return checkManCode;
}
public void setCheckManName(String checkManName) {
this.checkManName = checkManName;
}
public String getCheckManName() {
return checkManName;
}
public void setCheckTime(Date checkTime) {
this.checkTime = checkTime;
}
public Date getCheckTime() {
return checkTime;
}
public void setCheckResult(String checkResult) {
this.checkResult = checkResult;
}
public String getCheckResult() {
return checkResult;
}
public void setStatus(String status) {
this.status = status;
}
public String getStatus() {
return status;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
public String getFactoryCode() {
return factoryCode;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
public String getDelFlag() {
return delFlag;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("checkNo", getCheckNo())
.append("incomeBatchNo", getIncomeBatchNo())
.append("orderNo", getOrderNo())
.append("materialCode", getMaterialCode())
.append("materialName", getMaterialName())
.append("quality", getQuality())
.append("unit", getUnit())
.append("supplierCode", getSupplierCode())
.append("supplierName", getSupplierName())
.append("incomeTime", getIncomeTime())
.append("checkLoc", getCheckLoc())
.append("checkStatus", getCheckStatus())
.append("checkManCode", getCheckManCode())
.append("checkManName", getCheckManName())
.append("checkTime", getCheckTime())
.append("checkResult", getCheckResult())
.append("status", getStatus())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("factoryCode", getFactoryCode())
.append("delFlag", getDelFlag())
.toString();
}
}

@ -5,10 +5,7 @@ import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.security.utils.SecurityUtils;
import com.op.quality.domain.*;
import com.op.quality.mapper.QcCheckReportIncomeMapper;
import com.op.quality.mapper.QcCheckTaskDetailMapper;
import com.op.quality.mapper.QcCheckTypeProjectMapper;
import com.op.quality.mapper.QcMaterialGroupDetailMapper;
import com.op.quality.mapper.*;
import com.op.quality.service.IQcCheckReportProductService;
import com.op.system.api.domain.SysUser;
import org.apache.commons.lang.StringUtils;
@ -41,7 +38,8 @@ public class QcCheckReportProductServiceImpl implements IQcCheckReportProductSer
@Autowired
private QcCheckTaskDetailMapper qcCheckTaskDetailMapper;
@Autowired
private QcStaticTableMapper qcStaticTableMapper;
/**
*
*
@ -75,7 +73,17 @@ public class QcCheckReportProductServiceImpl implements IQcCheckReportProductSer
qcCheckReportIncome.setDelFlag("0");
qcCheckReportIncome.setTypeCode("product");
qcCheckReportIncome.setCheckType("checkTypeCP");
return qcCheckReportIncomeMapper.selectQcCheckReportIncomeList(qcCheckReportIncome);
List<QcCheckReportIncome> dtos = qcCheckReportIncomeMapper.selectQcCheckReportIncomeList(qcCheckReportIncome);
for(QcCheckReportIncome dto:dtos){
List<String> batchnos = qcStaticTableMapper.getBatchnos(dto.getOrderNo());
String ordernoStr = "";
for (String batchno : batchnos) {
ordernoStr += batchno + ";";
}
;
dto.setIncomeBatchNo(ordernoStr);
}
return dtos;
}
/**

@ -95,6 +95,9 @@ public class QcCheckTaskProduceServiceImpl implements IQcCheckTaskProduceService
@Autowired
private RemoteOpenService remoteOpenService;
@Autowired
private QcStaticTableMapper qcStaticTableMapper;
private static Pattern p2= Pattern.compile("<[^>]+>");
/**
@ -135,7 +138,17 @@ public class QcCheckTaskProduceServiceImpl implements IQcCheckTaskProduceService
public List<QcCheckTaskProduce> selectQcCheckTaskProduceList(QcCheckTaskProduce qcCheckTaskProduce) {
qcCheckTaskProduce.setDelFlag("0");
qcCheckTaskProduce.setTypeCode("produce");
return qcCheckTaskProduceMapper.selectQcCheckTaskProduceList(qcCheckTaskProduce);
List<QcCheckTaskProduce> dtos = qcCheckTaskProduceMapper.selectQcCheckTaskProduceList(qcCheckTaskProduce);
for(QcCheckTaskProduce dto:dtos){
List<String> batchnos = qcStaticTableMapper.getBatchnos(dto.getOrderNo());
String ordernoStr = "";
for (String batchno : batchnos) {
ordernoStr += batchno + ";";
}
;
dto.setIncomeBatchNo(ordernoStr);
}
return dtos;
}
/**

@ -145,6 +145,8 @@
<if test="checkTimeEnd != null ">and #{checkTimeEnd} > CONVERT(varchar(30),qct.check_time, 120)</if>
<if test="checkType != null ">and qct.check_type = #{checkType}</if>
<if test="typeCode != null ">and q.type_code = #{typeCode}</if>
<if test="cpkType != null ">and bpa.cpk_type = #{cpkType}</if>
and pow.del_flag = '0'
</where>
order by qct.create_time desc

@ -25,7 +25,12 @@
from qc_check_task qct
where qct.type_code = 'material' and qct.del_flag = '0'
and CONVERT(varchar(7),qct.income_time, 120) = #{yearMonth}
<if test="supplierCodes != null and supplierCodes.size()>0">
and qct.supplier_code in
<foreach collection="supplierCodes" item="supplierCode" index="index" separator="," open="(" close=")">
#{supplierCode}
</foreach>
</if>
</select>
<select id="selectPcMap" resultType="com.op.quality.domain.QcStaticTable">
SELECT
@ -280,6 +285,7 @@
left join pro_order_workorder pow on powb.workorder_id = pow.workorder_id
where powb.del_flag = '0' and pow.del_flag = '0'
and pow.workorder_code = #{orderNo}
order by powb.batch_code
</select>
<select id="getLegendData" resultType="com.op.quality.domain.QcStaticTable">
select DISTINCT supplier_code supplierCode,
@ -497,7 +503,9 @@
from qc_check_task qct
left join qc_check_task_detail qctd on qct.record_id = qctd.belong_to
left join base_product_attached bpa on concat('0000000',bpa.product_code) = qct.material_code
left join base_equipment be on be.equipment_type_code = 'equ_type_bzx' and be.del_flag = '0'
left join base_equipment be on be.equipment_type_code = 'equ_type_bzx'
and be.del_flag = '0'
and be.equipment_code = qct.check_loc
left join qc_check_type qt on qt.order_code = qct.check_type
where qct.check_type = #{checkType} and qctd.property_code = '1' and qct.check_time is not null
<if test="ymArrayStart != null ">and CONVERT(varchar(7),qct.income_time, 120) >= #{ymArrayStart}</if>
@ -980,7 +988,9 @@
from qc_check_task qct
left join qc_check_task_detail qctd on qct.record_id = qctd.belong_to
left join base_product_attached bpa on concat('0000000',bpa.product_code) = qct.material_code
left join base_equipment be on be.equipment_type_code = 'equ_type_bzx' and be.del_flag = '0'
left join base_equipment be on be.equipment_type_code = 'equ_type_bzx'
and be.del_flag = '0'
and be.equipment_code = qct.check_loc
left join qc_check_type qt on qt.order_code = qct.check_type
where qct.check_type = #{checkType} and qctd.property_code = '1' and qct.check_time is not null
<if test="ymArrayStart != null ">and CONVERT(varchar(10),qct.income_time, 120) >= #{ymArrayStart}</if>

@ -543,11 +543,11 @@ public class SysUserServiceImpl implements ISysUserService {
//Date maxTime0 = userMapper.getMaxTime();
//if(maxTime0 != null){
// Calendar calendar = Calendar.getInstance();
// calendar.setTime(maxTime0);
// calendar.add(Calendar.DAY_OF_YEAR, 1);
// Date maxTime = calendar.getTime();
Date maxTime = DateUtils.getNowDate();
Calendar calendar = Calendar.getInstance();
//calendar.setTime(maxTime0);
calendar.add(Calendar.DAY_OF_YEAR, -1);
Date maxTime = calendar.getTime();
//Date maxTime = DateUtils.getNowDate();
String ymd = DateFormatUtils.format(maxTime, "yyyy-MM-dd");//yyyy-MM-dd
log.info("更新人力-参数:"+ ymd);
//AjaxResult hrR = remoteOpenService.GetHrUserInfo(ymd);
@ -592,7 +592,9 @@ public class SysUserServiceImpl implements ISysUserService {
}
dto.setPhonenumber(dto.getPeMobilePhone());
dto.setPost(dto.getPoscd());
dto.setDeptId(Long.parseLong(dto.getOucod()));
if(StringUtils.isNotBlank(dto.getOucod())){
dto.setDeptId(Long.parseLong(dto.getOucod()));
}
}
//sap返回的编码

Loading…
Cancel
Save