设备模块修改

master
zpl 3 years ago
parent 4734e23238
commit 895071aa60

@ -116,8 +116,8 @@ public class CallItemController {
* @return
*/
@ResponseBody
@PostMapping("/findCallItemInfoList")
public R findCallItemInfoList(@RequestBody CallItem callItem){
@PostMapping("/findCallItemListPda")
public R findCallItemListPda(@RequestBody CallItem callItem){
List<CallItem> result;
try {
callItem.setSite(CommonMethods.getSite());
@ -127,7 +127,7 @@ public class CallItemController {
if (callItem.getStartToDate_S() != null) {
callItem.setStartToDate(DateUtil.parse(callItem.getStartToDate_S()));
}
result = callItemService.findCallItemInfoList(callItem);
result = callItemService.findCallItemListPda(callItem);
} catch (Exception e) {
return R.failed(e.getMessage());
}

@ -34,7 +34,7 @@ public interface CallItemMapper extends BaseMapper<CallItem> {
List<CallItem> findCallItemDetailList(CallItem callItem);
List<CallItem> findCallItemInfoList(CallItem callItem);
List<CallItem> findCallItemListPda(@Param("site") String site,@Param("local") String local,@Param("user") String user,@Param("callItem")CallItem callItem);
List<CallItem> findCallItemDetailListByDispatchBo(@Param("site") String site, @Param("list") List<String> list);

@ -64,7 +64,7 @@ public interface CallItemService extends IService<CallItem> {
* @param callItem
* @return
*/
List<CallItem> findCallItemInfoList(CallItem callItem);
List<CallItem> findCallItemListPda(CallItem callItem);
/**

@ -5,7 +5,11 @@ import com.foreverwin.mesnac.common.dto.SfcDispatchDto;
import com.foreverwin.mesnac.common.enums.HandleEnum;
import com.foreverwin.mesnac.common.util.StringUtil;
import com.foreverwin.mesnac.dispatch.dto.IssueItemDto;
import com.foreverwin.mesnac.meapi.model.NwaUser;
import com.foreverwin.mesnac.meapi.service.NwaUserService;
import com.foreverwin.mesnac.meapi.service.UserGroupService;
import com.foreverwin.modular.core.exception.BusinessException;
import com.foreverwin.modular.core.util.CommonMethods;
import com.foreverwin.modular.core.util.FrontPage;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -13,6 +17,7 @@ import com.foreverwin.mesnac.dispatch.model.CallItem;
import com.foreverwin.mesnac.dispatch.mapper.CallItemMapper;
import com.foreverwin.mesnac.dispatch.service.CallItemService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
@ -41,6 +46,8 @@ public class CallItemServiceImpl extends ServiceImpl<CallItemMapper, CallItem> i
private CallItemMapper callItemMapper;
@Autowired
private CallItemService callItemService;
@Autowired
private NwaUserService nwaUserService;
@Override
public void sfcDispatchCallItem(String site, String user, List<SfcDispatchDto> sfcDispatchList) {
@ -138,8 +145,16 @@ public class CallItemServiceImpl extends ServiceImpl<CallItemMapper, CallItem> i
}
@Override
public List<CallItem> findCallItemInfoList(CallItem callItem) {
return callItemMapper.findCallItemInfoList(callItem);
public List<CallItem> findCallItemListPda(CallItem callItem) {
String site = CommonMethods.getSite();
String user = CommonMethods.getUser();
NwaUser byId = nwaUserService.getById(HandleEnum.USER.getHandle(site, user));
String language = LocaleContextHolder.getLocale().getLanguage();
List<NwaUser> nwaUsers = nwaUserService.checkUserGroup(site, "CJ_ZR,ADMINISTRATORS");
if (nwaUsers.contains(byId)){
return callItemMapper.findCallItemListPda(site,language,user,callItem);
}
return callItemMapper.findCallItemListPda(site,language,null,callItem);
}
@Override

@ -978,41 +978,60 @@
ORDER BY VIP.WORK_ORDER, VIP.ITEM
</select>
<select id="findCallItemInfoList" resultMap="FullResultMap">
SELECT CI.HANDLE ,CI.RESRCE ,CF.VALUE SHOP_ORDER ,CI.REQUIRED_QTY , CI.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 COMPONENT ,IT.DESCRIPTION AS COMPONENT_DESCRIPTION
FROM Z_CALL_ITEM CI
LEFT JOIN SHOP_ORDER SO ON CI.SHOP_ORDER = SO.SHOP_ORDER
<select id="findCallItemListPda" resultMap="FullResultMap">
SELECT MML.*,ZSD.PLANNED_START_DATE FROM
(
SELECT ZCI.SITE, CF.VALUE WORK_ORDER, WC.WORK_CENTER, WCT.DESCRIPTION WORK_CENTER_DESCRIPTION,
ZCI.SHOP_ORDER ,
IM.ITEM, IT.DESCRIPTION ITEM_DESCRIPTION,
CP.ITEM COMPONENT, ITT.DESCRIPTION COMPONENT_DESCRIPTION,
ZSD.BLANKING_SIZE,
ZCI.RESRCE, ZCI.CALL_TYPE,
/*MIN(SO.PLANNED_START_DATE) ,*/
SUM(ZCI.REQUIRED_QTY) REQUIRED_QTY
FROM Z_CALL_ITEM ZCI
INNER JOIN Z_SFC_DISPATCH ZSD ON ZSD.HANDLE = ZCI.SFC_DISPATCH_BO
INNER JOIN SHOP_ORDER SO ON SO.SITE = ZCI.SITE AND SO.SHOP_ORDER = ZCI.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} AND WCT.LOCALE = 'zh'
<if test="workCenter != null and workCenter != ''">
AND SD.WORK_CENTER = #{workCenter}
INNER JOIN WORK_CENTER WC ON WC.HANDLE = SO.PLANNED_WORK_CENTER_BO
INNER JOIN WORK_CENTER_T WCT ON WCT.WORK_CENTER_BO = WC.HANDLE
INNER JOIN ITEM IM ON IM.HANDLE = SO.ITEM_BO
INNER JOIN ITEM_T IT ON IT.ITEM_BO = IM.HANDLE AND IT.LOCALE = #{local}
INNER JOIN ITEM CP ON CP.HANDLE = ZCI.COMPONENT_BO
INNER JOIN ITEM_T ITT ON ITT.ITEM_BO = CP.HANDLE AND ITT.LOCALE = #{local}
WHERE ZCI.SITE = #{site}
GROUP BY ZCI.SITE, CF.VALUE, WC.WORK_CENTER, IM.ITEM, ZSD.BLANKING_SIZE, CP.ITEM, ZCI.RESRCE, ZCI.CALL_TYPE,ZCI.SHOP_ORDER ,
WCT.DESCRIPTION ,IT.DESCRIPTION , ITT.DESCRIPTION
ORDER BY CF.VALUE ,ZCI.RESRCE, IM.ITEM ) MML
INNER JOIN
( SELECT ZSD.BLANKING_SIZE ,ZSD.RESRCE ,ZSD.WORK_CENTER ,ZSD.SHOP_ORDER ,
MIN(ZSD.PLANNED_START_DATE) PLANNED_START_DATE
FROM WIP.Z_SFC_DISPATCH ZSD
WHERE ZSD.SITE = #{site}
<if test="user != null and user != ''">AND ZSD.EMPLOYEE LIKE #{user}</if>
GROUP BY ZSD.WORK_CENTER ,ZSD.BLANKING_SIZE ,ZSD.SHOP_ORDER ,ZSD.RESRCE
) ZSD
ON ZSD.SHOP_ORDER = MML.SHOP_ORDER AND ZSD.BLANKING_SIZE = MML.BLANKING_SIZE
AND ZSD.RESRCE = MML.RESRCE AND ZSD.WORK_CENTER = MML.WORK_CENTER
<if test="callItem.workCenter != null and callItem.workCenter != ''">
AND MML.WORK_CENTER = #{callItem.workCenter}
</if>
<if test="resrce != null and resrce != ''">
AND CI.RESRCE = #{resrce}
<if test="callItem.resrce != null and callItem.resrce != ''">
AND MML.RESRCE = #{callItem.resrce}
</if>
<if test="component != null and component != ''">
AND I.ITEM = #{component}
<if test="callItem.component != null and callItem.component != ''">
AND MML.COMPONENT = #{callItem.component}
</if>
<if test="status != null and status != ''">
AND CI.STATUS = #{status}
<if test="callItem.status != null and callItem.status != ''">
AND MML.STATUS = #{callItem.status}
</if>
<if test="startFromDate != null">
AND SD.PLANNED_START_DATE >= #{startFromDate}
<if test="callItem.startFromDate != null">
AND ZSD.PLANNED_START_DATE >= #{callItem.startFromDate}
</if>
<if test="startToDate != null">
AND SD.PLANNED_START_DATE &lt;= #{startToDate}
<if test="callItem.startToDate != null">
AND ZSD.PLANNED_START_DATE &lt;= #{callItem.startToDate}
</if>
ORDER BY CF.VALUE ,CI.RESRCE, I.ITEM
ORDER BY MML.SHOP_ORDER,MML.WORK_CENTER,MML.ITEM,MML.COMPONENT,MML.BLANKING_SIZE,ZSD.PLANNED_START_DATE
</select>
<select id="findRefreshCallItemPda" resultMap="FullResultMap">
SELECT CI.HANDLE ,CI.SFC ,CI.COMPONENT_BO ,BC.QTY REQUIRED_QTY, CF.VALUE STEP_ID

@ -148,6 +148,8 @@ public class ResourceInspectTaskController {
String resourceNo = resourceInspectTaskDto.getResrce();
String resourceTypeNo = resourceInspectTaskDto.getResourceTypeNo();
String workCenter = resourceInspectTaskDto.getWorkCenter();
String compareStartDate = resourceInspectTaskDto.getCompareStartDate();
String compareEndDate = resourceInspectTaskDto.getCompareEndDate();
if (planNo != null){
resourceInspectTaskDto.setResourceInspectPlanBo(HandleEnum.RESOURCE_INSPECT_PLAN.getHandle(site,planNo,resourceInspectTaskDto.getPlanRevision()));
}
@ -159,6 +161,9 @@ public class ResourceInspectTaskController {
}
if (workCenter != null){
resourceInspectTaskDto.setWorkCenter(HandleEnum.WORK_CENTER.getHandle(site,workCenter));
}
if (compareStartDate != null){
}
try{
return R.ok(resourceInspectTaskService.findResourceInspectTaskList(resourceInspectTaskDto));

@ -6,7 +6,6 @@ import com.foreverwin.mesnac.common.helper.NextNumberHelper;
import com.foreverwin.mesnac.equip.model.ResourceInspectTaskSpare;
import com.foreverwin.mesnac.equip.service.ResourceInspectTaskSpareService;
import com.foreverwin.mesnac.meapi.dto.NcCodeDto;
import com.foreverwin.mesnac.meapi.model.NcCode;
import com.foreverwin.mesnac.meapi.model.NwaUser;
import com.foreverwin.mesnac.meapi.service.NcCodeService;
import com.foreverwin.mesnac.meapi.service.NwaUserService;
@ -279,10 +278,6 @@ public class ResourceRepairTaskServiceImpl extends ServiceImpl<ResourceRepairTas
return resourceRepairTaskService.updateById(resourceRepairTask);
}
private Double minus(LocalDateTime startDate,LocalDateTime endDate){
return null;
}
}

@ -676,10 +676,10 @@
AND RIK.RESRCE = #{resrce}
</if>
<if test="compareStartDate != null and compareStartDate != ''">
AND RIK.TASK_CREATE_DATE &gt; TO_DATE( #{compareStartDate},'yyyy-MM-dd hh24:mi-ss' )
AND RIK.TASK_CREATE_DATE &gt;= (TO_DATE( #{compareStartDate},'yyyy-MM-dd hh24:mi-ss' ) - 8/24 )
</if>
<if test="compareEndDate != null and compareEndDate != ''">
AND RIK.TASK_CREATE_DATE &lt; TO_DATE( #{compareEndDate},'yyyy-MM-dd hh24:mi-ss' )
AND RIK.TASK_CREATE_DATE &lt;= (TO_DATE( #{compareEndDate},'yyyy-MM-dd hh24:mi-ss' ) - 8/24)
</if>
<if test="resourceTypeBo != null and resourceTypeBo != ''">
AND RTR.RESOURCE_TYPE_BO = #{resourceTypeBo}

@ -916,10 +916,10 @@
AND RRT.REPORT_SOURCE = #{reportSource}
</if>
<if test="compareStartDate != null and compareStartDate != ''">
AND RRT.PLAN_START_DATE &gt; TO_DATE( #{compareStartDate},'yyyy-MM-dd hh24:mi-ss' )
AND RRT.PLAN_START_DATE &gt;= (TO_DATE( #{compareStartDate},'yyyy-MM-dd hh24:mi-ss' ) - 8/24 )
</if>
<if test="compareEndDate != null and compareEndDate != ''">
AND RRT.PLAN_START_DATE &lt; TO_DATE( #{compareEndDate},'yyyy-MM-dd hh24:mi-ss' )
AND RRT.PLAN_START_DATE &lt;= (TO_DATE( #{compareEndDate},'yyyy-MM-dd hh24:mi-ss' ) - 8/24 )
</if>
</select>
<!--根据维修任务HANDLE获取维修任务详细数据-->

Loading…
Cancel
Save