Merge remote-tracking branch 'origin/master'

master
赵嘉伟 3 years ago
commit a391d573c9

@ -1,5 +1,6 @@
package com.foreverwin.mesnac.common.controller;
import cn.hutool.core.date.DateUtil;
import com.foreverwin.modular.core.exception.BusinessException;
import com.foreverwin.modular.core.util.R;
import com.foreverwin.modular.core.util.FrontPage;
@ -49,6 +50,32 @@ public class PrintLogController {
return R.ok(result);
}
/**
*
*
* @return
*/
@ResponseBody
@PostMapping("/getPrintLogListByCondition")
public R getPrintLogListByCondition(@RequestBody PrintLog printLog){
List<PrintLog> result;
try {
String site = CommonMethods.getSite();
printLog.setSite(site);
if (printLog.getStartFromDate_S() != null) {
printLog.setStartFromDate(DateUtil.parse(printLog.getStartFromDate_S()));
}
if (printLog.getStartToDate_S() != null) {
printLog.setStartToDate(DateUtil.parse(printLog.getStartToDate_S()));
}
result = printLogService.getPrintLogListByCondition(printLog);
} catch (Exception e) {
return R.failed(e.getMessage());
}
return R.ok(result);
}
@ResponseBody
@PostMapping("/labelPrint")
public R labelPrint(@RequestBody List<PrintLog> requestList) {

@ -80,16 +80,16 @@ public class PrinterController {
printer.setCreatedDateTime(nowDate);
printer.setModifiedDateTime(nowDate);
printerService.save(printer);
return R.ok("保存成功");
} else {
printerModel.setDescription(printer.getDescription());
printerModel.setModifiedDateTime(nowDate);
printerService.updateById(printerModel);
return R.ok("修改成功");
}
} catch (Exception e) {
return R.failed(e.getMessage());
}
return R.ok();
}
@ResponseBody
@PostMapping("/delPrinter")

@ -4,6 +4,8 @@ import com.foreverwin.mesnac.common.model.PrintLog;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* <p>
* Mapper
@ -15,4 +17,11 @@ import org.springframework.stereotype.Repository;
@Repository
public interface PrintLogMapper extends BaseMapper<PrintLog> {
/**
*
* @param printLog
* @return
*/
List<PrintLog> getPrintLogListByCondition(PrintLog printLog);
}

@ -8,6 +8,8 @@ import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
/**
@ -124,6 +126,45 @@ public class PrintLog extends Model<PrintLog> {
@TableField(value = "ITEM_DESCRIPTION", exist = false)
private String itemDescription;
private String startFromDate_S;
@TableField(exist = false)
private String startToDate_S;
@TableField(exist = false)
private Date startFromDate;
@TableField(exist = false)
private Date startToDate;
public String getStartFromDate_S() {
return startFromDate_S;
}
public void setStartFromDate_S(String startFromDate_S) {
this.startFromDate_S = startFromDate_S;
}
public String getStartToDate_S() {
return startToDate_S;
}
public void setStartToDate_S(String startToDate_S) {
this.startToDate_S = startToDate_S;
}
public Date getStartFromDate() {
return startFromDate;
}
public void setStartFromDate(Date startFromDate) {
this.startFromDate = startFromDate;
}
public Date getStartToDate() {
return startToDate;
}
public void setStartToDate(Date startToDate) {
this.startToDate = startToDate;
}
public String getHandle() {
return handle;

@ -30,4 +30,11 @@ public interface PrintLogService extends IService<PrintLog> {
* @param printList
*/
void labelPrint(String site, String user, List<PrintLog> printList);
/**
*
* @param printLog
* @return
*/
List<PrintLog> getPrintLogListByCondition(PrintLog printLog);
}

@ -101,4 +101,9 @@ public class PrintLogServiceImpl extends ServiceImpl<PrintLogMapper, PrintLog> i
printLogService.updateBatchById(printLogList);
}
@Override
public List<PrintLog> getPrintLogListByCondition(PrintLog printLog) {
return printLogMapper.getPrintLogListByCondition(printLog);
}
}

@ -537,4 +537,32 @@
</delete>
<!-- BaseMapper标准查询/修改/删除 -->
<!--自定义sql-->
<select id="getPrintLogListByCondition" resultMap="BaseResultMap">
SELECT * FROM Z_PRINT_LOG PL
WHERE SITE = #{site}
<if test="startFromDate != null">
AND PL.CREATED_DATE_TIME >= #{startFromDate}
</if>
<if test="startToDate != null">
AND PL.CREATED_DATE_TIME &lt;= #{startToDate}
</if>
<if test="isPrint != null">
AND PL.IS_PRINT = #{isPrint}
</if>
<if test="category != null">
AND PL.CATEGORY &lt;= #{category}
</if>
<if test="inventory != null">
AND PL.INVENTORY &lt;= #{inventory}
</if>
<if test="sfc != null">
AND PL.SFC &lt;= #{sfc}
</if>
ORDER BY PL.CREATED_DATE_TIME DESC
</select>
<!--自定义sql-->
</mapper>

@ -162,11 +162,15 @@ public class CallItemController {
try {
String site = CommonMethods.getSite();
String user = CommonMethods.getUser();
callItemService.callOrConfirmItemPda(site, user, callItemList.get(0).getCallStatus() ,callItemList);
String status = callItemList.get(0).getStatus();
callItemService.callOrConfirmItemPda(site, user, status ,callItemList);
if (status.equals("802")){
return R.ok("叫料成功");
}
return R.ok("确认到料成功");
} catch (Exception e) {
return R.failed(e.getMessage());
}
return R.ok("叫料成功");
}
@ -230,9 +234,7 @@ public class CallItemController {
@PostMapping("/refreshCallItemPda")
public R refreshCallItemPda(@RequestBody List<CallItem> callItemList) {
try {
String site = CommonMethods.getSite();
String user = CommonMethods.getUser();
callItemService.refreshCallItemPda(site, user, callItemList);
callItemService.refreshCallItemPda(callItemList);
} catch (Exception e) {
return R.failed(e.getMessage());
}

@ -49,7 +49,7 @@ public interface CallItemMapper extends BaseMapper<CallItem> {
*/
void updateCallItemStatusByHandle(@Param("status") String status, @Param("user") String user, @Param("dateTime") LocalDateTime dateTime, @Param("list") List<String> list);
void findRefreshCallItemPda(@Param("list") List<String> list);
List<CallItem> findRefreshCallItemPda(@Param("list") List<String> list);
void updateCallItemStatusByCallItemNo(@Param("status") String status, @Param("user") String user, @Param("dateTime") LocalDateTime dateTime, @Param("list") List<String> list);

@ -114,11 +114,9 @@ public interface CallItemService extends IService<CallItem> {
/**
* PDA
* @param site
* @param user
* @param callItemList
*/
void refreshCallItemPda(String site, String user, List<CallItem> callItemList);
void refreshCallItemPda(List<CallItem> callItemList);
/**
*

@ -39,6 +39,8 @@ public class CallItemServiceImpl extends ServiceImpl<CallItemMapper, CallItem> i
@Autowired
private CallItemMapper callItemMapper;
@Autowired
private CallItemService callItemService;
@Override
public void sfcDispatchCallItem(String site, String user, List<SfcDispatchDto> sfcDispatchList) {
@ -271,8 +273,31 @@ public class CallItemServiceImpl extends ServiceImpl<CallItemMapper, CallItem> i
}
@Override
public void refreshCallItemPda(String site, String user, List<CallItem> callItemList) {
public void refreshCallItemPda(List<CallItem> callItemList) {
List<CallItem> callItems = new ArrayList<>();
List<String> list = new ArrayList<>();
for (CallItem callItem:callItemList) {
String handle = callItem.getHandle();
list.add(handle);
CallItem call = new CallItem();
call.setHandle(handle);
callItems.add(call);
}
List<CallItem> itemList = callItemMapper.findRefreshCallItemPda(list);
Boolean bl = false;
for (int i = 0; i < callItemList.size(); i++) {
BigDecimal oldQty = callItemList.get(i).getRequiredQty();
BigDecimal newQty = itemList.get(i).getRequiredQty();
if (oldQty.compareTo(newQty) == -1){
callItems.get(i).setStatus(Constants.CALL_ITEM_STATUS_NEW);
callItems.get(i).setRequiredQty(newQty);
bl = true;
}
}
if (bl){
callItemService.updateBatchById(callItems);
}
}
@Override
@ -329,7 +354,17 @@ public class CallItemServiceImpl extends ServiceImpl<CallItemMapper, CallItem> i
continue;
}
if ("GB".equals(itemGroup) && blankingSize.contains("*")) {
if (StringUtil.isBlank(blankingSize)) {
callItem.setSizeReqQty(callItem.getRequiredQty());
compQtyMap.put(component, callItem.getRequiredQty());
continue;
}
if ("GB".equals(itemGroup)) {
if (!blankingSize.contains("*")) {
continue;
}
String []size = blankingSize.split("\\*");
if (size != null && size.length >= 2) {
int sizeLength = size.length;
@ -342,7 +377,13 @@ 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 = new String[1];
if (blankingSize.contains("*")) {
size = blankingSize.split("\\*");
} else {
size[0] = blankingSize;
}
if (size != null && size.length >= 1) {
int sizeLength = size.length;
BigDecimal length = new BigDecimal(size[sizeLength-1]);

@ -834,7 +834,7 @@
</update>
<update id="updateCallItemStatusByHandle">
UPDATE Z_CALL_ITEM SET CALL_STATUS = #{status}, MODIFY_USER = #{user}, MODIFIED_DATE_TIME = #{dateTime}
UPDATE Z_CALL_ITEM SET STATUS = #{status}, MODIFY_USER = #{user}, MODIFIED_DATE_TIME = #{dateTime}
WHERE HANDLE IN
<foreach item="item" collection="list" separator="," open="(" close=")" index="">
#{item}
@ -979,7 +979,7 @@
</select>
<select id="findCallItemInfoList" resultMap="FullResultMap">
SELECT CI.HANDLE ,CI.RESRCE ,CF.VALUE SHOP_ORDER ,CI.REQUIRED_QTY , CI.CALL_STATUS,
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
@ -1016,18 +1016,15 @@
</select>
<select id="findRefreshCallItemPda" resultMap="FullResultMap">
SELECT CI.HANDLE ,CI.SFC ,CI.COMPONENT_BO ,BC.QTY REQUIRED_QTY, CF.VALUE STEP_ID
--BC.BOM_BO , CI.STEP_ID ,
FROM Z_CALL_ITEM CI
LEFT JOIN SFC S ON S.SFC = CI.SFC
LEFT JOIN SFC_BOM SB ON SB.SFC_BO = S.HANDLE
LEFT JOIN BOM_COMPONENT BC ON BC.BOM_BO = SB.BOM_BO AND BC.COMPONENT_GBO = CI.COMPONENT_BO
LEFT JOIN CUSTOM_FIELDS CF ON CF.HANDLE = BC.HANDLE AND CF."ATTRIBUTE" = 'STEP_ID' AND CF.VALUE = CI.STEP_ID
WHERE HANDLE IN
(
<foreach item="item" index="index" collection="coll" separator=",">
#{item}
</foreach>
)
<foreach item="item" collection="list" separator="," open="(" close=")" index="">
#{item}
</foreach>
</select>
</mapper>

@ -1,19 +1,16 @@
package com.foreverwin.mesnac.meapi.controller;
import com.foreverwin.mesnac.meapi.util.StringUtils;
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 com.foreverwin.mesnac.meapi.model.Resrce;
import com.foreverwin.mesnac.meapi.service.ResrceService;
import com.foreverwin.mesnac.meapi.util.StringUtils;
import com.foreverwin.modular.core.util.CommonMethods;
import com.foreverwin.modular.core.util.FrontPage;
import com.foreverwin.modular.core.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.foreverwin.mesnac.meapi.service.ResrceService;
import com.foreverwin.mesnac.meapi.model.Resrce;
import java.util.ArrayList;
import java.util.List;
/**
@ -98,9 +95,7 @@ public class ResrceController {
queryWrapper.setEntity(resrce);
if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) {
queryWrapper
.like(Resrce.HANDLE, frontPage.getGlobalQuery())
.or().like(Resrce.SITE, frontPage.getGlobalQuery())
.or().like(Resrce.RESRCE, frontPage.getGlobalQuery())
.like(Resrce.RESRCE, frontPage.getGlobalQuery())
.or().like(Resrce.DESCRIPTION, frontPage.getGlobalQuery())
.or().like(Resrce.STATUS_BO, frontPage.getGlobalQuery())
.or().like(Resrce.PROCESS_RESOURCE, frontPage.getGlobalQuery())

@ -284,7 +284,7 @@
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
AND ${ew.sqlSegment}
${ew.sqlSegment}
</if>
</select>

Loading…
Cancel
Save