设备模块修改

master
zpl 3 years ago
parent 4734e23238
commit 895071aa60

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

@ -34,7 +34,7 @@ public interface CallItemMapper extends BaseMapper<CallItem> {
List<CallItem> findCallItemDetailList(CallItem 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); List<CallItem> findCallItemDetailListByDispatchBo(@Param("site") String site, @Param("list") List<String> list);

@ -64,7 +64,7 @@ public interface CallItemService extends IService<CallItem> {
* @param callItem * @param callItem
* @return * @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.enums.HandleEnum;
import com.foreverwin.mesnac.common.util.StringUtil; import com.foreverwin.mesnac.common.util.StringUtil;
import com.foreverwin.mesnac.dispatch.dto.IssueItemDto; 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.exception.BusinessException;
import com.foreverwin.modular.core.util.CommonMethods;
import com.foreverwin.modular.core.util.FrontPage; import com.foreverwin.modular.core.util.FrontPage;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; 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.mapper.CallItemMapper;
import com.foreverwin.mesnac.dispatch.service.CallItemService; import com.foreverwin.mesnac.dispatch.service.CallItemService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -41,6 +46,8 @@ public class CallItemServiceImpl extends ServiceImpl<CallItemMapper, CallItem> i
private CallItemMapper callItemMapper; private CallItemMapper callItemMapper;
@Autowired @Autowired
private CallItemService callItemService; private CallItemService callItemService;
@Autowired
private NwaUserService nwaUserService;
@Override @Override
public void sfcDispatchCallItem(String site, String user, List<SfcDispatchDto> sfcDispatchList) { public void sfcDispatchCallItem(String site, String user, List<SfcDispatchDto> sfcDispatchList) {
@ -138,8 +145,16 @@ public class CallItemServiceImpl extends ServiceImpl<CallItemMapper, CallItem> i
} }
@Override @Override
public List<CallItem> findCallItemInfoList(CallItem callItem) { public List<CallItem> findCallItemListPda(CallItem callItem) {
return callItemMapper.findCallItemInfoList(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 @Override

@ -978,41 +978,60 @@
ORDER BY VIP.WORK_ORDER, VIP.ITEM ORDER BY VIP.WORK_ORDER, VIP.ITEM
</select> </select>
<select id="findCallItemInfoList" resultMap="FullResultMap"> <select id="findCallItemListPda" resultMap="FullResultMap">
SELECT CI.HANDLE ,CI.RESRCE ,CF.VALUE SHOP_ORDER ,CI.REQUIRED_QTY , CI.STATUS, SELECT MML.*,ZSD.PLANNED_START_DATE FROM
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, SELECT ZCI.SITE, CF.VALUE WORK_ORDER, WC.WORK_CENTER, WCT.DESCRIPTION WORK_CENTER_DESCRIPTION,
I.ITEM AS COMPONENT ,IT.DESCRIPTION AS COMPONENT_DESCRIPTION ZCI.SHOP_ORDER ,
FROM Z_CALL_ITEM CI IM.ITEM, IT.DESCRIPTION ITEM_DESCRIPTION,
LEFT JOIN SHOP_ORDER SO ON CI.SHOP_ORDER = SO.SHOP_ORDER 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' 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 INNER JOIN WORK_CENTER WC ON WC.HANDLE = SO.PLANNED_WORK_CENTER_BO
LEFT JOIN BOM B ON BC.BOM_BO = B.HANDLE INNER JOIN WORK_CENTER_T WCT ON WCT.WORK_CENTER_BO = WC.HANDLE
INNER JOIN Z_SFC_DISPATCH SD ON CI.SFC_DISPATCH_BO = SD.HANDLE INNER JOIN ITEM IM ON IM.HANDLE = SO.ITEM_BO
LEFT JOIN WORK_CENTER WC ON WC.WORK_CENTER = SD.WORK_CENTER INNER JOIN ITEM_T IT ON IT.ITEM_BO = IM.HANDLE AND IT.LOCALE = #{local}
LEFT JOIN WORK_CENTER_T WCT ON WC.HANDLE = WCT.WORK_CENTER_BO INNER JOIN ITEM CP ON CP.HANDLE = ZCI.COMPONENT_BO
LEFT JOIN ITEM I ON CI.COMPONENT_BO = I.HANDLE INNER JOIN ITEM_T ITT ON ITT.ITEM_BO = CP.HANDLE AND ITT.LOCALE = #{local}
LEFT JOIN ITEM_T IT ON I.HANDLE = IT.ITEM_BO WHERE ZCI.SITE = #{site}
WHERE CI.SITE = #{site} AND WCT.LOCALE = 'zh' GROUP BY ZCI.SITE, CF.VALUE, WC.WORK_CENTER, IM.ITEM, ZSD.BLANKING_SIZE, CP.ITEM, ZCI.RESRCE, ZCI.CALL_TYPE,ZCI.SHOP_ORDER ,
<if test="workCenter != null and workCenter != ''"> WCT.DESCRIPTION ,IT.DESCRIPTION , ITT.DESCRIPTION
AND SD.WORK_CENTER = #{workCenter} 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>
<if test="resrce != null and resrce != ''"> <if test="callItem.resrce != null and callItem.resrce != ''">
AND CI.RESRCE = #{resrce} AND MML.RESRCE = #{callItem.resrce}
</if> </if>
<if test="component != null and component != ''"> <if test="callItem.component != null and callItem.component != ''">
AND I.ITEM = #{component} AND MML.COMPONENT = #{callItem.component}
</if> </if>
<if test="status != null and status != ''"> <if test="callItem.status != null and callItem.status != ''">
AND CI.STATUS = #{status} AND MML.STATUS = #{callItem.status}
</if> </if>
<if test="startFromDate != null"> <if test="callItem.startFromDate != null">
AND SD.PLANNED_START_DATE >= #{startFromDate} AND ZSD.PLANNED_START_DATE >= #{callItem.startFromDate}
</if> </if>
<if test="startToDate != null"> <if test="callItem.startToDate != null">
AND SD.PLANNED_START_DATE &lt;= #{startToDate} AND ZSD.PLANNED_START_DATE &lt;= #{callItem.startToDate}
</if> </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>
<select id="findRefreshCallItemPda" resultMap="FullResultMap"> <select id="findRefreshCallItemPda" resultMap="FullResultMap">
SELECT CI.HANDLE ,CI.SFC ,CI.COMPONENT_BO ,BC.QTY REQUIRED_QTY, CF.VALUE STEP_ID 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 resourceNo = resourceInspectTaskDto.getResrce();
String resourceTypeNo = resourceInspectTaskDto.getResourceTypeNo(); String resourceTypeNo = resourceInspectTaskDto.getResourceTypeNo();
String workCenter = resourceInspectTaskDto.getWorkCenter(); String workCenter = resourceInspectTaskDto.getWorkCenter();
String compareStartDate = resourceInspectTaskDto.getCompareStartDate();
String compareEndDate = resourceInspectTaskDto.getCompareEndDate();
if (planNo != null){ if (planNo != null){
resourceInspectTaskDto.setResourceInspectPlanBo(HandleEnum.RESOURCE_INSPECT_PLAN.getHandle(site,planNo,resourceInspectTaskDto.getPlanRevision())); resourceInspectTaskDto.setResourceInspectPlanBo(HandleEnum.RESOURCE_INSPECT_PLAN.getHandle(site,planNo,resourceInspectTaskDto.getPlanRevision()));
} }
@ -159,6 +161,9 @@ public class ResourceInspectTaskController {
} }
if (workCenter != null){ if (workCenter != null){
resourceInspectTaskDto.setWorkCenter(HandleEnum.WORK_CENTER.getHandle(site,workCenter)); resourceInspectTaskDto.setWorkCenter(HandleEnum.WORK_CENTER.getHandle(site,workCenter));
}
if (compareStartDate != null){
} }
try{ try{
return R.ok(resourceInspectTaskService.findResourceInspectTaskList(resourceInspectTaskDto)); 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.model.ResourceInspectTaskSpare;
import com.foreverwin.mesnac.equip.service.ResourceInspectTaskSpareService; import com.foreverwin.mesnac.equip.service.ResourceInspectTaskSpareService;
import com.foreverwin.mesnac.meapi.dto.NcCodeDto; 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.model.NwaUser;
import com.foreverwin.mesnac.meapi.service.NcCodeService; import com.foreverwin.mesnac.meapi.service.NcCodeService;
import com.foreverwin.mesnac.meapi.service.NwaUserService; import com.foreverwin.mesnac.meapi.service.NwaUserService;
@ -279,10 +278,6 @@ public class ResourceRepairTaskServiceImpl extends ServiceImpl<ResourceRepairTas
return resourceRepairTaskService.updateById(resourceRepairTask); return resourceRepairTaskService.updateById(resourceRepairTask);
} }
private Double minus(LocalDateTime startDate,LocalDateTime endDate){
return null;
}
} }

@ -676,10 +676,10 @@
AND RIK.RESRCE = #{resrce} AND RIK.RESRCE = #{resrce}
</if> </if>
<if test="compareStartDate != null and compareStartDate != ''"> <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>
<if test="compareEndDate != null and compareEndDate != ''"> <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>
<if test="resourceTypeBo != null and resourceTypeBo != ''"> <if test="resourceTypeBo != null and resourceTypeBo != ''">
AND RTR.RESOURCE_TYPE_BO = #{resourceTypeBo} AND RTR.RESOURCE_TYPE_BO = #{resourceTypeBo}

@ -916,10 +916,10 @@
AND RRT.REPORT_SOURCE = #{reportSource} AND RRT.REPORT_SOURCE = #{reportSource}
</if> </if>
<if test="compareStartDate != null and compareStartDate != ''"> <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>
<if test="compareEndDate != null and compareEndDate != ''"> <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> </if>
</select> </select>
<!--根据维修任务HANDLE获取维修任务详细数据--> <!--根据维修任务HANDLE获取维修任务详细数据-->

Loading…
Cancel
Save