日生产报表功能

highway
zhaoxiaolin 1 year ago
parent 63550d6dce
commit 139dc3fb4c

@ -1,13 +1,15 @@
package com.op.system.api.domain.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import java.util.List;
public class WCSDTO {
private String reqCode;
private Date reqTime;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private String reqTime;
private String planNo;
@ -136,11 +138,11 @@ public class WCSDTO {
this.reqCode = reqCode;
}
public Date getReqTime() {
public String getReqTime() {
return reqTime;
}
public void setReqTime(Date reqTime) {
public void setReqTime(String reqTime) {
this.reqTime = reqTime;
}

@ -17,12 +17,12 @@ spring:
# 服务注册地址
#--spring.cloud.nacos.discovery.namespace=chj --spring.cloud.nacos.config.namespace=chj
namespace: lanju-op
group: chj
group: zxl
server-addr: 140.249.53.142:8848
config:
#命名空间
namespace: lanju-op
group: chj
group: zxl
# 配置中心地址
server-addr: 140.249.53.142:8848
# 配置文件格式

@ -3,10 +3,14 @@ package com.op.mes.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.mes.domain.MesDailyReport;
import com.op.mes.domain.MesProcessReport;
import com.op.mes.domain.MesReportProduction;
import com.op.mes.domain.dto.SysFactoryDto;
import com.op.mes.mapper.MesReportWorkMapper;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -25,7 +29,7 @@ import com.op.common.core.web.controller.BaseController;
import com.op.common.core.web.domain.AjaxResult;
import com.op.common.core.utils.poi.ExcelUtil;
import com.op.common.core.web.page.TableDataInfo;
import com.op.common.core.utils.poi.ExcelUtilDailyReport;
/**
* Controller
*
@ -37,7 +41,8 @@ import com.op.common.core.web.page.TableDataInfo;
public class MesReportWorkController extends BaseController {
@Autowired
private IMesReportWorkService mesReportWorkService;
@Autowired
private MesReportWorkMapper mesReportWorkMapper;
/**
*
*/
@ -140,7 +145,7 @@ public class MesReportWorkController extends BaseController {
*
*/
@RequiresPermissions("mes:production:list")
@GetMapping("/productionExport")
@PostMapping("/productionExport")
public void productionExport(HttpServletResponse response, MesReportProduction mesReportProduction) {
List<MesReportProduction> list = mesReportWorkService.getProductionList(mesReportProduction);
ExcelUtil<MesReportProduction> util = new ExcelUtil<MesReportProduction>(MesReportProduction.class);
@ -153,10 +158,29 @@ public class MesReportWorkController extends BaseController {
@RequiresPermissions("mes:dailyReport:list")
@GetMapping("/getDailyReport")
public TableDataInfo getDailyReport(MesDailyReport mesDailyReport) {
if(!StringUtils.isNotBlank(mesDailyReport.getWorkCenter())){
return null;
}
startPage();
List<MesDailyReport> list = mesReportWorkService.getDailyReport(mesDailyReport);
return getDataTable(list);
}
@RequiresPermissions("mes:dailyReport:list")
@PostMapping("/getDailyReportExport")
public void getDailyReportExport(HttpServletResponse response,MesDailyReport mesDailyReport) {
List<MesDailyReport> list = mesReportWorkService.getDailyReport(mesDailyReport);
String ymd = DateUtils.parseDateToStr("yyyy-MM-dd",mesDailyReport.getProductDate());
String titleName = "("+mesReportWorkService.getTitleName(mesDailyReport)+")车间"+ymd+"生产日报表";
ExcelUtilDailyReport<MesDailyReport> util = new ExcelUtilDailyReport<MesDailyReport>(MesDailyReport.class);
util.exportExcel(response, list, ymd+"生产日报表",titleName);
}
@GetMapping("/getWorkcenterList")
public List<SysFactoryDto> getWorkcenterList(MesDailyReport mesDailyReport) {
return mesReportWorkService.getWorkcenterList(mesDailyReport);
}
}

@ -23,86 +23,7 @@ public class WCSInterfaceController extends BaseController {
@Autowired
private IWCSInterfaceService WCInterfaceService;
// /**
// * 接料请求
// * @param
// * @return
// */
// @Log(title = "请求接料", businessType = BusinessType.WCS_requestMaterialLoadNo)
// @PostMapping("/requestMaterialLoadNo")
// public WCSDTO requestMaterialLoadNo(@RequestBody WCSDTO wcsdto) {
// if(StringUtils.isBlank(wcsdto.getFactory())){
// wcsdto.setCode("1");
// wcsdto.setMessage("factory is not null");
// return wcsdto;
// }
// return WCInterfaceService.requestMaterialLoadNo(wcsdto);
// }
//
// /**
// * 接料完成(用不上)
// * @param
// * @return
// */
// @Log(title = "接料完成", businessType = BusinessType.WCS)
// @PostMapping("/loadMaterialCompleted")
// public WCSDTO loadMaterialCompleted(@RequestBody WCSDTO wcsdto) {
// if(StringUtils.isBlank(wcsdto.getFactory())){
// wcsdto.setCode("1");
// wcsdto.setMessage("factory is not null");
// return wcsdto;
// }
// return WCInterfaceService.loadMaterialCompleted(wcsdto);
// }
//
// /**
// * RGV 请求送料
// * @param
// * @return
// */
// //TODO;
// @Log(title = "请求送料", businessType = BusinessType.WCS)
// @PostMapping("/requestMaterialUnLoadNo")
// public WCSDTO requestMaterialUnLoadNo(@RequestBody WCSDTO wcsdto) {
// if(StringUtils.isBlank(wcsdto.getFactory())){
// wcsdto.setCode("1");
// wcsdto.setMessage("factory is not null");
// return wcsdto;
// }
// return WCInterfaceService.requestMaterialUnLoadNo(wcsdto);
// }
// /**
// * RGV 送料完成
// * @param
// * @return
// */
// //TODO;
// @Log(title = "送料完成", businessType = BusinessType.WCS)
// @PostMapping("/unLoadMaterialCompleted")
// public WCSDTO unLoadMaterialCompleted(@RequestBody WCSDTO wcsdto) {
// if(StringUtils.isBlank(wcsdto.getFactory())){
// wcsdto.setCode("1");
// wcsdto.setMessage("factory is not null");
// return wcsdto;
// }
// return WCInterfaceService.requestMaterialUnLoadNo(wcsdto);
// }
// /**
// * 生产机台到位信号
// * •空筛盘车到达成型机吊筛处,筛盘车到达烘房、筛盘车到达收坯吊筛处
// * @param
// * @return
// */
// @Log(title = "生产机台到位信号", businessType = BusinessType.WCS)
// @PostMapping("/stationArrive")
// public WCSDTO stationArrive(@RequestBody WCSDTO wcsdto) {
// if(StringUtils.isBlank(wcsdto.getFactory())){
// wcsdto.setCode("1");
// wcsdto.setMessage("factory is not null");
// return wcsdto;
// }
// return WCInterfaceService.stationArrive(wcsdto);
// }
/**
*
* WCS MES
@ -121,15 +42,4 @@ public class WCSInterfaceController extends BaseController {
return WCInterfaceService.requestDestinationStations(wcsdto);
}
/**********************手持接口**********************/
@Log(title = "手持获取当前登陆人信息", businessType = BusinessType.GRANT)
@PostMapping("/handGetUserInfo")
public WCSDTO handGetUserInfo(@RequestBody WCSDTO wcsdto) {
if(StringUtils.isBlank(wcsdto.getFactory())){
wcsdto.setCode("1");
wcsdto.setMessage("factory is not null");
return wcsdto;
}
return WCInterfaceService.requestDestinationStations(wcsdto);
}
}

@ -0,0 +1,126 @@
package com.op.mes.domain.dto;
import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.TreeEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* sys_factory
*
* @author Open Platform
* @date 2023-07-03
*/
public class SysFactoryDto extends TreeEntity {
private static final long serialVersionUID = 1L;
/** 工厂id */
private Long factoryId;
/** 部门名称 */
@Excel(name = "工厂名称")
private String factoryName;
/** 负责人 */
@Excel(name = "负责人")
private String leader;
/** 联系电话 */
@Excel(name = "联系电话")
private String phone;
/** 邮箱 */
@Excel(name = "邮箱")
private String email;
/** 部门状态0正常 */
@Excel(name = "工厂状态")
private String status;
/** 删除标志0代表存在 */
private String delFlag;
/** 工厂编码 */
@Excel(name = "工厂编码")
private String factoryCode;
public void setFactoryId(Long factoryId) {
this.factoryId = factoryId;
}
public Long getFactoryId() {
return factoryId;
}
public void setFactoryName(String factoryName) {
this.factoryName = factoryName;
}
public String getFactoryName() {
return factoryName;
}
public void setLeader(String leader) {
this.leader = leader;
}
public String getLeader() {
return leader;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getPhone() {
return phone;
}
public void setEmail(String email) {
this.email = email;
}
public String getEmail() {
return email;
}
public void setStatus(String status) {
this.status = status;
}
public String getStatus() {
return status;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
public String getDelFlag() {
return delFlag;
}
public String getFactoryCode() {
return factoryCode;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("factoryId", getFactoryId())
.append("parentId", getParentId())
.append("ancestors", getAncestors())
.append("factoryName", getFactoryName())
.append("orderNum", getOrderNum())
.append("leader", getLeader())
.append("phone", getPhone())
.append("email", getEmail())
.append("status", getStatus())
.append("delFlag", getDelFlag())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("factoryCode", getFactoryCode())
.toString();
}
}

@ -6,6 +6,7 @@ import com.op.mes.domain.MesDailyReport;
import com.op.mes.domain.MesProcessReport;
import com.op.mes.domain.MesReportProduction;
import com.op.mes.domain.MesReportWork;
import com.op.mes.domain.dto.SysFactoryDto;
/**
* Mapper
@ -71,4 +72,8 @@ public interface MesReportWorkMapper {
public void updateSyncSapStatus(MesReportWork work);
public List<MesDailyReport> getDailyReport(MesDailyReport mesDailyReport);
String getTitleName(MesDailyReport mesDailyReport);
List<SysFactoryDto> getWorkcenterList(MesDailyReport mesDailyReport);
}

@ -6,6 +6,7 @@ import com.op.mes.domain.MesDailyReport;
import com.op.mes.domain.MesProcessReport;
import com.op.mes.domain.MesReportProduction;
import com.op.mes.domain.MesReportWork;
import com.op.mes.domain.dto.SysFactoryDto;
/**
* Service
@ -67,4 +68,8 @@ public interface IMesReportWorkService {
public List<MesReportProduction> getProductionList(MesReportProduction mesReportProduction);
public List<MesDailyReport> getDailyReport(MesDailyReport mesDailyReport);
String getTitleName(MesDailyReport mesDailyReport);
List<SysFactoryDto> getWorkcenterList(MesDailyReport mesDailyReport);
}

@ -116,9 +116,10 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
wCSDataDTO = new WCSDataDTO();
if(StringUtils.isNotBlank(machineCode)){
wCSDataDTO.setStationNo(machineCode);
stationNos.add(wCSDataDTO);
}
}
dto.setStationNos(stationNos);
}
return dto;

@ -9,6 +9,7 @@ import com.op.common.core.utils.DateUtils;
import com.op.mes.domain.MesDailyReport;
import com.op.mes.domain.MesProcessReport;
import com.op.mes.domain.MesReportProduction;
import com.op.mes.domain.dto.SysFactoryDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.mes.mapper.MesReportWorkMapper;
@ -213,4 +214,16 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService {
return dtos;
}
@Override
@DS("#header.poolName")
public String getTitleName(MesDailyReport mesDailyReport) {
return mesReportWorkMapper.getTitleName(mesDailyReport);
}
@Override
@DS("#header.poolName")
public List<SysFactoryDto> getWorkcenterList(MesDailyReport mesDailyReport) {
return mesReportWorkMapper.getWorkcenterList(mesDailyReport);
}
}

@ -201,6 +201,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and mrw.work_center = #{workCenter}
order by ow.workorder_code
</select>
<select id="getTitleName" resultType="java.lang.String">
select factory_name from sys_factory where factory_code = #{workCenter}
</select>
<select id="getWorkcenterList" resultType="com.op.mes.domain.dto.SysFactoryDto">
select factory_name factoryName,
factory_code factoryCode
from sys_factory where f_type = 'c'
</select>
<insert id="insertMesReportWork" parameterType="MesReportWork">
insert into mes_report_work

@ -77,6 +77,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join pro_order_workorder w on w.workorder_code = rfid.workorder_code
left join base_product bp on bp.product_code = w.product_code
where rfid.bind_status = '1'
and rfid.rfid = #{rfidNo}
</select>
<select id="getStationType" resultType="java.lang.String">
select

@ -1,4 +1,4 @@
package com.op.quality.controller;
package com.op.quality.Controller;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import com.op.common.core.domain.R;
@ -13,6 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
* @ClassName : quaController

@ -9,6 +9,8 @@ import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse;
import com.op.system.domain.SysMenu;
import com.op.system.mapper.SysMenuMapper;
import org.apache.commons.lang3.ArrayUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
@ -74,7 +76,8 @@ public class SysUserController extends BaseController {
private ISysConfigService configService;
@Autowired
private RedisService redisService;
@Autowired
private SysMenuMapper menuMapper;
/**
*
*/
@ -196,6 +199,8 @@ public class SysUserController extends BaseController {
ajax.put("roles", roles);
ajax.put("permissions", permissions);
ajax.put("poolNameList", poolNameList);
List<SysMenu> menus = menuMapper.selectMenuTreeByUserName(sysUser.getUserName());
ajax.put("menuList",menus);
return ajax;
}

@ -6,13 +6,13 @@ import com.op.system.domain.SysMenu;
/**
*
*
*
* @author OP
*/
public interface SysMenuMapper {
/**
*
*
*
* @param menu
* @return
*/
@ -20,14 +20,14 @@ public interface SysMenuMapper {
/**
*
*
*
* @return
*/
public List<String> selectMenuPerms();
/**
*
*
*
* @param menu
* @return
*/
@ -35,7 +35,7 @@ public interface SysMenuMapper {
/**
* ID
*
*
* @param roleId ID
* @return
*/
@ -43,7 +43,7 @@ public interface SysMenuMapper {
/**
* ID
*
*
* @param userId ID
* @return
*/
@ -51,14 +51,14 @@ public interface SysMenuMapper {
/**
* ID
*
*
* @return
*/
public List<SysMenu> selectMenuTreeAll();
/**
* ID
*
*
* @param userId ID
* @return
*/
@ -66,7 +66,7 @@ public interface SysMenuMapper {
/**
* ID
*
*
* @param roleId ID
* @param menuCheckStrictly
* @return
@ -76,7 +76,7 @@ public interface SysMenuMapper {
/**
* ID
*
*
* @param menuId ID
* @return
*/
@ -84,7 +84,7 @@ public interface SysMenuMapper {
/**
*
*
*
* @param menuId ID
* @return
*/
@ -92,7 +92,7 @@ public interface SysMenuMapper {
/**
*
*
*
* @param menu
* @return
*/
@ -100,7 +100,7 @@ public interface SysMenuMapper {
/**
*
*
*
* @param menu
* @return
*/
@ -108,7 +108,7 @@ public interface SysMenuMapper {
/**
*
*
*
* @param menuId ID
* @return
*/
@ -116,10 +116,12 @@ public interface SysMenuMapper {
/**
*
*
*
* @param menuName
* @param parentId ID
* @return
*/
public SysMenu checkMenuNameUnique(@Param("menuName") String menuName, @Param("parentId") Long parentId);
public List<SysMenu> selectMenuTreeByUserName(String userName);
}

@ -134,6 +134,16 @@
from sys_menu
where menu_name=#{menuName} and parent_id = #{parentId}
</select>
<select id="selectMenuTreeByUserName" resultMap="SysMenuResult">
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.query, m.visible, m.status, isnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
from sys_menu m
left join sys_role_menu rm on m.menu_id = rm.menu_id
left join sys_user_role ur on rm.role_id = ur.role_id
left join sys_role ro on ur.role_id = ro.role_id
left join sys_user u on ur.user_id = u.user_id
where u.user_name = #{userName} and m.menu_type in ('S') and m.status = 0 AND ro.status = 0
order by m.parent_id, m.order_num
</select>
<update id="updateMenu" parameterType="SysMenu">
update sys_menu

Loading…
Cancel
Save