Leon 3 years ago
commit 63e9c0277a

@ -1014,6 +1014,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>

@ -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);

@ -83,7 +83,7 @@ public class PrintLogServiceImpl extends ServiceImpl<PrintLogMapper, PrintLog> i
JSONObject jsonObject = JSONObject.parseObject(post);
Integer code = jsonObject.getInteger("code");
String msg = jsonObject.getString("msg");
if (code == 500){
if (code != 0){
throw BusinessException.build(msg);
}
// 更新打印记录:是否已打印、使用的打印机、打印次数

@ -110,6 +110,30 @@ public class CallItemController {
return R.ok(result);
}
/**
*
*
* @return
*/
@ResponseBody
@PostMapping("/findCallItemInfoList")
public R findCallItemInfoList(@RequestBody CallItem callItem){
List<CallItem> result;
try {
callItem.setSite(CommonMethods.getSite());
if (callItem.getStartFromDate_S() != null) {
callItem.setStartFromDate(DateUtil.parse(callItem.getStartFromDate_S()));
}
if (callItem.getStartToDate_S() != null) {
callItem.setStartToDate(DateUtil.parse(callItem.getStartToDate_S()));
}
result = callItemService.findCallItemInfoList(callItem);
} catch (Exception e) {
return R.failed(e.getMessage());
}
return R.ok(result);
}
@ResponseBody
@PostMapping("/callItem")
public R callItem(@RequestBody List<CallItem> callItemList) {

@ -34,6 +34,8 @@ public interface CallItemMapper extends BaseMapper<CallItem> {
List<CallItem> findCallItemDetailList(CallItem callItem);
List<CallItem> findCallItemInfoList(CallItem callItem);
List<CallItem> findCallItemDetailListByDispatchBo(@Param("site") String site, @Param("list") List<String> list);
void updateCallItemStatusByDispatchBo(@Param("status") String status, @Param("user") String user, @Param("dateTime") LocalDateTime dateTime, @Param("list") List<String> list);

@ -142,6 +142,8 @@ public class CallItem extends Model<CallItem> {
@TableField(exist = false)
private String component;
@TableField(exist = false)
private String componentDescription;
@TableField(exist = false)
private String itemDescription;
@TableField(exist = false)
private String materialType;
@ -158,6 +160,8 @@ public class CallItem extends Model<CallItem> {
@TableField(exist = false)
private String workCenter;
@TableField(exist = false)
private String workCenterDescription;
@TableField(exist = false)
private String dispatchNo;
@TableField(exist = false)
private BigDecimal dispatchQty;
@ -384,6 +388,14 @@ public class CallItem extends Model<CallItem> {
this.component = component;
}
public String getComponentDescription() {
return componentDescription;
}
public void setComponentDescription(String componentDescription) {
this.componentDescription = componentDescription;
}
public String getItemDescription() {
return itemDescription;
}

@ -58,6 +58,14 @@ public interface CallItemService extends IService<CallItem> {
*/
List<CallItem> findCallItemDetailListByDispatchBo(String site, List<String> dispatchBoList);
/**
* PDA
*
* @param callItem
* @return
*/
List<CallItem> findCallItemInfoList(CallItem callItem);
/**
*

@ -135,6 +135,11 @@ public class CallItemServiceImpl extends ServiceImpl<CallItemMapper, CallItem> i
return callItemMapper.findCallItemDetailListByDispatchBo(site, dispatchBoList);
}
@Override
public List<CallItem> findCallItemInfoList(CallItem callItem) {
return callItemMapper.findCallItemInfoList(callItem);
}
@Override
public void callItem(String site, String user, List<CallItem> callItemList) {
if (callItemList == null || callItemList.size() <= 0) {

@ -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()+","+

@ -969,4 +969,42 @@
ON VIP.SITE = SIP.SITE AND VIP.ITEM_BO = SIP.ITEM_BO AND VIP.REQUIRED_QTY > 0
ORDER BY VIP.WORK_ORDER, VIP.ITEM
</select>
<select id="findCallItemInfoList" resultMap="FullResultMap">
SELECT CI.RESRCE ,CF.VALUE SHOP_ORDER ,CI.REQUIRED_QTY , CI.STATUS AS CALL_STATUS,
B.BOM AS ITEM, B.DESCRIPTION ITEM_DESCRIPTION ,
SD.WORK_CENTER , WCT.DESCRIPTION AS WORK_CENTER_DESCRIPTION, SD.BLANKING_SIZE, SD.REMARK, SD.PLANNED_START_DATE,
I.ITEM AS ITEM_NO ,IT.DESCRIPTION AS COMPONENT_DESCRIPTION
FROM Z_CALL_ITEM CI
LEFT JOIN SHOP_ORDER SO ON CI.SHOP_ORDER = SO.SHOP_ORDER
LEFT JOIN CUSTOM_FIELDS CF ON CF.HANDLE = SO.HANDLE AND CF."ATTRIBUTE" = 'WORK_ORDER'
INNER JOIN BOM_COMPONENT BC ON CI.COMPONENT_BO = BC.COMPONENT_GBO
LEFT JOIN BOM B ON BC.BOM_BO = B.HANDLE
INNER JOIN Z_SFC_DISPATCH SD ON CI.SFC_DISPATCH_BO = SD.HANDLE
LEFT JOIN WORK_CENTER WC ON WC.WORK_CENTER = SD.WORK_CENTER
LEFT JOIN WORK_CENTER_T WCT ON WC.HANDLE = WCT.WORK_CENTER_BO
LEFT JOIN ITEM I ON CI.COMPONENT_BO = I.HANDLE
LEFT JOIN ITEM_T IT ON I.HANDLE = IT.ITEM_BO
WHERE CI.SITE = #{site}
<if test="workCenter != null and workCenter != ''">
AND SD.WORK_CENTER = #{workCenter}
</if>
<if test="resrce != null and resrce != ''">
AND CI.RESRCE = #{resrce}
</if>
<if test="component != null and component != ''">
AND I.ITEM = #{component}
</if>
<if test="status != null and status != ''">
AND CI.STATUS = #{status}
</if>
<if test="startFromDate_S != null">
AND SD.PLANNED_START_DATE >= #{startFromDate_S}
</if>
<if test="startToDate_S != null">
AND SD.PLANNED_START_DATE &lt;= #{startToDate_S}
</if>
ORDER BY CF.VALUE ,CI.RESRCE, I.ITEM
</select>
</mapper>

@ -34,15 +34,13 @@
<groupId>com.foreverwin.mesnac</groupId>
<artifactId>meapi</artifactId>
</dependency>
<dependency>
<groupId>com.foreverwin.mesnac</groupId>
<artifactId>common</artifactId>
<artifactId>dispatch</artifactId>
</dependency>
<dependency>
<groupId>com.foreverwin.mesnac</groupId>
<artifactId>dispatch</artifactId>
<artifactId>common</artifactId>
</dependency>
</dependencies>
</project>

@ -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>

@ -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