diff --git a/src/main/java/com/gaotao/modules/notify/controller/IssureNotifyController.java b/src/main/java/com/gaotao/modules/notify/controller/IssureNotifyController.java new file mode 100644 index 0000000..c1ca4ad --- /dev/null +++ b/src/main/java/com/gaotao/modules/notify/controller/IssureNotifyController.java @@ -0,0 +1,318 @@ +package com.gaotao.modules.notify.controller; + + +import com.gaotao.common.utils.R; +import com.gaotao.modules.base.entity.SOScheduledRoutingData; +import com.gaotao.modules.notify.entity.SOIssueNotifyHeaderData; +import com.gaotao.modules.notify.entity.SOIssueNotifyOrderList; +import com.gaotao.modules.notify.entity.SOIssueNotifyOrderListData; +import com.gaotao.modules.notify.entity.SOIssueNotifyOrderMaterialListData; +import com.gaotao.modules.notify.service.IssureNotifyService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.text.ParseException; +import java.util.List; + +@RestController +@RequestMapping("orderIssure/issureNotify") +public class IssureNotifyController { + + @Autowired + private IssureNotifyService issureNotifyService; + + /** + * @Description 获取用户下面未下达领料申请单 + * @Title getUserNotifyNo + * @param data + * @author rq + * @date 2024/8/30 14:36 + * @return R + * @throw + */ + @PostMapping(value="/getUserNotifyNo") + @ResponseBody + public R getUserNotifyNo(@RequestBody SOIssueNotifyHeaderData data) { + SOIssueNotifyHeaderData row = issureNotifyService.getUserNotifyNo(data); + return R.ok().put("row", row); + } + + + @PostMapping(value="/createNotify") + @ResponseBody + public R createNotify(@RequestBody SOIssueNotifyHeaderData data) throws ParseException { + //issureNotifyService.createNotify(data); + return R.ok(); + } + + @PostMapping(value="/updateNotifyBu") + @ResponseBody + public R updateNotifyBu(@RequestBody SOIssueNotifyHeaderData data) { + issureNotifyService.updateNotifyBu(data); + return R.ok(); + } + + /** + * @Description 查询子订单 + * @Title getNotifyNoDetail + * @param data + * @author rq + * @date 2024/9/1 19:01 + * @return R + * @throw + */ + @PostMapping(value="/getNotifyNoDetail") + @ResponseBody + public R getNotifyNoDetail(@RequestBody SOIssueNotifyHeaderData data) { + List rows = issureNotifyService.getNotifyNoDetail(data); + return R.ok().put("rows", rows); + } + + /** + * @Title getSOScheduledRoutingListForIssure + * @param data + * @author rq + * @date 2024/9/2 9:33 + * @return R + * @throw + */ + @PostMapping(value="/getSOScheduledRoutingListForIssure") + @ResponseBody + public R getSOScheduledRoutingListForIssure(@RequestBody SOScheduledRoutingData data) { + //TODO 调用rifs接口获取列表数据 + List rows = issureNotifyService.getSOScheduledRoutingListForIssure(data); + return R.ok().put("rows", rows); + } + @PostMapping(value="/getSOSBOMForIssure") + @ResponseBody + public R getSOSBOMForIssure(@RequestBody SOScheduledRoutingData data) { + List rows = issureNotifyService.getSOSBOMForIssure(data); + return R.ok().put("rows", rows); + } + + /** + * @Description 查看其他已申请物料 + * @Title searchOtherPart + * @param data + * @author rq + * @date 2024/10/28 9:49 + * @return R + * @throw + */ + @PostMapping(value="/searchOtherPart") + @ResponseBody + public R searchOtherPart(@RequestBody SOIssueNotifyOrderMaterialListData data) { + List rows = issureNotifyService.searchOtherPart(data); + return R.ok().put("rows", rows); + } + + /** + * @Description 保存申请单派工单记录 + * @Title saveSOIssueNotifyOrderList + * @param data + * @author rq + * @date 2024/9/2 16:06 + * @return R + * @throw + */ + @PostMapping(value="/saveSOIssueNotifyOrderList") + @ResponseBody + public R saveSOIssueNotifyOrderList(@RequestBody SOIssueNotifyOrderList data) { + /*Double itemNo= issureNotifyService.saveSOIssueNotifyOrderList(data); + return R.ok().put("itemNo",itemNo);*/ + return R.ok(); + } + + /** + * @Description TODO + * @Title saveMaterialDetail + * @param data + * @author rq + * @date 2024/9/2 17:05 + * @return R + * @throw + */ + @PostMapping(value="/saveMaterialDetail") + @ResponseBody + public R saveMaterialDetail(@RequestBody List data) { + issureNotifyService.saveMaterialDetail(data); + return R.ok(); + } + + /** + * @Description TODO + * @Title deleteNotifySOS + * @param data + * @author rq + * @date 2024/9/3 9:09 + * @return R + * @throw + */ + @PostMapping(value="/deleteNotifySOS") + @ResponseBody + public R deleteNotifySOS(@RequestBody SOIssueNotifyOrderListData data) { + issureNotifyService.deleteNotifySOS(data); + return R.ok(); + } + + + @PostMapping(value="/xiadaNotify") + @ResponseBody + public R xiadaNotifyHeader(@RequestBody SOIssueNotifyHeaderData data) { + issureNotifyService.xiadaNotifyHeader(data); + return R.ok(); + } + + + @PostMapping(value="/deleteNotify") + @ResponseBody + public R deleteNotifyHeader(@RequestBody SOIssueNotifyHeaderData data) { + issureNotifyService.deleteNotifyHeader(data); + return R.ok(); + } + + + @PostMapping(value="/searchNotifyHeader") + @ResponseBody + public R searchNotifyHeader(@RequestBody SOIssueNotifyHeaderData data) { + /*PageUtils page = issureNotifyService.searchNotifyHeader(data); + return R.ok().put("page", page);*/ + return R.ok(); + } + + + @PostMapping(value="/searchNotifyOrderList") + @ResponseBody + public R searchNotifyOrderList(@RequestBody SOIssueNotifyHeaderData data) { + List rows = issureNotifyService.searchNotifyOrderList(data); + return R.ok().put("rows", rows); + } + @PostMapping(value="/searchNotifyMaterialList") + @ResponseBody + public R searchNotifyMaterialList(@RequestBody SOIssueNotifyHeaderData data) { + List rows = issureNotifyService.searchNotifyMaterialList(data); + return R.ok().put("rows", rows); + } + + @PostMapping(value="/searchSumNotifyMaterialList") + @ResponseBody + public R searchSumNotifyMaterialList(@RequestBody SOIssueNotifyHeaderData data) { + List rows = issureNotifyService.searchSumNotifyMaterialList(data); + return R.ok().put("rows", rows); + } + /* + * @Description 非BOM物料 + * @Title getNoControlPartList + * @param data + * @author rq + * @date 2024/10/28 9:36 + * @return R + * @throw + */ + /*@PostMapping(value="/getPartList") + @ResponseBody + public R getPartList(@RequestBody PartData data) { + List rows = issureNotifyService.getPartList(data); + return R.ok().put("rows", rows); + } + + @PostMapping(value="/getNoControlPartList") + @ResponseBody + public R getNoControlPartList(@RequestBody PartData data) { + List rows = issureNotifyService.getNoControlPartList(data); + return R.ok().put("rows", rows); + } + @PostMapping(value="/searchNotifyLog") + @ResponseBody + public R searchNotifyLog(@RequestBody IssueNotifyChangeLog data) { + List rows = issureNotifyService.searchIssueNotifyChangeLog(data); + return R.ok().put("rows", rows); + }*/ + + @PostMapping(value = "/checkPartStock") + @ResponseBody + public R checkPartStock(@RequestBody SOIssueNotifyHeaderData data){ + List rows = issureNotifyService.checkPartStock(data); + return R.ok().put("rows", rows); + } + + @PostMapping(value="/deleteNotifySOSPlus") + @ResponseBody + public R deleteNotifySOSPlus(@RequestBody SOIssueNotifyOrderListData data) { + //issureNotifyService.deleteNotifySOSPlus(data); + return R.ok(); + } + @PostMapping(value="/updateNotifyStatus") + @ResponseBody + public R updateNotifyStatus(@RequestBody SOIssueNotifyHeaderData data) { + issureNotifyService.updateNotifyStatus(data); + return R.ok(); + } + + @PostMapping(value="/deleteNotifyMaterial") + @ResponseBody + public R deleteNotifyMaterial(@RequestBody SOIssueNotifyOrderMaterialListData data) { + //issureNotifyService.deleteNotifyMaterial(data); + return R.ok(); + } + @PostMapping(value="/deleteNotifyMaterialWithOutLog") + @ResponseBody + public R deleteNotifyMaterialWithOutLog(@RequestBody SOIssueNotifyOrderMaterialListData data) { + //issureNotifyService.deleteNotifyMaterialWithOutLog(data); + return R.ok(); + } + /** + * @Description 保存非bom和管控物料 + * @Title saveOtherPart + * @param data + * @author rq + * @date 2024/10/25 17:52 + * @return R + * @throw + */ + @PostMapping(value="/saveOtherPart") + @ResponseBody + public R saveOtherPart(@RequestBody SOIssueNotifyOrderMaterialListData data) { + //issureNotifyService.saveOtherPart(data); + return R.ok(); + } + + /*@PostMapping(value="/searchNotifyLogClose") + @ResponseBody + public R searchNotifyLogClose(@RequestBody SOIssueNotifyLogData data) { + List rows = issureNotifyService.searchNotifyLogClose(data); + return R.ok().put("rows", rows); + }*/ + + @PostMapping(value="/updateNotifyConfirmStatus") + @ResponseBody + public R updateNotifyConfirmStatus(@RequestBody SOIssueNotifyHeaderData data) throws Exception{ + /*Boolean flag = issureNotifyService.updateNotifyConfirmStatus(data); + if(flag){ + return R.ok(); + }*/ + return R.error(); + } + + @PostMapping(value="/updateNotifyBatchConfirmStatus") + public R updateNotifyBatchConfirmStatus(@RequestBody String[] notifyNos){ + /*Boolean flag = issureNotifyService.updateBatchConfirmStatus(notifyNos); + if(flag){ + return R.ok(); + }*/ + return R.error(); + } + + /** + * 导入领用单 + * @param file + * @param data + * @return + */ + @PostMapping("/saveIssureNotifyByExcel") + public R saveIssureNotifyByExcel(@RequestParam(value = "file") MultipartFile file, @ModelAttribute SOIssueNotifyHeaderData data){ + String msg = issureNotifyService.saveIssureNotifyByExcel(file, data); + return R.ok().put("errorMsg", msg); + } +} diff --git a/src/main/java/com/gaotao/modules/notify/entity/SOIssueNotifyHeader.java b/src/main/java/com/gaotao/modules/notify/entity/SOIssueNotifyHeader.java new file mode 100644 index 0000000..532c1f8 --- /dev/null +++ b/src/main/java/com/gaotao/modules/notify/entity/SOIssueNotifyHeader.java @@ -0,0 +1,206 @@ +package com.gaotao.modules.notify.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.Date; + +@Data +@TableName(value = "SOIssueNotifyHeader") +public class SOIssueNotifyHeader implements Serializable { + /** + * + */ + @TableField("NotifyNo") + private String notifyNo; + + /** + * + */ + @TableId + @TableField("Site") + private String site; + + /** + * + */ + @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @TableField("NotifyDate") + private Date notifyDate; + + /** + * + */ + @TableField("UserName") + private String userName; + + /** + * + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @TableField("EnteredDate") + private Date enteredDate; + + /** + * + */ + @TableField("Receiver") + private String receiver; + + /** + * + */ + @TableField("DepartmentID") + private String departmentID; + + /** + * + */ + @TableField("Remark") + private String remark; + + /** + * + */ + @TableField("CreditFlag") + private String creditFlag; + + /** + * + */ + @TableField("IssueFlag") + private String issueFlag; + private String bu; + /** + * + */ + @TableField("IssueResult") + private String issueResult; + + /** + * + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @TableField("PlanIssueDate") + private Date planIssueDate; + + /** + * + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @TableField("RealIssueDate") + private Date realIssueDate; + + /** + * + */ + @TableField("Status") + private String status; + + /** + * + */ + @TableField("HaveIssueRecordFlag") + private String haveIssueRecordFlag; + + /** + * + */ + @TableField("CalcFlag") + private String calcFlag; + + /** + * + */ + @TableField("NeedApproveFlag") + private String needApproveFlag; + + /** + * + */ + @TableField("ApprovedFlag") + private String approvedFlag; + + /** + * + */ + @TableField("Approver") + private String approver; + + /** + * + */ + @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @TableField("ApproveDate") + private Date approveDate; + + /** + * + */ + @TableField("WarehouseID") + private String warehouseID; + + /** + * + */ + @TableField("RecordVersion") + private String recordVersion; + + /** + * + */ + @TableField("OutWorkOrderFlag") + private String outWorkOrderFlag; + + /** + * + */ + @TableField("ProjectID") + private String projectID; + + /** + * + */ + @TableField("OrderType") + private String orderType; + + /** + * + */ + @TableField("AuthRuleID") + private String authRuleID; + + /** + * 确认状态 + */ + private String confirmStatus; + + + private int confirmUserId; + + + private String confirmUsername; + + + private String confirmUserDisplay; + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + //@TableField(updateStrategy = FieldStrategy.IGNORED) + private Date confirmDate; + + private String handlerUsername; + + private String handlerDisplay; +} + diff --git a/src/main/java/com/gaotao/modules/notify/entity/SOIssueNotifyHeaderData.java b/src/main/java/com/gaotao/modules/notify/entity/SOIssueNotifyHeaderData.java new file mode 100644 index 0000000..c9c258c --- /dev/null +++ b/src/main/java/com/gaotao/modules/notify/entity/SOIssueNotifyHeaderData.java @@ -0,0 +1,30 @@ +package com.gaotao.modules.notify.entity; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.apache.ibatis.type.Alias; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; +import java.util.List; + +@Data +@Alias("SOIssueNotifyHeaderData") +public class SOIssueNotifyHeaderData extends SOIssueNotifyHeader { + + @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date startDate; + + @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date endDate; + private List workShopList; + private String workShopId; + private String buDesc; + private String userDisplay; + private String sql; + private String workShopName; + private String closeRemark; + private String username; +} diff --git a/src/main/java/com/gaotao/modules/notify/entity/SOIssueNotifyOrderList.java b/src/main/java/com/gaotao/modules/notify/entity/SOIssueNotifyOrderList.java new file mode 100644 index 0000000..40e18ce --- /dev/null +++ b/src/main/java/com/gaotao/modules/notify/entity/SOIssueNotifyOrderList.java @@ -0,0 +1,64 @@ +package com.gaotao.modules.notify.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +@Data +@TableName(value = "SOIssueNotifyOrderList") +public class SOIssueNotifyOrderList implements Serializable { + /** + * + */ + private String notifyNo; + + /** + * + */ + private String site; + + /** + * + */ + private Double itemNo; + + /** + * + */ + private String fGPartNo; + + /** + * + */ + private String sOOrderNo; + + /** + * + */ + private Double opsItemNo; + + /** + * + */ + private String seqNo; + + /** + * + */ + private BigDecimal issureQty; + + /** + * + */ + private String outWorkOrderFlag; + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date needDate; + private String locationNo; +} + diff --git a/src/main/java/com/gaotao/modules/notify/entity/SOIssueNotifyOrderListData.java b/src/main/java/com/gaotao/modules/notify/entity/SOIssueNotifyOrderListData.java new file mode 100644 index 0000000..d70bc1f --- /dev/null +++ b/src/main/java/com/gaotao/modules/notify/entity/SOIssueNotifyOrderListData.java @@ -0,0 +1,11 @@ +package com.gaotao.modules.notify.entity; + +import lombok.Data; +import org.apache.ibatis.type.Alias; + +@Data +@Alias("SOIssueNotifyOrderListData") +public class SOIssueNotifyOrderListData extends SOIssueNotifyOrderList { + private String itemDesc; + private String partDesc; +} diff --git a/src/main/java/com/gaotao/modules/notify/entity/SOIssueNotifyOrderMaterialList.java b/src/main/java/com/gaotao/modules/notify/entity/SOIssueNotifyOrderMaterialList.java new file mode 100644 index 0000000..db4a144 --- /dev/null +++ b/src/main/java/com/gaotao/modules/notify/entity/SOIssueNotifyOrderMaterialList.java @@ -0,0 +1,50 @@ +package com.gaotao.modules.notify.entity; + + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +@Data +@TableName(value = "SOIssueNotifyOrderMaterialList") +public class SOIssueNotifyOrderMaterialList { + /** + * + */ + private String notifyNo; + + /** + * + */ + private String site; + + /** + * + */ + private Double itemNo; + + + /** + * + */ + private String bOMItemNo; + + + + /** + * + */ + private String componentPartNo; + + /** + * + */ + private Double qtyToIssue; + + /** + * + */ + private Double qtyToIssueOriginal; + private String issueType; + private String remark; +} + diff --git a/src/main/java/com/gaotao/modules/notify/entity/SOIssueNotifyOrderMaterialListData.java b/src/main/java/com/gaotao/modules/notify/entity/SOIssueNotifyOrderMaterialListData.java new file mode 100644 index 0000000..67e9e46 --- /dev/null +++ b/src/main/java/com/gaotao/modules/notify/entity/SOIssueNotifyOrderMaterialListData.java @@ -0,0 +1,35 @@ +package com.gaotao.modules.notify.entity; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.apache.ibatis.type.Alias; +import org.springframework.format.annotation.DateTimeFormat; + +import java.math.BigDecimal; +import java.util.Date; + +@Data +@Alias("SOIssueNotifyOrderMaterialListData") +public class SOIssueNotifyOrderMaterialListData extends SOIssueNotifyOrderMaterialList { + private String partDesc; + private Double qtyRequired; + private BigDecimal qtyIssue; + private Double qtyOnHand; + private Double qtyAvailable; + private String orderNo; + private String locationNo; + private String str; + private Double stockQty; + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date needDate; + /** + * + */ + private Double opsItemNo; + + /** + * + */ + private String seqNo; +} diff --git a/src/main/java/com/gaotao/modules/notify/mapper/IssureNotifyMapper.java b/src/main/java/com/gaotao/modules/notify/mapper/IssureNotifyMapper.java new file mode 100644 index 0000000..83746eb --- /dev/null +++ b/src/main/java/com/gaotao/modules/notify/mapper/IssureNotifyMapper.java @@ -0,0 +1,124 @@ +package com.gaotao.modules.notify.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gaotao.modules.base.entity.PartData; +import com.gaotao.modules.base.entity.SOScheduledRoutingData; +import com.gaotao.modules.notify.entity.*; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +@Mapper +public interface IssureNotifyMapper extends BaseMapper { + + /** + * @Description 获取用户下面未下达领料申请单 + * @Title getUserNotifyNo + * @param inData + * @author rq + * @date 2024/8/30 14:39 + * @return SOIssueNotifyHeaderData + * @throw + */ + SOIssueNotifyHeaderData getUserNotifyNo(SOIssueNotifyHeaderData inData); + + /** + * @Description TODO + * @Title createNotify + * @param data + * @author rq + * @date 2024/8/30 16:39 + * @return void + * @throw + */ + void createNotify(SOIssueNotifyHeaderData data); + void updateNotifyBu(SOIssueNotifyHeaderData data); + /** + * @Description 根据申请单号找派工单子明细 + * @Title getNotifyNoDetail + * @param data + * @author rq + * @date 2024/9/1 19:02 + * @return List + * @throw + */ + List getNotifyNoDetail(SOIssueNotifyHeaderData data); + + /** + * @Description 查找可以发料的派工单 + * @Title getSOScheduledRoutingListForIssure + * @param data + * @author rq + * @date 2024/9/2 9:33 + * @return List + * @throw + */ + List getSOScheduledRoutingListForIssure(SOScheduledRoutingData data); + + + /** + * @Description 获取生产订单BOM + * @Title getSOSBOMForIssure + * @param data + * @author rq + * @date 2024/9/2 14:35 + * @return List + * @throw + */ + List getSOSBOMForIssure(SOScheduledRoutingData data); + + Double getNextItemForSOIssueNotifyOrderList(SOIssueNotifyOrderList data); + List searchOtherPart(SOIssueNotifyOrderMaterialListData data); + void saveSOIssueNotifyOrderList(SOIssueNotifyOrderList data); + + void deleteSOIssueNotifyOrderMaterialListData(SOIssueNotifyOrderMaterialListData data); + + void batchSaveSOIssueNotifyOrderMaterialListData(List data); + void saveSOIssueNotifyOrderMaterialListData(SOIssueNotifyOrderMaterialListData data); + void deleteNotifySOS(SOIssueNotifyOrderListData data); + + void xiadaNotifyHeader(SOIssueNotifyHeaderData data); + + void deleteNotifyHeader(SOIssueNotifyHeaderData data); + + IPage searchNotifyHeader(Page soIssueNotifyHeaderDataPage, @Param("query") SOIssueNotifyHeaderData data); + + List searchNotifyOrderList(SOIssueNotifyHeaderData data); + + List searchNotifyMaterialList(SOIssueNotifyHeaderData data); + + List searchSumNotifyMaterialList(SOIssueNotifyHeaderData data); + + List getPartList(PartData data); + + List getNoControlPartList(PartData data); + + List checkPartStock(SOIssueNotifyHeaderData data); + + List checkDeleteOrderList(SOIssueNotifyOrderListData data); + + + void updateNotifyStatus(SOIssueNotifyHeaderData data); + + List checkDeleteMaterial(SOIssueNotifyOrderMaterialListData data); + + void deleteNotifyMaterial(SOIssueNotifyOrderMaterialListData data); + + /*void saveIssueNotifyChangeLog(IssueNotifyChangeLog data);*/ + + //List getSOIssueNotifyOrderListData(SOIssueNotifyOrderMaterialListData Data); + + List checkOtherPart(SOIssueNotifyOrderMaterialListData data); + + String getNextBomItemNo(SOIssueNotifyOrderMaterialListData data); + + /*List searchIssueNotifyChangeLog(IssueNotifyChangeLog data);*/ + + void insertNotifyLogClose(SOIssueNotifyHeaderData inData); + + /*List searchNotifyLogClose(SOIssueNotifyLogData data);*/ + +} diff --git a/src/main/java/com/gaotao/modules/notify/service/IssureNotifyService.java b/src/main/java/com/gaotao/modules/notify/service/IssureNotifyService.java new file mode 100644 index 0000000..9e898d5 --- /dev/null +++ b/src/main/java/com/gaotao/modules/notify/service/IssureNotifyService.java @@ -0,0 +1,137 @@ +package com.gaotao.modules.notify.service; + +import com.gaotao.modules.base.entity.SOScheduledRoutingData; +import com.gaotao.modules.notify.entity.SOIssueNotifyHeaderData; +import com.gaotao.modules.notify.entity.SOIssueNotifyOrderList; +import com.gaotao.modules.notify.entity.SOIssueNotifyOrderListData; +import com.gaotao.modules.notify.entity.SOIssueNotifyOrderMaterialListData; +import org.springframework.web.multipart.MultipartFile; + +import java.text.ParseException; +import java.util.List; + +public interface IssureNotifyService { + + /** + * @Description 获取用户下面未下达领料申请单 + * @Title getUserNotifyNo + * @param inData + * @author rq + * @date 2024/8/30 14:39 + * @return SOIssueNotifyHeaderData + * @throw + */ + SOIssueNotifyHeaderData getUserNotifyNo(SOIssueNotifyHeaderData inData); + + /** + * @Description 创建申请单 + * @Title createNotify + * @param data + * @author rq + * @date 2024/8/30 15:56 + * @return void + * @throw + */ + //void createNotify(SOIssueNotifyHeaderData data) throws ParseException; + + void updateNotifyBu(SOIssueNotifyHeaderData data); + + /** + * @Description 根据申请单号找派工单子明细 + * @Title getNotifyNoDetail + * @param data + * @author rq + * @date 2024/9/1 19:02 + * @return List + * @throw + */ + List getNotifyNoDetail(SOIssueNotifyHeaderData data); + + /** + * @Description TODO + * @Title getSOScheduledRoutingListForIssure + * @param data + * @author rq + * @date 2024/9/2 9:33 + * @return List + * @throw + */ + List getSOScheduledRoutingListForIssure(SOScheduledRoutingData data); + + /** + * @Description 获取生产订单BOM + * @Title getSOSBOMForIssure + * @param data + * @author rq + * @date 2024/9/2 14:35 + * @return List + * @throw + */ + List getSOSBOMForIssure(SOScheduledRoutingData data); + List searchOtherPart(SOIssueNotifyOrderMaterialListData data); + /** + * @Description 保存派工单子明细 + * @Title saveSOIssueNotifyOrderList + * @param data + * @author rq + * @date 2024/9/2 16:07 + * @return void + * @throw + */ + //Double saveSOIssueNotifyOrderList(SOIssueNotifyOrderList data); + + /** + * @Description TODO + * @Title saveMaterialDetail + * @param data + * @author rq + * @date 2024/9/2 17:06 + * @return void + * @throw + */ + void saveMaterialDetail(List data); + + void deleteNotifySOS(SOIssueNotifyOrderListData data); + + + void xiadaNotifyHeader(SOIssueNotifyHeaderData data); + + void deleteNotifyHeader(SOIssueNotifyHeaderData data); + + + //PageUtils searchNotifyHeader(SOIssueNotifyHeaderData data); + + List searchNotifyOrderList(SOIssueNotifyHeaderData data); + + List searchNotifyMaterialList(SOIssueNotifyHeaderData data); + + + List searchSumNotifyMaterialList(SOIssueNotifyHeaderData data); + + //List getPartList(PartData data); + + List checkPartStock(SOIssueNotifyHeaderData data); + + //void deleteNotifySOSPlus(SOIssueNotifyOrderListData data); + + void updateNotifyStatus(SOIssueNotifyHeaderData data); + + String saveIssureNotifyByExcel(MultipartFile file, SOIssueNotifyHeaderData data); + + /*void deleteNotifyMaterial(SOIssueNotifyOrderMaterialListData data); + void deleteNotifyMaterialWithOutLog(SOIssueNotifyOrderMaterialListData data); + void saveOtherPart(SOIssueNotifyOrderMaterialListData data);*/ + + +// List getNoControlPartList(PartData data); +// +// +// List searchIssueNotifyChangeLog(IssueNotifyChangeLog data); +// +// +// List searchNotifyLogClose(SOIssueNotifyLogData data); + + /*Boolean updateNotifyConfirmStatus(SOIssueNotifyHeaderData data)throws Exception; + + Boolean updateBatchConfirmStatus(String[] notifyNos);*/ +} diff --git a/src/main/java/com/gaotao/modules/notify/service/impl/IssureNotifyServiceImpl.java b/src/main/java/com/gaotao/modules/notify/service/impl/IssureNotifyServiceImpl.java new file mode 100644 index 0000000..c37f1e9 --- /dev/null +++ b/src/main/java/com/gaotao/modules/notify/service/impl/IssureNotifyServiceImpl.java @@ -0,0 +1,431 @@ +package com.gaotao.modules.notify.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gaotao.modules.base.entity.SOScheduledRoutingData; +import com.gaotao.modules.notify.entity.SOIssueNotifyHeaderData; +import com.gaotao.modules.notify.entity.SOIssueNotifyOrderListData; +import com.gaotao.modules.notify.entity.SOIssueNotifyOrderMaterialListData; +import com.gaotao.modules.notify.mapper.IssureNotifyMapper; +import com.gaotao.modules.notify.service.IssureNotifyService; +import com.gaotao.modules.sys.entity.SysUserEntity; +import com.gaotao.modules.trans.entity.TransNoControl; +import com.gaotao.modules.trans.service.TransNoControlService; +import org.apache.commons.lang.StringUtils; +import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.CellType; +import org.apache.poi.ss.usermodel.DataFormatter; +import org.apache.poi.xssf.usermodel.XSSFRow; +import org.apache.poi.xssf.usermodel.XSSFSheet; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.apache.shiro.SecurityUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.multipart.MultipartFile; + +import java.io.InputStream; +import java.text.ParseException; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.stream.Collectors; + +@Service +public class IssureNotifyServiceImpl implements IssureNotifyService { + + @Autowired + private IssureNotifyMapper issureNotifyMapper; + @Autowired + private TransNoControlService transNoService; + /*@Autowired + private EamMapper eamMapper;*/ + + @Override + public SOIssueNotifyHeaderData getUserNotifyNo(SOIssueNotifyHeaderData inData){ + return issureNotifyMapper.getUserNotifyNo(inData); + } + + @Override + public void updateNotifyBu (SOIssueNotifyHeaderData inData){ + issureNotifyMapper.updateNotifyBu(inData); + } + + //@Override + @Transactional + public void createNotify(SOIssueNotifyHeaderData data) throws ParseException { + SysUserEntity currentUser = (SysUserEntity) SecurityUtils.getSubject().getPrincipal(); + String transType = "SOIA"; + // 获取流水号,出错不回滚 + TransNoControl transNo = transNoService.getTransNo(data.getSite(),transType,8); + data.setNotifyNo(transNo.getNewTransNo()); + data.setNotifyDate(new Date()); + data.setEnteredDate(new Date()); + data.setReceiver(""); + data.setDepartmentID(""); + data.setRemark(""); + data.setCreditFlag("N"); + data.setIssueFlag("N"); + data.setIssueResult(""); + data.setStatus("已计划"); + data.setHaveIssueRecordFlag("N"); + data.setCalcFlag("N"); + data.setNeedApproveFlag("N"); + data.setApprovedFlag("N"); + data.setOutWorkOrderFlag("N"); + data.setProjectID(""); + data.setOrderType(""); + issureNotifyMapper.createNotify(data); + } + + @Override + public List getNotifyNoDetail(SOIssueNotifyHeaderData data){ + return issureNotifyMapper.getNotifyNoDetail(data); + } + + @Override + public List getSOScheduledRoutingListForIssure(SOScheduledRoutingData data){ + return issureNotifyMapper.getSOScheduledRoutingListForIssure(data); + } + + @Override + public List getSOSBOMForIssure(SOScheduledRoutingData data){ + return issureNotifyMapper.getSOSBOMForIssure(data); + } + @Override + public List searchOtherPart(SOIssueNotifyOrderMaterialListData data){ + return issureNotifyMapper.searchOtherPart(data); + } + + /*@Override + public Double saveSOIssueNotifyOrderList(SOIssueNotifyOrderList data){ + Double nextItem=issureNotifyMapper.getNextItemForSOIssueNotifyOrderList(data); + data.setItemNo(nextItem); + issureNotifyMapper.saveSOIssueNotifyOrderList(data); + return nextItem; + }*/ + + @Override + @Transactional + public void saveMaterialDetail(List data){ + issureNotifyMapper.deleteSOIssueNotifyOrderMaterialListData(data.get(0)); + for (int i = 0; i < data.size(); i++) { + data.get(i).setIssueType("BOM物料"); + } + issureNotifyMapper.batchSaveSOIssueNotifyOrderMaterialListData(data); + } + + @Override + @Transactional + public void deleteNotifySOS(SOIssueNotifyOrderListData data){ + issureNotifyMapper.deleteNotifySOS(data); + SOIssueNotifyOrderMaterialListData deleteData=new SOIssueNotifyOrderMaterialListData(); + deleteData.setNotifyNo(data.getNotifyNo()); + deleteData.setSite(data.getSite()); + deleteData.setItemNo(data.getItemNo()); + issureNotifyMapper.deleteSOIssueNotifyOrderMaterialListData(deleteData); + } + + @Override + public void xiadaNotifyHeader(SOIssueNotifyHeaderData data){ + issureNotifyMapper.xiadaNotifyHeader(data); + } + + @Override + public void deleteNotifyHeader(SOIssueNotifyHeaderData data){ + issureNotifyMapper.deleteNotifyHeader(data); + } + + @Override + /*public PageUtils searchNotifyHeader(SOIssueNotifyHeaderData data){ + if(data.getWorkShopList().size()>0){ + String str="("; + for (int i = 0; i resultList = issureNotifyMapper.searchNotifyHeader(new Page(data.getPage(), data.getLimit()), data); + return new PageUtils(resultList); + }*/ + + public List searchNotifyOrderList(SOIssueNotifyHeaderData data){ + return issureNotifyMapper.searchNotifyOrderList(data); + } + + @Override + public List searchNotifyMaterialList(SOIssueNotifyHeaderData data){ + return issureNotifyMapper.searchNotifyMaterialList(data); + } + + @Override + public List searchSumNotifyMaterialList(SOIssueNotifyHeaderData data){ + return issureNotifyMapper.searchSumNotifyMaterialList(data); + } + /*@Override + public List getPartList(PartData data){ + return issureNotifyMapper.getPartList(data); + }*/ + @Override + public List checkPartStock(SOIssueNotifyHeaderData data){ + return issureNotifyMapper.checkPartStock(data); + } + + /*@Override + @Transactional + public void deleteNotifySOSPlus(SOIssueNotifyOrderListData data){ + List checkDeleteOrderList=issureNotifyMapper.checkDeleteOrderList(data); + if(checkDeleteOrderList.size()>0){ + throw new RuntimeException("领料单内有明细记录无法删除!"); + } + issureNotifyMapper.deleteNotifySOS(data); + IssueNotifyChangeLog issueNotifyChangeLog=new IssueNotifyChangeLog(); + issueNotifyChangeLog.setSite(data.getSite()); + issueNotifyChangeLog.setNotifyNo(data.getNotifyNo()); + issueNotifyChangeLog.setItemNo(data.getItemNo()); + issueNotifyChangeLog.setsOOrderNo(data.getsOOrderNo()); + issueNotifyChangeLog.setSeqNo(data.getSeqNo()); + issueNotifyChangeLog.setComponentPartNo(""); + issueNotifyChangeLog.setQtyToIssue(null); + issueNotifyChangeLog.setUpdateBy(String.valueOf(((SysUserEntity) SecurityUtils.getSubject().getPrincipal()).getUsername())); + issueNotifyChangeLog.setUpdateType("删除申请单派工单明细"); + issueNotifyChangeLog.setUpdateDate(new Date()); + issureNotifyMapper.saveIssueNotifyChangeLog(issueNotifyChangeLog); + }*/ + + @Override + @Transactional + public void updateNotifyStatus(SOIssueNotifyHeaderData data){ + issureNotifyMapper.updateNotifyStatus(data); + if("已关闭".equals(data.getStatus())){ + issureNotifyMapper.insertNotifyLogClose(data); + } + } + + @Override + public String saveIssureNotifyByExcel(MultipartFile file, SOIssueNotifyHeaderData data) { + SysUserEntity currentUser = (SysUserEntity) SecurityUtils.getSubject().getPrincipal(); + List excelList = new ArrayList<>(); + try { + // 转流 + InputStream is = file.getInputStream(); + // 读取工作簿 + XSSFWorkbook workbook = new XSSFWorkbook(is); + // 读取工作表 + XSSFSheet sheet = workbook.getSheetAt(0); + // 剔除空行 + deleteEmptyRow(sheet); + // 获取行数 + int rows = sheet.getPhysicalNumberOfRows(); + // 遍历每一行(从第二行开始) + StringBuilder sb = new StringBuilder("第"); + for (int j = 1; j < rows; j++) { + // 创建对象 + SOIssueNotifyHeaderData task = new SOIssueNotifyHeaderData(); + // 获得该行 + XSSFRow row = sheet.getRow(j); + if (row.getCell(0) == null ) { + throw new RuntimeException("第" + j + "行的SKU不能为空!"); + } + // 为对象赋值 + /*task.setSite(site); + task.setSku(getStringCellValue(row, 0)); + task.setSo(getStringCellValue(row, 1)); + task.setQty(getNumericCellValueOrDefault(row, 2));*/ + List orderDataList = new ArrayList<>(); // sqlSession.selectList("ecssMapper" + "." + "searchWalMartOrderList", task); + if (!orderDataList.isEmpty()) { + if (sb.toString().length()>1) { + sb.append(",").append(j); + } else { + sb.append(j); + } + //throw new RuntimeException("第" + j + "行的SKU和数量已存在!"); + continue; + } + System.out.println(getStringCellValue(row, 3)); + + /*task.setRolls(getNumericCellValueOrDefault(row, 3)); + task.setGrossWeight(getNumericCellValueOrDefault(row, 4)); + task.setVerificationSheet(getStringCellValue(row, 5)); + task.setCreateBy(currentUser.getUserDisplay());*/ + excelList.add(task); + } + if (!excelList.isEmpty()) { + //issureNotifyMapper.batchSaveWalMartOrder(excelList); + } + if (sb.toString().equals("第")) { + sb= new StringBuilder(); + } else { + sb.append("行的SKU和数量已存在!"); + } + return sb.toString(); + } catch (Exception e) { + throw new RuntimeException("导入失败:" + e.getMessage()); + } + } + + private String getStringCellValue(XSSFRow row, int columnIndex) { + Cell cell = row.getCell(columnIndex); + if (cell == null || cell.getCellType() == CellType.BLANK) { + return ""; + } + DataFormatter formatter = new DataFormatter(); + return formatter.formatCellValue(cell); + } + + private static void deleteEmptyRow(XSSFSheet sheet) { + for (int i = 0; i <= sheet.getLastRowNum(); i++) { + XSSFRow row = sheet.getRow(i); + boolean isEmptyRow = true; + if (row != null) { + for (Cell cell : row) { + if (cell.getCellType() != CellType.BLANK && cell.getCellType() != CellType.ERROR && + !StringUtils.isBlank(String.valueOf(cell))) { + isEmptyRow = false; + break; + } + } + if (isEmptyRow) { + sheet.removeRow(row); // 删除空行 + } + } + } + } + + /*@Override + @Transactional + public void deleteNotifyMaterial(SOIssueNotifyOrderMaterialListData data){ + List checkDeleteMaterial=issureNotifyMapper.checkDeleteMaterial(data); + if(checkDeleteMaterial.size()==0){ + throw new RuntimeException("该记录已不存在!"); + } + if(checkDeleteMaterial.get(0).getQtyToIssueOriginal()>0.0){ + throw new RuntimeException("该记录已有领料记录无法删除!"); + } + issureNotifyMapper.deleteNotifyMaterial(data); + + IssueNotifyChangeLog issueNotifyChangeLog=new IssueNotifyChangeLog(); + List checkList=issureNotifyMapper.getSOIssueNotifyOrderListData(data); + if(checkList.size()>0){ + issueNotifyChangeLog.setsOOrderNo(checkList.get(0).getsOOrderNo()); + issueNotifyChangeLog.setSeqNo(checkList.get(0).getSeqNo()); + + } + issueNotifyChangeLog.setSite(data.getSite()); + issueNotifyChangeLog.setNotifyNo(data.getNotifyNo()); + issueNotifyChangeLog.setItemNo(data.getItemNo()); + issueNotifyChangeLog.setComponentPartNo(data.getComponentPartNo()); + issueNotifyChangeLog.setQtyToIssue(data.getQtyToIssue()); + issueNotifyChangeLog.setUpdateBy(String.valueOf(((SysUserEntity) SecurityUtils.getSubject().getPrincipal()).getUsername())); + issueNotifyChangeLog.setUpdateType("删除申请单材料明细"); + issueNotifyChangeLog.setUpdateDate(new Date()); + issueNotifyChangeLog.setIssueType(data.getIssueType()); + issureNotifyMapper.saveIssueNotifyChangeLog(issueNotifyChangeLog); + }*/ + /*@Override + @Transactional + public void deleteNotifyMaterialWithOutLog(SOIssueNotifyOrderMaterialListData data){ + List checkDeleteMaterial=issureNotifyMapper.checkDeleteMaterial(data); + if(checkDeleteMaterial.size()==0){ + throw new RuntimeException("该记录已不存在!"); + } + if(checkDeleteMaterial.get(0).getQtyToIssueOriginal()>0.0){ + throw new RuntimeException("该记录已有领料记录无法删除!"); + } + issureNotifyMapper.deleteNotifyMaterial(data); + + } + @Override + public void saveOtherPart(SOIssueNotifyOrderMaterialListData data){ + List checkOtherPart=issureNotifyMapper.checkOtherPart(data); + if(checkOtherPart.size()>0){ + throw new RuntimeException("该物料已有申请记录!"); + } + if(data.getIssueType().equals("非BOM物料")){ + data.setStr("noBom-"); + }else { + data.setStr("noControl-"); + } + String nextBomItemNo=issureNotifyMapper.getNextBomItemNo(data); + + data.setbOMItemNo(nextBomItemNo); + issureNotifyMapper.saveSOIssueNotifyOrderMaterialListData(data); + } + + @Override + public List getNoControlPartList(PartData data){ + return issureNotifyMapper.getNoControlPartList(data); + } + + @Override + public List searchIssueNotifyChangeLog(IssueNotifyChangeLog data){ + return issureNotifyMapper.searchIssueNotifyChangeLog(data); + } + + @Override + public List searchNotifyLogClose(SOIssueNotifyLogData data){ + return issureNotifyMapper.searchNotifyLogClose(data); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Boolean updateNotifyConfirmStatus(SOIssueNotifyHeaderData data)throws Exception{ + SysUserEntity currentUser = (SysUserEntity) SecurityUtils.getSubject().getPrincipal(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("NotifyNo",data.getNotifyNo()); + queryWrapper.eq("Site",data.getSite()); + SOIssueNotifyHeader soIssueNotifyHeader = issureNotifyMapper.selectOne(queryWrapper); + if(soIssueNotifyHeader != null){ + if("Y".equals(data.getConfirmStatus())){ + soIssueNotifyHeader.setConfirmStatus("确认"); + soIssueNotifyHeader.setConfirmDate(new Date()); + soIssueNotifyHeader.setConfirmUserId(currentUser.getUserId().intValue()); + soIssueNotifyHeader.setConfirmUsername(currentUser.getUsername()); + soIssueNotifyHeader.setConfirmUserDisplay(currentUser.getUserDisplay()); + soIssueNotifyHeader.setStatus("已关闭"); + }else{ + soIssueNotifyHeader.setConfirmStatus("未确认"); + } + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper<>(); + updateWrapper.eq(SOIssueNotifyHeader::getNotifyNo,soIssueNotifyHeader.getNotifyNo()); + issureNotifyMapper.update(soIssueNotifyHeader,updateWrapper); + }else{ + throw new Exception("当前领料申请单不存在!"); + } + return true; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Boolean updateBatchConfirmStatus(String[] notifyNos) { + SysUserEntity currentUser = (SysUserEntity) SecurityUtils.getSubject().getPrincipal(); + + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.in("NotifyNo",notifyNos); + List soIssueNotifyHeaders = issureNotifyMapper.selectList(queryWrapper); + if(soIssueNotifyHeaders != null && soIssueNotifyHeaders.size()>0){ + List notifyHeaders = soIssueNotifyHeaders.stream().filter(obj -> !"确认".equals(obj.getConfirmStatus())).collect(Collectors.toList()); + for(SOIssueNotifyHeader soIssueNotifyHeader:notifyHeaders){ + soIssueNotifyHeader.setConfirmStatus("确认"); + soIssueNotifyHeader.setConfirmDate(new Date()); + soIssueNotifyHeader.setConfirmUserId(currentUser.getUserId().intValue()); + soIssueNotifyHeader.setConfirmUsername(currentUser.getUsername()); + soIssueNotifyHeader.setConfirmUserDisplay(currentUser.getUserDisplay()); + soIssueNotifyHeader.setStatus("已关闭"); + } + notifyHeaders.forEach(e->{ + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper<>(); + updateWrapper.eq(SOIssueNotifyHeader::getNotifyNo,e.getNotifyNo()); + issureNotifyMapper.update(e,updateWrapper); + }); + } + return true; + }*/ +} diff --git a/src/main/resources/mapper/notify/IssureNotifyMapper.xml b/src/main/resources/mapper/notify/IssureNotifyMapper.xml new file mode 100644 index 0000000..8374d59 --- /dev/null +++ b/src/main/resources/mapper/notify/IssureNotifyMapper.xml @@ -0,0 +1,365 @@ + + + + + + + insert into SOIssueNotifyHeader (NotifyNo,Site,NotifyDate,UserName,EnteredDate,Receiver,DepartmentID,Remark,CreditFlag,IssueFlag,IssueResult,PlanIssueDate, +RealIssueDate,Status,HaveIssueRecordFlag,CalcFlag,NeedApproveFlag,ApprovedFlag,Approver,ApproveDate,WarehouseID, +RecordVersion,OutWorkOrderFlag,ProjectID,OrderType,AuthRuleID,bu) + values(#{notifyNo},#{site},#{notifyDate},#{userName},#{enteredDate},#{receiver},#{departmentID},#{remark},#{creditFlag},#{issueFlag},#{issueResult},#{planIssueDate}, + #{realIssueDate},#{status},#{haveIssueRecordFlag},#{calcFlag},#{needApproveFlag},#{approvedFlag},#{approver},#{approveDate},#{warehouseID}, + #{recordVersion},#{outWorkOrderFlag},#{projectID},#{orderType},#{authRuleID},#{bu} + ) + + + update SOIssueNotifyHeader set bu=#{bu} where site=#{site} and NotifyNo=#{notifyNo} + + + + + + + + + + + + + + + + + + + + + + + + + insert into SOIssueNotifyOrderList(NotifyNo,Site,ItemNo,FGPartNo,SOOrderNo,OpsItemNo,SeqNo,IssureQty,OutWorkOrderFlag,LocationNo,needDate) + values(#{notifyNo},#{site},#{itemNo},#{fGPartNo},#{sOOrderNo},#{opsItemNo},#{seqNo},#{issureQty,jdbcType=DECIMAL},#{outWorkOrderFlag} + ,#{locationNo},#{needDate}) + + + delete from SOIssueNotifyOrderMaterialList where site=#{site} and NotifyNo=#{notifyNo} and ItemNo=#{itemNo} + + + + insert into SOIssueNotifyOrderMaterialList (NotifyNo,Site,ItemNo,BOMItemNo,ComponentPartNo,QtyToIssue,QtyToIssue_Original,issueType,remark) + values + + (#{item.notifyNo},#{item.site},#{item.itemNo},#{item.bOMItemNo},#{item.componentPartNo},#{item.qtyToIssue},0,#{item.issueType},#{item.remark}) + + + + + insert into SOIssueNotifyOrderMaterialList (NotifyNo,Site,ItemNo,BOMItemNo,ComponentPartNo,QtyToIssue,QtyToIssue_Original,issueType,remark) + values + + (#{notifyNo},#{site},#{itemNo},#{bOMItemNo},#{componentPartNo},#{qtyToIssue},0,#{issueType},#{remark}) + + + + + delete from SOIssueNotifyOrderList where site=#{site} and NotifyNo=#{notifyNo} and ItemNo=#{itemNo} + + + + update SOIssueNotifyHeader set PlanIssueDate=#{planIssueDate},remark=#{remark} ,status='已下达' where site=#{site} and NotifyNo=#{notifyNo} + + + + delete from SOIssueNotifyHeader where site=#{site} and NotifyNo=#{notifyNo} + + + + + + + + + + + + + + + + + + + + + update SOIssueNotifyHeader set status=#{status} + where Site=#{site} and NotifyNo=#{notifyNo} + + + + + insert into IssueNotifyChangeLog (Site,NotifyNo,ItemNo,SOOrderNo,SeqNo,ComponentPartNo,QtyToIssue,updateType,updateBy,updateDate,issueType) + values (#{site},#{notifyNo},#{itemNo},#{sOOrderNo},#{seqNo},#{componentPartNo},#{qtyToIssue,jdbcType=DOUBLE},#{updateType},#{updateBy},#{updateDate},#{issueType}) + + + + + + + + + + + + + + \ No newline at end of file