Merge remote-tracking branch 'origin/master'

master
zpl 4 years ago
commit 90d507d83b

@ -69,6 +69,7 @@
<result column="ROUTER" property="router"/>
<result column="BOM" property="bom"/>
<result column="REASON" property="reason"/>
<result column="TYPE" property="type"/>
</resultMap>
<!-- 通用查询结果列 -->
@ -992,7 +993,8 @@
CASE WHEN B.BOM != 'NULL' THEN B.BOM || '/' || B.REVISION END BOM,
CASE WHEN ZSS.HANDLE != 'NULL' THEN ZSS.REASON
ELSE ZABV.PB_DESCRIPTION
END REASON
END REASON,
ZSS.TYPE TYPE
FROM SFC S
INNER JOIN SFC_ROUTING SR ON SR.SFC_BO = S.HANDLE
INNER JOIN SFC_ROUTER ST ON ST.SFC_ROUTING_BO = SR.HANDLE
@ -1004,7 +1006,11 @@
LEFT JOIN ROUTER R ON R.HANDLE = ZSD.ROUTER_BO
LEFT JOIN Z_SFC_SCRAP ZSS ON ZSS.SFC = S.SFC AND ZSS.SITE = S.SITE
LEFT JOIN BOM B ON B.HANDLE = SO.PLANNED_BOM_BO
INNER JOIN ( SELECT * FROM Z_ABNORMAL_BILL_VIEW ZABV WHERE ZABV.HANDLE = (SELECT MAX(HANDLE) FROM Z_ABNORMAL_BILL_VIEW) ) ZABV ON ZABV.SFC = S.SFC AND ZABV.SITE= S.SITE
INNER JOIN ( SELECT * FROM Z_ABNORMAL_BILL_VIEW ZABV WHERE ZABV.HANDLE = (SELECT MAX(HANDLE) FROM Z_ABNORMAL_BILL_VIEW ZABV2
<where>
ZABV2.SFC = #{sfc}
</where>
)) ZABV ON ZABV.SFC = S.SFC AND ZABV.SITE= S.SITE
<where>
S.SITE = #{site} AND S.SFC = #{sfc}
</where>
@ -1014,6 +1020,6 @@
SELECT * FROM Z_ABNORMAL_BILL zab
JOIN sfc s ON zab.SITE=s.SITE AND zab.SFC=s.SFC
JOIN Z_ABNORMAL_BILL_DISPOSE ZABD ON ZABD.ABNORMAL_BILL_BO= ZAB.HANDLE
WHERE zab.SITE=#{site} AND zab.STATUS='G' AND zab."TYPE"='Z' AND s.QTY>1 AND (ZABD.ABNORMAL_METHOD='F' OR ZABD.ABNORMAL_METHOD='C') AND ZABD.ROUTER_BO IS NOT NULL ORDER BY ZABD.CLOSED_DATE_TIME DESC
WHERE zab.SITE=#{site} AND zab.STATUS='G' AND zab."TYPE"='Z' AND s.QTY>1 AND (ZABD.ABNORMAL_METHOD='F' OR ZABD.ABNORMAL_METHOD='C') ORDER BY ZABD.CLOSED_DATE_TIME DESC
</select>
</mapper>

@ -0,0 +1,93 @@
package com.foreverwin.mesnac.common.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.foreverwin.mesnac.common.enums.HandleEnum;
import com.foreverwin.mesnac.common.model.Printer;
import com.foreverwin.modular.core.util.CommonMethods;
import com.foreverwin.modular.core.util.R;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.foreverwin.mesnac.common.service.PrinterService;
import java.time.LocalDateTime;
import java.util.List;
/**
*
* @author Leon.L
* @since 2021-08-11
*/
@RestController
@RequestMapping("/PRINTER")
public class PrinterController {
@Autowired
public PrinterService printerService;
/**
*
*
* @return
*/
@ResponseBody
@GetMapping("")
public R getPrinterList(Printer printer){
List<Printer> result;
try {
String site = CommonMethods.getSite();
printer.setSite(site);
QueryWrapper<Printer> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(printer);
result = printerService.list(queryWrapper);
} catch (Exception e) {
return R.failed(e.getMessage());
}
return R.ok(result);
}
@ResponseBody
@GetMapping("/getPrinter")
public R savePrinter(String printer) {
Printer result = null;
try {
String site = CommonMethods.getSite();
String handle = HandleEnum.PRINT.getHandle(site, printer);
result = printerService.getById(handle);
} catch (Exception e) {
return R.failed(e.getMessage());
}
return R.ok(result);
}
@ResponseBody
@PostMapping("/savePrinter")
public R savePrinter(Printer printer) {
try {
LocalDateTime nowDate = LocalDateTime.now();
String site = CommonMethods.getSite();
String handle = HandleEnum.PRINT.getHandle(site, printer.getPrinter());
Printer printerModel = printerService.getById(handle);
if (printerModel == null) {
printer.setHandle(handle);
printer.setSite(site);
printer.setCreatedDateTime(nowDate);
printer.setModifiedDateTime(nowDate);
printerService.save(printer);
} else {
printerModel.setDescription(printer.getDescription());
printerModel.setModifiedDateTime(nowDate);
printerService.updateById(printerModel);
}
} catch (Exception e) {
return R.failed(e.getMessage());
}
return R.ok();
}
}

@ -24,6 +24,8 @@ public class ScrapDto {
private String reason;
private String type;
public String getSfc() {
return sfc;
}
@ -95,4 +97,12 @@ public class ScrapDto {
public void setReason(String reason) {
this.reason = reason;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
}

@ -20,6 +20,8 @@ public enum HandleEnum {
/**物料清单**/
BOM("BOMBO:","BOMBO:{0},{1},{2},{3}"),
PRINT("PrintBO:", "StatusBO:{0},{1}"),
/**叫料**/
CALL_ITEM("CallItemBO:", "CallItemBO:{0},{1}"),

@ -1,6 +1,6 @@
package com.foreverwin.mesnac.meapi.mapper;
package com.foreverwin.mesnac.common.mapper;
import com.foreverwin.mesnac.meapi.model.Printer;
import com.foreverwin.mesnac.common.model.Printer;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
@ -10,7 +10,7 @@ import org.springframework.stereotype.Repository;
* </p>
*
* @author Leon.L
* @since 2021-07-22
* @since 2021-08-11
*/
@Repository
public interface PrinterMapper extends BaseMapper<Printer> {

@ -1,7 +1,8 @@
package com.foreverwin.mesnac.meapi.model;
package com.foreverwin.mesnac.common.model;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.time.LocalDateTime;
@ -15,15 +16,15 @@ import com.baomidou.mybatisplus.annotation.IdType;
* </p>
*
* @author Leon.L
* @since 2021-07-22
* @since 2021-08-11
*/
@TableName("PRINTER")
@TableName("Z_PRINTER")
public class Printer extends Model<Printer> {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
@TableField("HANDLE")
@TableId(value = "HANDLE", type = IdType.INPUT)
private String handle;
@TableField("SITE")
private String site;

@ -1,7 +1,7 @@
package com.foreverwin.mesnac.meapi.service;
package com.foreverwin.mesnac.common.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.meapi.model.Printer;
import com.foreverwin.mesnac.common.model.Printer;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.modular.core.util.FrontPage;
@ -13,7 +13,7 @@ import java.util.List;
* </p>
*
* @author Leon.L
* @since 2021-07-22
* @since 2021-08-11
*/
public interface PrinterService extends IService<Printer> {

@ -11,6 +11,7 @@ import java.util.List;
* @Since 2021-08-10
*/
public interface UserService {
List<UsrDto> findList(String user);
IPage findPage(IPage page,String user);

@ -1,11 +1,11 @@
package com.foreverwin.mesnac.meapi.service.impl;
package com.foreverwin.mesnac.common.service.impl;
import com.foreverwin.modular.core.util.FrontPage;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.meapi.model.Printer;
import com.foreverwin.mesnac.meapi.mapper.PrinterMapper;
import com.foreverwin.mesnac.meapi.service.PrinterService;
import com.foreverwin.mesnac.common.model.Printer;
import com.foreverwin.mesnac.common.mapper.PrinterMapper;
import com.foreverwin.mesnac.common.service.PrinterService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
@ -18,7 +18,7 @@ import java.util.List;
* </p>
*
* @author Leon.L
* @since 2021-07-22
* @since 2021-08-11
*/
@Service
@Transactional(rollbackFor = Exception.class)

@ -523,12 +523,12 @@ public class ProdReadyTaskServiceImpl extends ServiceImpl<ProdReadyTaskMapper, P
//根据车间找到对应车间的描述
WorkCenter workCenter = workCenterMapper.findWorkCenterDescriptionByWorkCenter(site, prodReadyTask.getWorkCenter(), locale);
//根据资源找到对应的产线的描述
Resrce byResrce = resrceService.findByResrce(prodReadyTask.getResrce());
Resrce byResrce = resrceService.getById(HandleEnum.RESOURCE.getHandle(site,prodReadyTask.getResrce()));
Item selectCurrent = itemService.selectCurrent(site, prodReadyTask.getItem());
//项目号
String item = selectCurrent.getItem() + "/" + selectCurrent.getDescription();
messageMap.put("WORKCENTER", workCenter.getDescription());
messageMap.put("RESOURCE", byResrce + "/" + byResrce.getDescription());
messageMap.put("RESOURCE", byResrce.getResrce() + "/" + byResrce.getDescription());
messageMap.put("ITEM", item);
messageMap.put("SHOPORDER", prodReadyTask.getShopOrder());
messageMap.put("SFC", prodReadyTask.getSfc());

@ -316,6 +316,15 @@ public class NumberUtil
}
return false;
}
public static boolean isDouble(String str)
{
if (!StringUtil.toString(str).equals(""))
{
return str.matches("^[0-9]+(.?[0-9]+)?$");
}
return false;
}
public static String toPlainString(Object number)
{
@ -410,8 +419,7 @@ public class NumberUtil
return matcher.matches();
}
public static void main(String[] args)
{
public static void main(String[] args) {
}
}

@ -1,9 +1,9 @@
<?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.foreverwin.mesnac.meapi.mapper.PrinterMapper">
<mapper namespace="com.foreverwin.mesnac.common.mapper.PrinterMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.meapi.model.Printer">
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.common.model.Printer">
<result column="HANDLE" property="handle" />
<result column="SITE" property="site" />
<result column="PRINTER" property="printer" />
@ -22,7 +22,7 @@
<select id="selectByMap" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
FROM PRINTER
FROM Z_PRINTER
<if test="cm!=null and !cm.isEmpty">
<where>
<foreach collection="cm.keys" item="k" separator="AND">
@ -36,7 +36,7 @@
<select id="selectOne" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM PRINTER
SELECT <include refid="Base_Column_List"></include> FROM Z_PRINTER
<where>
<if test="ew.entity.handle!=null">
HANDLE=#{ew.handle}
@ -51,7 +51,7 @@
</select>
<select id="selectCount" resultType="Integer">
SELECT COUNT(1) FROM PRINTER
SELECT COUNT(1) FROM Z_PRINTER
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
@ -76,7 +76,7 @@
</select>
<select id="selectList" resultMap="BaseResultMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM PRINTER
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_PRINTER
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
@ -101,7 +101,7 @@
</select>
<select id="selectMaps" resultType="HashMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM PRINTER
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_PRINTER
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
@ -126,7 +126,7 @@
</select>
<select id="selectObjs" resultType="Object">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM PRINTER
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_PRINTER
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
@ -151,7 +151,7 @@
</select>
<select id="selectPage" resultMap="BaseResultMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM PRINTER
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_PRINTER
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
@ -176,7 +176,7 @@
</select>
<select id="selectMapsPage" resultType="HashMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM PRINTER
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_PRINTER
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
@ -200,8 +200,8 @@
</if>
</select>
<insert id="insert" parameterType="com.foreverwin.mesnac.meapi.model.Printer">
INSERT INTO PRINTER
<insert id="insert" parameterType="com.foreverwin.mesnac.common.model.Printer">
INSERT INTO Z_PRINTER
<trim prefix="(" suffix=")" suffixOverrides=",">
HANDLE,
<if test="site!=null">SITE,</if>
@ -222,8 +222,8 @@
</trim>
</insert>
<insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.meapi.model.Printer">
INSERT INTO PRINTER
<insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.common.model.Printer">
INSERT INTO Z_PRINTER
<trim prefix="(" suffix=")" suffixOverrides=",">
<include refid="Base_Column_List"></include>
</trim> VALUES
@ -244,7 +244,7 @@
<update id="update">
UPDATE PRINTER <trim prefix="SET" suffixOverrides=",">
UPDATE Z_PRINTER <trim prefix="SET" suffixOverrides=",">
<if test="et.handle!=null">HANDLE=#{et.handle},</if>
<if test="et.site!=null">SITE=#{et.site},</if>
<if test="et.printer!=null">PRINTER=#{et.printer},</if>
@ -276,7 +276,7 @@
<delete id="deleteByMap">
DELETE FROM PRINTER
DELETE FROM Z_PRINTER
<if test="cm!=null and !cm.isEmpty">
<where>
<foreach collection="cm.keys" item="k" separator="AND">
@ -289,7 +289,7 @@
</delete>
<delete id="delete">
DELETE FROM PRINTER
DELETE FROM Z_PRINTER
<where>
<if test="ew!=null">
<if test="ew.entity!=null">

@ -100,6 +100,7 @@ public class CallItemServiceImpl extends ServiceImpl<CallItemMapper, CallItem> i
callItem.setHandle(HandleEnum.CALL_ITEM.getHandle(site, callItemNo));
callItem.setCallType(Constants.CALL_TYPE_MATERIAL);
callItem.setStatus(Constants.CALL_ITEM_STATUS_NEW);
callItem.setIssueQty(BigDecimal.ZERO);
callItem.setCreateUser(user);
callItem.setCreatedDateTime(nowDate);
callItem.setModifyUser(user);
@ -329,7 +330,7 @@ public class CallItemServiceImpl extends ServiceImpl<CallItemMapper, CallItem> i
}
if ("GB".equals(itemGroup) && blankingSize.contains("*")) {
String []size = blankingSize.split("/*");
String []size = blankingSize.split("\\*");
if (size != null && size.length >= 2) {
int sizeLength = size.length;
BigDecimal length = new BigDecimal(size[sizeLength-1]);
@ -341,7 +342,7 @@ public class CallItemServiceImpl extends ServiceImpl<CallItemMapper, CallItem> i
compQtyMap.put(component, (compQtyMap.get(component) != null ? compQtyMap.get(component).add(sizeReqQty) : sizeReqQty));
}
} else {
String []size = blankingSize.split("/*");
String []size = blankingSize.split("\\*");
if (size != null && size.length >= 1) {
int sizeLength = size.length;
BigDecimal length = new BigDecimal(size[sizeLength-1]);

@ -85,10 +85,10 @@ public class SurplusReturnServiceImpl extends ServiceImpl<SurplusReturnMapper, S
if (StringUtil.isBlank(perMater) && StringUtil.isBlank(perSquareMeter)) {
throw BusinessException.build("物料【" +item+ "】的自定义字段【每米重量】和【每平米重量】都没维护!");
}
if (StringUtil.notBlank(perMater) && !NumberUtil.isNumber(perMater)) {
if (StringUtil.notBlank(perMater) && !NumberUtil.isDouble(perMater)) {
throw BusinessException.build("物料【" +item+ "】的自定义字段【每米重量】只能维护数值!");
}
if (StringUtil.notBlank(perSquareMeter) && !NumberUtil.isNumber(perSquareMeter)) {
if (StringUtil.notBlank(perSquareMeter) && !NumberUtil.isDouble(perSquareMeter)) {
throw BusinessException.build("物料【" +item+ "】的自定义字段【每平米重量】只能维护数值!");
}

@ -1,9 +1,9 @@
package com.foreverwin.mesnac.dispatch.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.foreverwin.mesnac.common.dto.UsrDto;
import com.foreverwin.mesnac.common.enums.HandleEnum;
import com.foreverwin.mesnac.common.service.UserService;
import com.foreverwin.mesnac.dispatch.dto.UserResourceDto;
import com.foreverwin.mesnac.dispatch.mapper.UserResourceMapper;
import com.foreverwin.mesnac.dispatch.model.UserResource;
@ -13,7 +13,6 @@ import com.foreverwin.mesnac.meapi.service.NwaUserService;
import com.foreverwin.mesnac.meapi.service.ResrceService;
import com.foreverwin.modular.core.exception.BusinessException;
import com.foreverwin.modular.core.util.CommonMethods;
import com.foreverwin.modular.core.util.FrontPage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -45,6 +44,10 @@ public class UserResourceServiceImpl extends ServiceImpl<UserResourceMapper, Use
@Autowired
private NwaUserService nwaUserService;
@Autowired
private UserService userService;
@Override
public List<NwaUser> findEmployeeList(String site) {
return userResourceMapper.findEmployeeList(site);
@ -62,7 +65,9 @@ public class UserResourceServiceImpl extends ServiceImpl<UserResourceMapper, Use
String userId = userResourceDto.getUserId();
HashMap<String, Object> hashMap = new HashMap<>();;
List<NwaUser> nwaUserList = nwaUserService.selectList(null);
// List<NwaUser> nwaUserList = nwaUserService.selectList(null);
List<UsrDto> nwaUserList = userService.findList(null);
List<UserResourceDto> userResourceList = userResourceMapper.findAll(site, resource, userId);
hashMap.put("users",nwaUserList);
hashMap.put("userResources",userResourceList);
@ -88,14 +93,15 @@ public class UserResourceServiceImpl extends ServiceImpl<UserResourceMapper, Use
userResource.setUserId(userResourceDto.getUserId());
userResource.setTemporaryUser(userResourceDto.getTemporaryUser());
userResource.setUserDescription(userResourceDto.getUserDescription());
NwaUser userByUserName = nwaUserService.findUserByUserName(userResource.getUserId());
//NwaUser userByUserName = nwaUserService.findUserByUserName(userResource.getUserId());
List<UsrDto> userByUserName = userService.findList(userResource.getUserId());
if("false".equals(userResource.getTemporaryUser()) &&
userByUserName == null){
userByUserName.size() <= 0){
throw BusinessException.build("第"+(i+1)+"行的用户不存在,必须为临时用户");
}else if(userByUserName != null){
}else if(userByUserName != null && userByUserName.size() > 0){
//userByUserName.setFullName(userResource.getUserDescription());
userResource.setUserDescription(userByUserName.getFullName());
nwaUserService.saveOrUpdate(userByUserName);
userResource.setUserDescription(userByUserName.get(0).getFullName());
//nwaUserService.saveOrUpdate(userByUserName);
}
userResource.setStatus(userResourceDto.getStatus());
userResource.setHandle("UserResourceBo:"+userResource.getSite()+","+

@ -34,12 +34,10 @@
<groupId>com.foreverwin.mesnac</groupId>
<artifactId>meapi</artifactId>
</dependency>
<dependency>
<groupId>com.foreverwin.mesnac</groupId>
<artifactId>common</artifactId>
</dependency>
<dependency>
<groupId>com.foreverwin.mesnac</groupId>
<artifactId>dispatch</artifactId>

@ -2,7 +2,6 @@ package com.foreverwin.mesnac.listener.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.mesnac.common.service.UserService;
import com.foreverwin.mesnac.listener.model.SysUser;
import com.foreverwin.mesnac.listener.model.Usr;
import com.foreverwin.modular.core.util.FrontPage;
@ -17,7 +16,7 @@ import java.util.List;
* @author sungang
* @since 2020-10-16
*/
public interface UsrService extends IService<Usr>, UserService {
public interface UsrService extends IService<Usr> {
/**
*

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.foreverwin.mesnac.common.dto.UsrDto;
import com.foreverwin.mesnac.common.service.UserService;
import com.foreverwin.mesnac.listener.mapper.UsrMapper;
import com.foreverwin.mesnac.listener.model.SysUser;
import com.foreverwin.mesnac.listener.model.Usr;
@ -26,7 +27,7 @@ import java.util.List;
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class UsrServiceImpl extends ServiceImpl<UsrMapper, Usr> implements UsrService {
public class UsrServiceImpl extends ServiceImpl<UsrMapper, Usr> implements UsrService,UserService {
@Autowired

@ -616,7 +616,12 @@
SELECT U.USER_ID USER_NAME,ZNU.FULL_NAME FULL_NAME
FROM USR U
INNER JOIN Z_NWA_USER ZNU ON ZNU.USER_NAME = U.USER_ID
WHERE U.SITE=#{site} AND U.USER_ID = #{user}
WHERE U.SITE=#{site}
<if test="user != null and user != ''">
AND (
U.USER_ID = #{user}
)
</if>
</select>
<select id="findPage" resultMap="usrDto">
@ -626,8 +631,8 @@
WHERE U.SITE=#{site}
<if test="user != null and user != ''">
AND (
U.USER_ID LIKE '%${user}%'
OR ZNU.FULL_NAME LIKE '%${user}%'
U.USER_ID LIKE UPPER('%${user}%')
OR ZNU.FULL_NAME LIKE UPPER('%${user}%')
)
</if>
</select>

@ -1,130 +0,0 @@
package com.foreverwin.mesnac.meapi.controller;
import com.foreverwin.modular.core.util.R;
import com.foreverwin.modular.core.util.FrontPage;
import com.foreverwin.modular.core.util.CommonMethods;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.foreverwin.mesnac.meapi.service.PrinterService;
import com.foreverwin.mesnac.meapi.model.Printer;
import java.util.List;
/**
*
* @author Leon.L
* @since 2021-07-22
*/
@RestController
@RequestMapping("/PRINTER")
public class PrinterController {
@Autowired
public PrinterService printerService;
/**
* id
*
* @param id
* @return
*/
@ResponseBody
@GetMapping("/{id:.+}")
public R getPrinterById(@PathVariable String id) {
return R.ok( printerService.getById(id));
}
/**
*
*
* @return
*/
@ResponseBody
@GetMapping("")
public R getPrinterList(Printer printer){
List<Printer> result;
try {
String site = CommonMethods.getSite();
printer.setSite(site);
QueryWrapper<Printer> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(printer);
result = printerService.list(queryWrapper);
} catch (Exception e) {
return R.failed(e.getMessage());
}
return R.ok(result);
}
/**
*
*
* @param frontPage
* @return
*/
@ResponseBody
@GetMapping("/page")
public R page(FrontPage<Printer> frontPage, Printer printer){
IPage result;
QueryWrapper<Printer> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(printer);
if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) {
//TODO modify global query
queryWrapper.lambda().and(wrapper -> wrapper
.like(Printer::getHandle, frontPage.getGlobalQuery())
.or().like(Printer::getSite, frontPage.getGlobalQuery())
.or().like(Printer::getPrinter, frontPage.getGlobalQuery())
.or().like(Printer::getDescription, frontPage.getGlobalQuery())
.or().like(Printer::getEnabled, frontPage.getGlobalQuery())
);
}
result = printerService.page(frontPage.getPagePlus(), queryWrapper);
return R.ok(result);
}
/**
*
* @param printer
* @return null
*/
@PostMapping
public R save(@RequestBody Printer printer) {
return R.ok(printerService.save(printer));
}
/**
*
* @param printer
* @return null
*/
@PutMapping
public R updateById(@RequestBody Printer printer) {
return R.ok(printerService.updateById(printer));
}
/**
* id
* @param id ID
* @return 0 1
*/
@ResponseBody
@RequestMapping(method = RequestMethod.DELETE, value = "/{id:.+}")
public R removeById(@PathVariable("id") String id){
return R.ok(printerService.removeById(id));
}
/**
*
* @param ids ID
* @return 0 1
*/
@ResponseBody
@RequestMapping(method = RequestMethod.POST, value = "/delete-batch")
public R removeByIds(List<String> ids){
return R.ok(printerService.removeByIds(ids));
}
}

@ -5,7 +5,9 @@ import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.foreverwin.mesnac.common.dto.UsrDto;
import com.foreverwin.mesnac.common.enums.HandleEnum;
import com.foreverwin.mesnac.common.service.UserService;
import com.foreverwin.mesnac.common.util.StringUtil;
import com.foreverwin.mesnac.meapi.mapper.SfcMapper;
import com.foreverwin.mesnac.meapi.model.Sfc;
@ -72,6 +74,9 @@ public class SfcScrapServiceImpl extends ServiceImpl<SfcScrapMapper, SfcScrap> i
@Autowired
private PodTemplateService podTemplateService;
@Autowired
private UserService userService;
@Override
public IPage<SfcScrap> selectPage(FrontPage<SfcScrap> frontPage, SfcScrap sfcScrap) {
QueryWrapper<SfcScrap> queryWrapper = new QueryWrapper<>();
@ -211,12 +216,14 @@ public class SfcScrapServiceImpl extends ServiceImpl<SfcScrapMapper, SfcScrap> i
int day = now.getDayOfMonth();
Map<String, String> wordMap = sfcScrapMapper.generatorWord(site,locale ,shopOrder, sfc);
wordMap.put("SCRAP_MARK","线下质量贴红色标签");
wordMap.put("OPERATOR",user);
if(!StringUtil.isBlank(wordMap.get("TYPE"))){
wordMap.put("GF",(wordMap.get("TYPE").contains("GF"))? "✔": "");
wordMap.put("LF",(wordMap.get("TYPE").contains("LF"))? "✔": "");
wordMap.put("OT",(wordMap.get("TYPE").contains("QT"))? "✔": "");
List<UsrDto> list = userService.findList(user);
if(list.size() > 0){
wordMap.put("OPERATOR",list.get(0).getFullName());
}
wordMap.put("GF",(wordMap.get("TYPE").contains("GF"))? "✔": " ");
wordMap.put("LF",(wordMap.get("TYPE").contains("LF"))? "✔": " ");
wordMap.put("OT",(wordMap.get("TYPE").contains("QT"))? "✔": " ");
wordMap.put("OPINION","报废");
wordMap.put("YEAR",year + "");
wordMap.put("MONTH",month + "");

@ -177,15 +177,12 @@ public class SplitSfcServiceImpl extends ServiceImpl<SplitSfcMapper, SplitSfc> i
SplitSfcDto splitSfcDto=splitSfcMapper.getAbnormalQty(site,sfc,operation, abnormalNo);
String routerBo = splitSfcDto.getRouterBo();
String ncCode = splitSfcDto.getNcCode();
if (StringUtil.isBlank(routerBo)){
throw new BaseException("异常处置未选择处置工艺路线");
}
if (StringUtil.isBlank(ncCode)){
throw new BaseException("异常处置未选择不良代码");
}
BigDecimal sfcQty = new BigDecimal(sfcData.getQty());
if (new BigDecimal(splitSfcDto.getNcQty()).compareTo(sfcQty)>=0){
throw new BaseException("质量异常数量不小于于产品条码的数量,不能拆分");
throw new BaseException("质量异常数量大于等于于产品条码的数量,不能拆分");
}
if (splitQty.compareTo(new BigDecimal(splitSfcDto.getNcQty()))>0){
throw new BaseException("拆分数量大于质量异常数量的数量,不能拆分");
@ -206,37 +203,42 @@ public class SplitSfcServiceImpl extends ServiceImpl<SplitSfcMapper, SplitSfc> i
Collection<SplitSfcResponse> splitSfcResponses = splitService.splitSfc(splitSfcRequest);
SplitSfcResponse splitSfcResponse = splitSfcResponses.iterator().next();
String newSfcRef = splitSfcResponse.getNewSfcRef();
//记录不合格
CreateNCRequest createNCRequest=new CreateNCRequest();
createNCRequest.setQty(splitQty);
createNCRequest.setSfcRef(newSfcRef);
ProductionContext productionContext=new ProductionContext();
StepIdentifier stepIdentifier=new StepIdentifier();
stepIdentifier.setStepId(sfcData.getStepId());
stepIdentifier.setOperationId(sfcData.getOperation());
productionContext.setStepIdentifier(stepIdentifier);
List<StepOperation> resourceBySfc = sfcCrossMapper.getResourceBySfc(site, sfc);
if (resourceBySfc.isEmpty()){
throw new BaseException("产品不在工作中");
String newSfc = StringUtil.trimHandle(newSfcRef);
if(StringUtil.notBlank(routerBo)){
//记录不合格
CreateNCRequest createNCRequest=new CreateNCRequest();
createNCRequest.setQty(splitQty);
createNCRequest.setSfcRef(newSfcRef);
ProductionContext productionContext=new ProductionContext();
StepIdentifier stepIdentifier=new StepIdentifier();
stepIdentifier.setStepId(sfcData.getStepId());
stepIdentifier.setOperationId(sfcData.getOperation());
productionContext.setStepIdentifier(stepIdentifier);
List<StepOperation> resourceBySfc = sfcCrossMapper.getResourceBySfc(site, sfc);
if (resourceBySfc.isEmpty()){
throw new BaseException("产品不在工作中");
}
productionContext.setResourceRef(resourceBySfc.get(0).getResourceBo());
createNCRequest.setProdCtx(productionContext);
createNCRequest.setNcCodeRef(HandleEnum.NC_CODE.getHandle(site,splitNcCode[0]));
ncProductionService.createNC(createNCRequest);
//不合格处置特殊工艺路线
DispositionMultipleSfcsRequest dispositionSfcsRequest=new DispositionMultipleSfcsRequest();
List<String> sfcs=new ArrayList<>();
sfcs.add(newSfcRef);
dispositionSfcsRequest.setSfcs(sfcs);
dispositionSfcsRequest.setBypassStepValidation(true);
DispositionSelection dispositionSelection=new DispositionSelection();
Router maxRevisionRouter = routerService.getMaxRevisionRouter(site, StringUtil.trimHandle(routerBo));
dispositionSelection.setRouterRef(maxRevisionRouter.getHandle());
dispositionSfcsRequest.setDispositionSelection(dispositionSelection);
dispositionSfcsRequest.setProdCtx(new ProductionContext());
ncProductionService.dispositionMultipleSfcs(dispositionSfcsRequest);
String workCenterBo = shopOrderService.getById(HandleEnum.SHOP_ORDER.getHandle(site, sfcData.getShopOrder())).getPlannedWorkCenterBo();
sfcDispatchCommonService.saveSfcDispatch(site,CommonMethods.getUser(),StringUtil.trimHandle(workCenterBo),newSfc, sfcData.getShopOrder(),maxRevisionRouter.getHandle());
}
productionContext.setResourceRef(resourceBySfc.get(0).getResourceBo());
createNCRequest.setProdCtx(productionContext);
createNCRequest.setNcCodeRef(HandleEnum.NC_CODE.getHandle(site,splitNcCode[0]));
ncProductionService.createNC(createNCRequest);
//不合格处置特殊工艺路线
DispositionMultipleSfcsRequest dispositionSfcsRequest=new DispositionMultipleSfcsRequest();
List<String> sfcs=new ArrayList<>();
sfcs.add(newSfcRef);
dispositionSfcsRequest.setSfcs(sfcs);
dispositionSfcsRequest.setBypassStepValidation(true);
DispositionSelection dispositionSelection=new DispositionSelection();
Router maxRevisionRouter = routerService.getMaxRevisionRouter(site, StringUtil.trimHandle(routerBo));
dispositionSelection.setRouterRef(maxRevisionRouter.getHandle());
dispositionSfcsRequest.setDispositionSelection(dispositionSelection);
dispositionSfcsRequest.setProdCtx(new ProductionContext());
ncProductionService.dispositionMultipleSfcs(dispositionSfcsRequest);
SplitSfc splitSfc=new SplitSfc();
String newSfc = StringUtil.trimHandle(newSfcRef);
splitSfc.setHandle(HandleEnum.SPLIT_SFC.getHandle(site,newSfc));
splitSfc.setSite(site);
splitSfc.setSfc(sfc);
@ -246,8 +248,6 @@ public class SplitSfcServiceImpl extends ServiceImpl<SplitSfcMapper, SplitSfc> i
splitSfc.setCreateUser(CommonMethods.getUser());
splitSfc.setCreatedDateTime(LocalDateTime.now());
save(splitSfc);
String workCenterBo = shopOrderService.getById(HandleEnum.SHOP_ORDER.getHandle(site, sfcData.getShopOrder())).getPlannedWorkCenterBo();
sfcDispatchCommonService.saveSfcDispatch(site,CommonMethods.getUser(),StringUtil.trimHandle(workCenterBo),newSfc, sfcData.getShopOrder(),maxRevisionRouter.getHandle());
return splitSfc;
} catch (Exception e) {
ExceptionUtil.throwException(e);

@ -153,9 +153,10 @@
</if>
</select>
<select id="selectListByCondition" resultMap="BaseResultMap">
SELECT ZSR.HANDLE, ZSR.SITE, ZSR.TASK_NO, ZSR.WORK_CENTER, ZSR.SHOP_ORDER, ZSR.ITEM, ZSR.OP_STEP, ZSR.RESRCE, ZSR.SFC, ZSR.NC_CODE, ZSR.NC_QTY, ZSR.LOCATION, ZSR.STATE, ZSR.REMARK, ZSR.CREATE_USER,ZSR. CREATED_DATE_TIME,IT.DESCRIPTION FROM Z_SELF_REPORT ZSR
SELECT ZSR.HANDLE, ZSR.SITE, ZSR.TASK_NO, ZSR.WORK_CENTER, ZSR.SHOP_ORDER, ZSR.ITEM, ZSR.OP_STEP, ZSR.RESRCE, ZSR.SFC, ZSR.NC_CODE, ZSR.NC_QTY, ZSR.LOCATION, ZSR.STATE, ZSR.REMARK, B.FULL_NAME CREATE_USER,ZSR. CREATED_DATE_TIME,IT.DESCRIPTION FROM Z_SELF_REPORT ZSR
JOIN ITEM I ON I.ITEM = ZSR.ITEM AND I.CURRENT_REVISION='true'
LEFT JOIN ITEM_T IT ON I.HANDLE = IT.ITEM_BO AND IT.LOCALE = #{locale}
LEFT JOIN Z_NWA_USER B ON ZSR.SITE = B.SITE AND ZSR.CREATE_USER = B.USER_NAME
<where>
<if test="ew!=null">
<if test="ew.entity!=null">

Loading…
Cancel
Save