月度报表、标准效率计算方式

master
Yangwl 7 months ago
parent 48ebc38c13
commit da7a9054d5

@ -476,7 +476,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
* @param factoryCode
* @param lineCode 线
* @param productDate
* @param version
* @param version
* @param productStatus A
* @param content (0)
* @return

@ -13,16 +13,16 @@ spring:
nacos:
discovery:
# 服务注册地址
namespace: lanju-op
group: zxl
namespace: lanju-op-test
group: test
# 服务注册地址
server-addr: 175.27.215.92:8848
server-addr: 192.168.202.20:8848
config:
# 配置中心地址
namespace: lanju-op
group: zxl
namespace: lanju-op-test
group: test
# 服务注册地址
server-addr: 175.27.215.92:8848
server-addr: 192.168.202.20:8848
# 配置文件格式
file-extension: yml
# 共享配置

@ -27,6 +27,7 @@ import com.op.mes.domain.dto.LineChartDto;
import com.op.mes.domain.dto.SysFactoryDto;
import com.op.mes.domain.vo.DynamicColumnVo;
import com.op.mes.domain.vo.MesDailyReportVo;
import com.op.mes.domain.vo.MesMonthReportVo;
import com.op.system.api.domain.DataSourcePropertyDTO;
import com.op.system.api.domain.SysUser;
import com.op.system.api.domain.device.EquEquipmentDTO;
@ -266,7 +267,6 @@ public class MesReportWorkController extends BaseController {
String end = mesDailyReportVo.getProductDateEnd();
ExcelUtil<MesDailyReportVo> util = new ExcelUtil<>(MesDailyReportVo.class);
util.exportExcel(response, list, start+"至"+end+"生产日报表");
}
@ -599,6 +599,42 @@ public class MesReportWorkController extends BaseController {
return AjaxResult.error("报工失败:"+r.getMsg());
}
}
/**
*
*/
@RequiresPermissions("mes:dailyProductionSut:list")
@GetMapping("/getdailyProductionSut")
public AjaxResult getdailyProductionSut(MesDailyReportVo mesDailyReportVo) {
List<MesDailyReportVo> list = mesReportWorkService.getDailyReportNew(mesDailyReportVo);
return success();
}
/**
*
*/
@RequiresPermissions("mes:monthProductionSut:list")
@GetMapping("/getmonthProductionSut")
public AjaxResult getmonthProductionSut(MesMonthReportVo mesMonthReportVo) {
SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd");
Date today = mesMonthReportVo.getMonthValue();
// 设置日历到本月1号
Calendar calendar = Calendar.getInstance();
calendar.setTime(today);
calendar.set(Calendar.DAY_OF_MONTH, 1);
String beginTime = simpleDateFormat.format(mesMonthReportVo.getMonthValue());
// 设置日历到下个月1号
calendar.add(Calendar.MONTH, 1);
String endTime = simpleDateFormat.format(calendar.getTime());
Map parammap =new HashMap();
parammap.put("beginTime",beginTime);
parammap.put("endTime",endTime);
mesMonthReportVo.setParams(parammap);
List<Map> mapList = mesReportWorkService.getmonthProductionSut(mesMonthReportVo);
return success(mapList);
}
}

@ -0,0 +1,20 @@
package com.op.mes.domain.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.op.common.core.web.domain.BaseEntity;
import javax.xml.crypto.Data;
import java.util.Date;
public class MesMonthReportVo extends BaseEntity {
@JsonFormat(pattern = "yyyy-MM")
private Date monthValue;
public Date getMonthValue() {
return monthValue;
}
public void setMonthValue(Date monthValue) {
this.monthValue = monthValue;
}
}

@ -9,6 +9,7 @@ import com.op.mes.domain.dto.LineChartSeriesDto;
import com.op.mes.domain.dto.QuantityDto;
import com.op.mes.domain.dto.SysFactoryDto;
import com.op.mes.domain.vo.MesDailyReportVo;
import com.op.mes.domain.vo.MesMonthReportVo;
import com.op.system.api.domain.SysUser;
import com.op.system.api.domain.device.EquEquipmentDTO;
import com.op.system.api.domain.mes.ProOrderWorkorderDTO;
@ -180,4 +181,6 @@ public interface MesReportWorkMapper {
QuantityDto getRealQuantity(QuantityDto quantityDto);
List<QuantityDto> getSumQuantity(QuantityDto quantityDto);
List<Map> getmonthProductionSut(MesMonthReportVo mesMonthReportVo);
}

@ -12,6 +12,7 @@ import com.op.mes.domain.dto.LineChartSeriesDto;
import com.op.mes.domain.dto.SysFactoryDto;
import com.op.mes.domain.vo.DynamicColumnVo;
import com.op.mes.domain.vo.MesDailyReportVo;
import com.op.mes.domain.vo.MesMonthReportVo;
import com.op.system.api.domain.SysUser;
import com.op.system.api.domain.device.EquEquipmentDTO;
import com.op.system.api.domain.dto.MesPrepareDetailDTO;
@ -135,4 +136,6 @@ public interface IMesReportWorkService {
R preReportRow(MesReportWork mesReportWork);
List<MesDailyReportVo> getDailyReportNew(MesDailyReportVo mesDailyReportVo);
List<Map> getmonthProductionSut(MesMonthReportVo mesMonthReportVo);
}

@ -25,6 +25,7 @@ import com.op.mes.domain.dto.QuantityDto;
import com.op.mes.domain.dto.SysFactoryDto;
import com.op.mes.domain.vo.DynamicColumnVo;
import com.op.mes.domain.vo.MesDailyReportVo;
import com.op.mes.domain.vo.MesMonthReportVo;
import com.op.mes.service.IWCSInterfaceService;
import com.op.system.api.RemoteSapService;
import com.op.system.api.domain.SysUser;
@ -488,6 +489,7 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService {
return dtos;
}
@Override
@DS("#header.poolName")
public String getTitleName(MesDailyReport mesDailyReport) {
@ -835,16 +837,17 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService {
return dtos;
}
@Override
@DS("#header.poolName")
public List<Map> getmonthProductionSut(MesMonthReportVo mesMonthReportVo) {
List<Map> mapList=new ArrayList<>();
try {
mapList = mesReportWorkMapper.getmonthProductionSut(mesMonthReportVo);
public static void main(String[] args) {
Calendar calendar = Calendar.getInstance();
Date now = calendar.getTime();
calendar.set(Calendar.DAY_OF_MONTH, 1);
Date firstDayOfMonth = calendar.getTime();
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
String formattedDate = format.format(firstDayOfMonth);
System.out.println("当前日期: " + format.format(now));
System.out.println("当月的第一天: " + formattedDate);
}catch (Exception e){
e.printStackTrace();
}
return mapList;
}
}

@ -450,7 +450,7 @@
<select id="getMesLineInfo" resultType="com.op.mes.domain.MesLine">
select
mlp.use_man standarMan,
mlp.efficiency standarXl,
ROUND(mlp.efficiency/bp.umrez,2) AS standarXl,
mr.use_man actMan,
mr.work_time,
mr2.quantity_feedback,
@ -461,6 +461,7 @@
) mr
left join mes_report_work mr2 on mr2.report_code = mr.report_code and mr2.parent_order ='0'
left join mes_line_product mlp on mlp.line_code = mr.machine_code and mr2.product_code = mlp.product_code
left join base_product bp on bp.product_code=mlp.product_code
where mlp.line_code = #{equCode}
and mlp.del_flag='0' and mlp.del_flag='0'
</select>

@ -927,7 +927,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where ow.del_flag='0' and equ.del_flag='0'
</select>
<insert id="insertMesReportWork" parameterType="MesReportWork">
<select id="getmonthProductionSut" statementType="CALLABLE" resultType="java.util.Map" parameterType="MesMonthReportVo">
{CALL GeneratePivotReport(#{params.beginTime, jdbcType=DATE}, #{params.endTime, jdbcType=DATE})}
</select>
<insert id="insertMesReportWork" parameterType="MesReportWork">
insert into mes_report_work
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>

Loading…
Cancel
Save