11 changed files with 1771 additions and 0 deletions
-
318src/main/java/com/gaotao/modules/notify/controller/IssureNotifyController.java
-
206src/main/java/com/gaotao/modules/notify/entity/SOIssueNotifyHeader.java
-
30src/main/java/com/gaotao/modules/notify/entity/SOIssueNotifyHeaderData.java
-
64src/main/java/com/gaotao/modules/notify/entity/SOIssueNotifyOrderList.java
-
11src/main/java/com/gaotao/modules/notify/entity/SOIssueNotifyOrderListData.java
-
50src/main/java/com/gaotao/modules/notify/entity/SOIssueNotifyOrderMaterialList.java
-
35src/main/java/com/gaotao/modules/notify/entity/SOIssueNotifyOrderMaterialListData.java
-
124src/main/java/com/gaotao/modules/notify/mapper/IssureNotifyMapper.java
-
137src/main/java/com/gaotao/modules/notify/service/IssureNotifyService.java
-
431src/main/java/com/gaotao/modules/notify/service/impl/IssureNotifyServiceImpl.java
-
365src/main/resources/mapper/notify/IssureNotifyMapper.xml
@ -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<SOIssueNotifyOrderListData> 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<SOScheduledRoutingData> rows = issureNotifyService.getSOScheduledRoutingListForIssure(data); |
|||
return R.ok().put("rows", rows); |
|||
} |
|||
@PostMapping(value="/getSOSBOMForIssure") |
|||
@ResponseBody |
|||
public R getSOSBOMForIssure(@RequestBody SOScheduledRoutingData data) { |
|||
List<SOIssueNotifyOrderMaterialListData> 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<SOIssueNotifyOrderMaterialListData> 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<SOIssueNotifyOrderMaterialListData> 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<SOIssueNotifyOrderListData> rows = issureNotifyService.searchNotifyOrderList(data); |
|||
return R.ok().put("rows", rows); |
|||
} |
|||
@PostMapping(value="/searchNotifyMaterialList") |
|||
@ResponseBody |
|||
public R searchNotifyMaterialList(@RequestBody SOIssueNotifyHeaderData data) { |
|||
List<SOIssueNotifyOrderMaterialListData> rows = issureNotifyService.searchNotifyMaterialList(data); |
|||
return R.ok().put("rows", rows); |
|||
} |
|||
|
|||
@PostMapping(value="/searchSumNotifyMaterialList") |
|||
@ResponseBody |
|||
public R searchSumNotifyMaterialList(@RequestBody SOIssueNotifyHeaderData data) { |
|||
List<SOIssueNotifyOrderMaterialListData> 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<PartData> rows = issureNotifyService.getPartList(data); |
|||
return R.ok().put("rows", rows); |
|||
} |
|||
|
|||
@PostMapping(value="/getNoControlPartList") |
|||
@ResponseBody |
|||
public R getNoControlPartList(@RequestBody PartData data) { |
|||
List<PartData> rows = issureNotifyService.getNoControlPartList(data); |
|||
return R.ok().put("rows", rows); |
|||
} |
|||
@PostMapping(value="/searchNotifyLog") |
|||
@ResponseBody |
|||
public R searchNotifyLog(@RequestBody IssueNotifyChangeLog data) { |
|||
List<IssueNotifyChangeLog> rows = issureNotifyService.searchIssueNotifyChangeLog(data); |
|||
return R.ok().put("rows", rows); |
|||
}*/ |
|||
|
|||
@PostMapping(value = "/checkPartStock") |
|||
@ResponseBody |
|||
public R checkPartStock(@RequestBody SOIssueNotifyHeaderData data){ |
|||
List<SOIssueNotifyOrderMaterialListData> 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<SOIssueNotifyLogData> 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); |
|||
} |
|||
} |
|||
@ -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; |
|||
} |
|||
|
|||
@ -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<String> workShopList; |
|||
private String workShopId; |
|||
private String buDesc; |
|||
private String userDisplay; |
|||
private String sql; |
|||
private String workShopName; |
|||
private String closeRemark; |
|||
private String username; |
|||
} |
|||
@ -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; |
|||
} |
|||
|
|||
@ -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; |
|||
} |
|||
@ -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; |
|||
} |
|||
|
|||
@ -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; |
|||
} |
|||
@ -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<SOIssueNotifyHeader> { |
|||
|
|||
/** |
|||
* @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<SOIssueNotifyOrderListData> |
|||
* @throw |
|||
*/ |
|||
List<SOIssueNotifyOrderListData> getNotifyNoDetail(SOIssueNotifyHeaderData data); |
|||
|
|||
/** |
|||
* @Description 查找可以发料的派工单 |
|||
* @Title getSOScheduledRoutingListForIssure |
|||
* @param data |
|||
* @author rq |
|||
* @date 2024/9/2 9:33 |
|||
* @return List<SOScheduledRoutingData> |
|||
* @throw |
|||
*/ |
|||
List<SOScheduledRoutingData> getSOScheduledRoutingListForIssure(SOScheduledRoutingData data); |
|||
|
|||
|
|||
/** |
|||
* @Description 获取生产订单BOM |
|||
* @Title getSOSBOMForIssure |
|||
* @param data |
|||
* @author rq |
|||
* @date 2024/9/2 14:35 |
|||
* @return List<SoBomData> |
|||
* @throw |
|||
*/ |
|||
List<SOIssueNotifyOrderMaterialListData> getSOSBOMForIssure(SOScheduledRoutingData data); |
|||
|
|||
Double getNextItemForSOIssueNotifyOrderList(SOIssueNotifyOrderList data); |
|||
List<SOIssueNotifyOrderMaterialListData> searchOtherPart(SOIssueNotifyOrderMaterialListData data); |
|||
void saveSOIssueNotifyOrderList(SOIssueNotifyOrderList data); |
|||
|
|||
void deleteSOIssueNotifyOrderMaterialListData(SOIssueNotifyOrderMaterialListData data); |
|||
|
|||
void batchSaveSOIssueNotifyOrderMaterialListData(List<SOIssueNotifyOrderMaterialListData> data); |
|||
void saveSOIssueNotifyOrderMaterialListData(SOIssueNotifyOrderMaterialListData data); |
|||
void deleteNotifySOS(SOIssueNotifyOrderListData data); |
|||
|
|||
void xiadaNotifyHeader(SOIssueNotifyHeaderData data); |
|||
|
|||
void deleteNotifyHeader(SOIssueNotifyHeaderData data); |
|||
|
|||
IPage<SOIssueNotifyHeaderData> searchNotifyHeader(Page<SOIssueNotifyHeaderData> soIssueNotifyHeaderDataPage, @Param("query") SOIssueNotifyHeaderData data); |
|||
|
|||
List<SOIssueNotifyOrderListData> searchNotifyOrderList(SOIssueNotifyHeaderData data); |
|||
|
|||
List<SOIssueNotifyOrderMaterialListData> searchNotifyMaterialList(SOIssueNotifyHeaderData data); |
|||
|
|||
List<SOIssueNotifyOrderMaterialListData> searchSumNotifyMaterialList(SOIssueNotifyHeaderData data); |
|||
|
|||
List<PartData> getPartList(PartData data); |
|||
|
|||
List<PartData> getNoControlPartList(PartData data); |
|||
|
|||
List<SOIssueNotifyOrderMaterialListData> checkPartStock(SOIssueNotifyHeaderData data); |
|||
|
|||
List<SOIssueNotifyOrderMaterialListData> checkDeleteOrderList(SOIssueNotifyOrderListData data); |
|||
|
|||
|
|||
void updateNotifyStatus(SOIssueNotifyHeaderData data); |
|||
|
|||
List<SOIssueNotifyOrderMaterialListData> checkDeleteMaterial(SOIssueNotifyOrderMaterialListData data); |
|||
|
|||
void deleteNotifyMaterial(SOIssueNotifyOrderMaterialListData data); |
|||
|
|||
/*void saveIssueNotifyChangeLog(IssueNotifyChangeLog data);*/ |
|||
|
|||
//List<SOIssueNotifyOrderList> getSOIssueNotifyOrderListData(SOIssueNotifyOrderMaterialListData Data); |
|||
|
|||
List<SOIssueNotifyOrderMaterialListData> checkOtherPart(SOIssueNotifyOrderMaterialListData data); |
|||
|
|||
String getNextBomItemNo(SOIssueNotifyOrderMaterialListData data); |
|||
|
|||
/*List<IssueNotifyChangeLog> searchIssueNotifyChangeLog(IssueNotifyChangeLog data);*/ |
|||
|
|||
void insertNotifyLogClose(SOIssueNotifyHeaderData inData); |
|||
|
|||
/*List<SOIssueNotifyLogData> searchNotifyLogClose(SOIssueNotifyLogData data);*/ |
|||
|
|||
} |
|||
@ -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<SOIssueNotifyOrderListData> |
|||
* @throw |
|||
*/ |
|||
List<SOIssueNotifyOrderListData> getNotifyNoDetail(SOIssueNotifyHeaderData data); |
|||
|
|||
/** |
|||
* @Description TODO |
|||
* @Title getSOScheduledRoutingListForIssure |
|||
* @param data |
|||
* @author rq |
|||
* @date 2024/9/2 9:33 |
|||
* @return List<SOScheduledRoutingData> |
|||
* @throw |
|||
*/ |
|||
List<SOScheduledRoutingData> getSOScheduledRoutingListForIssure(SOScheduledRoutingData data); |
|||
|
|||
/** |
|||
* @Description 获取生产订单BOM |
|||
* @Title getSOSBOMForIssure |
|||
* @param data |
|||
* @author rq |
|||
* @date 2024/9/2 14:35 |
|||
* @return List<SoBomData> |
|||
* @throw |
|||
*/ |
|||
List<SOIssueNotifyOrderMaterialListData> getSOSBOMForIssure(SOScheduledRoutingData data); |
|||
List<SOIssueNotifyOrderMaterialListData> 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<SOIssueNotifyOrderMaterialListData> data); |
|||
|
|||
void deleteNotifySOS(SOIssueNotifyOrderListData data); |
|||
|
|||
|
|||
void xiadaNotifyHeader(SOIssueNotifyHeaderData data); |
|||
|
|||
void deleteNotifyHeader(SOIssueNotifyHeaderData data); |
|||
|
|||
|
|||
//PageUtils searchNotifyHeader(SOIssueNotifyHeaderData data); |
|||
|
|||
List<SOIssueNotifyOrderListData> searchNotifyOrderList(SOIssueNotifyHeaderData data); |
|||
|
|||
List<SOIssueNotifyOrderMaterialListData> searchNotifyMaterialList(SOIssueNotifyHeaderData data); |
|||
|
|||
|
|||
List<SOIssueNotifyOrderMaterialListData> searchSumNotifyMaterialList(SOIssueNotifyHeaderData data); |
|||
|
|||
//List<PartData> getPartList(PartData data); |
|||
|
|||
List<SOIssueNotifyOrderMaterialListData> 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<PartData> getNoControlPartList(PartData data); |
|||
// |
|||
// |
|||
// List<IssueNotifyChangeLog> searchIssueNotifyChangeLog(IssueNotifyChangeLog data); |
|||
// |
|||
// |
|||
// List<SOIssueNotifyLogData> searchNotifyLogClose(SOIssueNotifyLogData data); |
|||
|
|||
/*Boolean updateNotifyConfirmStatus(SOIssueNotifyHeaderData data)throws Exception; |
|||
|
|||
Boolean updateBatchConfirmStatus(String[] notifyNos);*/ |
|||
} |
|||
@ -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<SOIssueNotifyOrderListData> getNotifyNoDetail(SOIssueNotifyHeaderData data){ |
|||
return issureNotifyMapper.getNotifyNoDetail(data); |
|||
} |
|||
|
|||
@Override |
|||
public List<SOScheduledRoutingData> getSOScheduledRoutingListForIssure(SOScheduledRoutingData data){ |
|||
return issureNotifyMapper.getSOScheduledRoutingListForIssure(data); |
|||
} |
|||
|
|||
@Override |
|||
public List<SOIssueNotifyOrderMaterialListData> getSOSBOMForIssure(SOScheduledRoutingData data){ |
|||
return issureNotifyMapper.getSOSBOMForIssure(data); |
|||
} |
|||
@Override |
|||
public List<SOIssueNotifyOrderMaterialListData> 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<SOIssueNotifyOrderMaterialListData> 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 <data.getWorkShopList().size() ; i++) { |
|||
if(i!=data.getWorkShopList().size()-1){ |
|||
str=str+"'"+data.getWorkShopList().get(i)+"',"; |
|||
}else { |
|||
str=str+"'"+data.getWorkShopList().get(i)+"'"; |
|||
} |
|||
} |
|||
str=str+")"; |
|||
data.setWorkShopId(str); |
|||
} |
|||
IPage<SOIssueNotifyHeaderData> resultList = issureNotifyMapper.searchNotifyHeader(new Page<SOIssueNotifyHeaderData>(data.getPage(), data.getLimit()), data); |
|||
return new PageUtils(resultList); |
|||
}*/ |
|||
|
|||
public List<SOIssueNotifyOrderListData> searchNotifyOrderList(SOIssueNotifyHeaderData data){ |
|||
return issureNotifyMapper.searchNotifyOrderList(data); |
|||
} |
|||
|
|||
@Override |
|||
public List<SOIssueNotifyOrderMaterialListData> searchNotifyMaterialList(SOIssueNotifyHeaderData data){ |
|||
return issureNotifyMapper.searchNotifyMaterialList(data); |
|||
} |
|||
|
|||
@Override |
|||
public List<SOIssueNotifyOrderMaterialListData> searchSumNotifyMaterialList(SOIssueNotifyHeaderData data){ |
|||
return issureNotifyMapper.searchSumNotifyMaterialList(data); |
|||
} |
|||
/*@Override |
|||
public List<PartData> getPartList(PartData data){ |
|||
return issureNotifyMapper.getPartList(data); |
|||
}*/ |
|||
@Override |
|||
public List<SOIssueNotifyOrderMaterialListData> checkPartStock(SOIssueNotifyHeaderData data){ |
|||
return issureNotifyMapper.checkPartStock(data); |
|||
} |
|||
|
|||
/*@Override |
|||
@Transactional |
|||
public void deleteNotifySOSPlus(SOIssueNotifyOrderListData data){ |
|||
List<SOIssueNotifyOrderMaterialListData> 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<SOIssueNotifyHeaderData> 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<SOIssueNotifyHeaderData> 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<SOIssueNotifyOrderMaterialListData> 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<SOIssueNotifyOrderList> 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<SOIssueNotifyOrderMaterialListData> 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<SOIssueNotifyOrderMaterialListData> 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<PartData> getNoControlPartList(PartData data){ |
|||
return issureNotifyMapper.getNoControlPartList(data); |
|||
} |
|||
|
|||
@Override |
|||
public List<IssueNotifyChangeLog> searchIssueNotifyChangeLog(IssueNotifyChangeLog data){ |
|||
return issureNotifyMapper.searchIssueNotifyChangeLog(data); |
|||
} |
|||
|
|||
@Override |
|||
public List<SOIssueNotifyLogData> 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<SOIssueNotifyHeader> 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<SOIssueNotifyHeader> 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<SOIssueNotifyHeader> queryWrapper = new QueryWrapper<>(); |
|||
queryWrapper.in("NotifyNo",notifyNos); |
|||
List<SOIssueNotifyHeader> soIssueNotifyHeaders = issureNotifyMapper.selectList(queryWrapper); |
|||
if(soIssueNotifyHeaders != null && soIssueNotifyHeaders.size()>0){ |
|||
List<SOIssueNotifyHeader> 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<SOIssueNotifyHeader> updateWrapper = new LambdaUpdateWrapper<>(); |
|||
updateWrapper.eq(SOIssueNotifyHeader::getNotifyNo,e.getNotifyNo()); |
|||
issureNotifyMapper.update(e,updateWrapper); |
|||
}); |
|||
} |
|||
return true; |
|||
}*/ |
|||
} |
|||
@ -0,0 +1,365 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="com.gaotao.modules.notify.mapper.IssureNotifyMapper"> |
|||
<select id="getUserNotifyNo" resultType="SOIssueNotifyHeaderData"> |
|||
select top 1 a.NotifyNo,a.Site,a.NotifyDate,a.UserName,a.EnteredDate,a.Receiver,a.DepartmentID,a.Remark,a.CreditFlag,a.IssueFlag, |
|||
a.IssueResult,a.PlanIssueDate,a.RealIssueDate,a.Status,a.HaveIssueRecordFlag,a.CalcFlag,a.NeedApproveFlag,a.ApprovedFlag, |
|||
a.Approver,a.ApproveDate,a.WarehouseID,a.RecordVersion,a.OutWorkOrderFlag,a.ProjectID,a.OrderType,a.AuthRuleID,a.bu |
|||
from SOIssueNotifyHeader a |
|||
where a.Site=#{site} and a.UserName=#{userName} and a.Status='已计划' |
|||
order by a.EnteredDate desc |
|||
|
|||
</select> |
|||
|
|||
<insert id="createNotify"> |
|||
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} |
|||
) |
|||
</insert> |
|||
<update id="updateNotifyBu"> |
|||
update SOIssueNotifyHeader set bu=#{bu} where site=#{site} and NotifyNo=#{notifyNo} |
|||
</update> |
|||
|
|||
<select id="getNotifyNoDetail" resultType="SOIssueNotifyOrderListData"> |
|||
select a.NotifyNo,a.Site,a.ItemNo,a.FGPartNo,a.SOOrderNo,a.OpsItemNo,a.SeqNo,a.IssureQty,a.OutWorkOrderFlag,a.locationNo,a.needDate |
|||
,b.operation_desc itemDesc |
|||
from SOIssueNotifyOrderList a |
|||
left join so_routing b on a.site=b.site and a.SOOrderNo=b.order_no and b.item_no=a.OpsItemNo |
|||
where a.site=#{site} and a.NotifyNo=#{notifyNo} |
|||
</select> |
|||
|
|||
<select id="getSOScheduledRoutingListForIssure" resultType="SOScheduledRoutingData"> |
|||
select a.site,a.orderno,a.itemno,b.operation_desc itemDesc,a.seqno,a.qtyrequired,a.qtyreported,a.remark, |
|||
a.s_scheduleddate,a.s_resourceid,dbo.getResourceDesc(a.site,a.s_resourceid) ResourceDesc,a.s_shiftno, |
|||
dbo.getScheduleShiftDesc(a.site,a.s_shiftno) shiftDesc,a.s_workcenterno,a.part_no,a.operator_id, |
|||
c.work_center_desc workCenterDesc,dbo.Get_PartDesc(a.site,a.part_no) partDesc, |
|||
dbo.getOperatorDesc(a.site,a.operator_id) operatorDesc |
|||
from soscheduledrouting a |
|||
left join so_routing b on a.site=b.site and a.orderno=b.order_no and b.item_no=a.itemno |
|||
left join work_center c on a.site=c.site and a.s_workcenterno=c.work_center_no |
|||
left join part d on a.site=d.site and a.part_no=d.part_no |
|||
<where> |
|||
and a.closed_flag='N' |
|||
<if test="partNo != null and partNo != ''"> |
|||
and a.part_no like #{partNo} |
|||
</if> |
|||
<if test="seqno != null and seqno != ''"> |
|||
and a.seqno like #{seqno} |
|||
</if> |
|||
<if test="operatorDesc != null and operatorDesc != ''"> |
|||
and dbo.getOperatorDesc(a.site,a.operator_id) like #{operatorDesc} |
|||
</if> |
|||
<if test="orderno != null and orderno != ''"> |
|||
and a.orderno like #{orderno} |
|||
</if> |
|||
<if test="sShiftno != null and sShiftno != ''"> |
|||
and a.s_shiftno like #{sShiftno} |
|||
</if> |
|||
<if test="sResourceid != null and sResourceid != ''"> |
|||
and a.s_resourceid like #{sResourceid} |
|||
</if> |
|||
<if test="sWorkcenterno != null and sWorkcenterno != ''"> |
|||
and a.s_workcenterno like #{sWorkcenterno} |
|||
</if> |
|||
<if test="operatorId != null and operatorId != ''"> |
|||
and a.operator_id like #{operatorId} |
|||
</if> |
|||
<if test="startDate != null "> |
|||
AND a.s_scheduleddate >= #{startDate} |
|||
</if> |
|||
<if test="endDate != null "> |
|||
AND #{endDate} >= a.s_scheduleddate |
|||
</if> |
|||
and a.site=#{site} |
|||
and d.sourceBu=#{bu} |
|||
</where> |
|||
order by a.s_scheduleddate |
|||
</select> |
|||
|
|||
<!-- <select id="getSOSBOMForIssure" resultType="SOIssueNotifyOrderMaterialListData">--> |
|||
<!-- select a.site,b.ItemNo,a.item_no_mat as BOMItemNo,a.component_partno as ComponentPartNo,--> |
|||
<!-- round(a.qty_assembly*b.IssureQty,2) qty_required , round(a.qty_issue,2) qty_issue,c.QtyToIssue,#{notifyNo} as notifyNo--> |
|||
<!-- ,dbo.Get_PartDesc(a.site,a.component_partno) partDesc,Round( dbo.get_MaterialOnUse(a.site,a.order_no,a.item_no,a.component_partno),3) qtyOnHand--> |
|||
<!-- from so_bom a--> |
|||
<!-- left join SOIssueNotifyOrderList b on a.site=b.site and b.NotifyNo=#{notifyNo} and b.seqNo=#{seqno}--> |
|||
<!-- left join SOIssueNotifyOrderMaterialList c on a.site=c.site and a.item_no_mat=c.BOMItemNo and c.NotifyNo=#{notifyNo} and c.itemNo=b.itemNo--> |
|||
<!--<!– left join SOIssueNotifyOrderList d on a.site=d.site and c.NotifyNo=d.NotifyNo and c.itemNo=d.itemNo–>--> |
|||
<!-- where a.site=#{site} and a.order_no=#{orderno} and a.item_no=#{itemno,jdbcType=DOUBLE} and a.control_mes='Y'--> |
|||
<!-- order by a.item_no--> |
|||
<!-- </select>--> |
|||
|
|||
<select id="getSOSBOMForIssure" resultType="SOIssueNotifyOrderMaterialListData"> |
|||
select a.site,b.ItemNo,a.item_no_mat as BOMItemNo,a.component_partno as ComponentPartNo, |
|||
round(a.qty_assembly*b.IssureQty,2) qty_required , round(a.qty_issue,2) qty_issue,c.QtyToIssue,#{notifyNo} as notifyNo |
|||
,dbo.Get_PartDesc(a.site,a.component_partno) partDesc,Round( dbo.get_MaterialOnUse(a.site,a.order_no,a.item_no,a.component_partno),3) qtyOnHand, |
|||
round(sum(h.qty_on_hand),2) stockQty,c.remark |
|||
from so_bom a |
|||
left join SOIssueNotifyOrderList b on a.site=b.site and b.NotifyNo=#{notifyNo} and b.seqNo=#{seqno} |
|||
left join SOIssueNotifyOrderMaterialList c on a.site=c.site and a.item_no_mat=c.BOMItemNo and c.NotifyNo=#{notifyNo} and c.itemNo=b.itemNo |
|||
left join view_custdev_currentstock h on a.site=h.site and a.component_partno=h.part_no |
|||
<!-- left join SOIssueNotifyOrderList d on a.site=d.site and c.NotifyNo=d.NotifyNo and c.itemNo=d.itemNo--> |
|||
where a.site=#{site} and a.order_no=#{orderno} and a.item_no=#{itemno,jdbcType=DOUBLE} and a.control_mes='Y' |
|||
group by a.site,b.ItemNo,a.item_no_mat,a.component_partno,a.qty_assembly,b.IssureQty,a.qty_issue,c.QtyToIssue,a.order_no,a.item_no,a.control_mes,c.remark |
|||
<!-- UNION all--> |
|||
<!-- select b.site,b.ItemNo,c.BOMItemNo,c.ComponentPartNo,--> |
|||
<!-- null as qty_required , null qty_issue,c.QtyToIssue,#{notifyNo} as notifyNo--> |
|||
<!-- ,dbo.Get_PartDesc(c.site,c.ComponentPartNo) partDesc,Round( dbo.get_MaterialOnUse(b.site,b.SOOrderNo ,b.OpsItemNo,c.ComponentPartNo),3) qtyOnHand,--> |
|||
<!-- round(sum(h.qty_on_hand),2) stockQty,c.remark--> |
|||
<!-- from SOIssueNotifyOrderList b--> |
|||
<!-- left join SOIssueNotifyOrderMaterialList c on b.site=c.site and c.NotifyNo=#{notifyNo} and c.itemNo=b.itemNo--> |
|||
<!-- left join so_bom a on a.site=b.site and a.order_no=b.SOOrderNo and a.item_no=b.OpsItemNo and a.control_mes='Y'--> |
|||
<!-- and a.component_partno=c.ComponentPartNo--> |
|||
<!-- left join view_custdev_currentstock h on c.site=h.site and c.ComponentPartNo=h.part_no--> |
|||
<!-- WHERE b.NotifyNo=#{notifyNo} and b.seqNo=#{seqno} and b.site=#{site} and a.item_no_mat is null and c.ComponentPartNo is not null--> |
|||
<!-- group by b.site,b.ItemNo,c.BOMItemNo,c.ComponentPartNo,c.QtyToIssue,c.site,b.SOOrderNo ,b.OpsItemNo,c.remark--> |
|||
|
|||
</select> |
|||
|
|||
<select id="searchOtherPart" resultType="SOIssueNotifyOrderMaterialListData"> |
|||
select NotifyNo,Site,ItemNo,BOMItemNo,ComponentPartNo,QtyToIssue,QtyToIssue_Original,issueType |
|||
,dbo.Get_PartDesc(site,ComponentPartNo) partDesc,remark |
|||
from SOIssueNotifyOrderMaterialList where NotifyNo=#{notifyNo} and site=#{site} and issueType=#{issueType} |
|||
</select> |
|||
<select id="getNextItemForSOIssueNotifyOrderList" resultType="Double"> |
|||
select isnull(max(ItemNo),0)+1 from SOIssueNotifyOrderList where site=#{site} and NotifyNo=#{notifyNo} and 998>ItemNo |
|||
</select> |
|||
|
|||
<insert id="saveSOIssueNotifyOrderList"> |
|||
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}) |
|||
</insert> |
|||
<delete id="deleteSOIssueNotifyOrderMaterialListData"> |
|||
delete from SOIssueNotifyOrderMaterialList where site=#{site} and NotifyNo=#{notifyNo} and ItemNo=#{itemNo} |
|||
|
|||
</delete> |
|||
<insert id="batchSaveSOIssueNotifyOrderMaterialListData"> |
|||
insert into SOIssueNotifyOrderMaterialList (NotifyNo,Site,ItemNo,BOMItemNo,ComponentPartNo,QtyToIssue,QtyToIssue_Original,issueType,remark) |
|||
values |
|||
<foreach collection="list" separator="," item="item"> |
|||
(#{item.notifyNo},#{item.site},#{item.itemNo},#{item.bOMItemNo},#{item.componentPartNo},#{item.qtyToIssue},0,#{item.issueType},#{item.remark}) |
|||
</foreach> |
|||
</insert> |
|||
|
|||
<insert id="saveSOIssueNotifyOrderMaterialListData"> |
|||
insert into SOIssueNotifyOrderMaterialList (NotifyNo,Site,ItemNo,BOMItemNo,ComponentPartNo,QtyToIssue,QtyToIssue_Original,issueType,remark) |
|||
values |
|||
|
|||
(#{notifyNo},#{site},#{itemNo},#{bOMItemNo},#{componentPartNo},#{qtyToIssue},0,#{issueType},#{remark}) |
|||
|
|||
</insert> |
|||
|
|||
<delete id="deleteNotifySOS"> |
|||
delete from SOIssueNotifyOrderList where site=#{site} and NotifyNo=#{notifyNo} and ItemNo=#{itemNo} |
|||
</delete> |
|||
|
|||
<update id="xiadaNotifyHeader"> |
|||
update SOIssueNotifyHeader set PlanIssueDate=#{planIssueDate},remark=#{remark} ,status='已下达' where site=#{site} and NotifyNo=#{notifyNo} |
|||
</update> |
|||
|
|||
<delete id="deleteNotifyHeader"> |
|||
delete from SOIssueNotifyHeader where site=#{site} and NotifyNo=#{notifyNo} |
|||
</delete> |
|||
|
|||
<select id="searchNotifyHeader" parameterType="SOIssueNotifyHeaderData" resultType="SOIssueNotifyHeaderData"> |
|||
select a.NotifyNo,a.Site,a.NotifyDate,a.UserName,a.EnteredDate,a.Receiver,a.DepartmentID,a.Remark,a.CreditFlag,a.IssueFlag, |
|||
a.IssueResult,a.PlanIssueDate,a.RealIssueDate,a.Status,a.HaveIssueRecordFlag,a.CalcFlag,a.NeedApproveFlag,a.ApprovedFlag, |
|||
a.Approver,a.ApproveDate,a.WarehouseID,a.RecordVersion,a.OutWorkOrderFlag,a.ProjectID,a.OrderType,a.AuthRuleID,(CASE WHEN a.confirm_status IS NULL THEN '未确认' ELSE a.confirm_status END) as confirm_status ,dbo.plm_get_user_display(a.Site,a.UserName) userDisplay, |
|||
a.confirm_user_id,a.confirm_username,a.confirm_user_display,a.confirm_date, |
|||
c.workShopName |
|||
from SOIssueNotifyHeader a |
|||
left join sys_user b on a.UserName=b.username |
|||
left join eam_WorkShop c on b.workShopId=c.workShopId |
|||
<where> |
|||
|
|||
<if test="query.notifyNo != null and query.notifyNo != ''"> |
|||
AND a.NotifyNo = #{query.notifyNo} |
|||
</if> |
|||
<if test="query.status != null and query.status != ''"> |
|||
AND a.Status = #{query.status} |
|||
</if> |
|||
<if test = "query.userName != null and query.userName != ''"> |
|||
AND a.UserName LIKE #{query.userName} |
|||
</if> |
|||
<if test = "query.issueFlag != null and query.issueFlag != ''"> |
|||
AND a.issueFlag LIKE #{query.issueFlag} |
|||
</if> |
|||
<if test = "query.issueResult != null and query.issueResult != ''"> |
|||
AND a.issueResult LIKE #{query.issueResult} |
|||
</if> |
|||
<if test = "query.startDate != null "> |
|||
AND a.NotifyDate >= #{query.startDate} |
|||
</if> |
|||
<if test = "query.endDate != null"> |
|||
AND #{query.endDate} >=a.NotifyDate |
|||
</if> |
|||
<if test = "query.confirmStatus != null and query.confirmStatus != ''"> |
|||
<choose> |
|||
<when test="query.confirmStatus == '未确认'"> |
|||
AND (a.confirm_status = #{query.confirmStatus} or a.confirm_status is null) |
|||
</when> |
|||
<otherwise> |
|||
AND a.confirm_status = #{query.confirmStatus} |
|||
</otherwise> |
|||
</choose> |
|||
</if> |
|||
<if test = "query.sql != null and query.sql != ''"> |
|||
${query.sql} |
|||
</if> |
|||
<if test = "query.workShopId != null and query.workShopId != ''"> |
|||
AND b.workShopId in ${query.workShopId} |
|||
</if> |
|||
</where> |
|||
order by a.NotifyNo |
|||
</select> |
|||
|
|||
<select id="searchNotifyOrderList" resultType="SOIssueNotifyOrderListData"> |
|||
select a.NotifyNo,a.Site,a.ItemNo,a.FGPartNo,a.SOOrderNo,a.OpsItemNo,a.SeqNo, |
|||
a.IssureQty,a.OutWorkOrderFlag ,b.operation_desc itemDesc,a.locationNo,a.needDate, |
|||
dbo.Get_PartDesc(a.site,a.FGPartNo) partDesc |
|||
from SOIssueNotifyOrderList a |
|||
left join so_routing b on a.site=b.site and a.SOOrderNo=b.order_no and a.OpsItemNo=b.item_no |
|||
where a.NotifyNo=#{notifyNo} and a.site=#{site} |
|||
order by a.ItemNo |
|||
</select> |
|||
|
|||
|
|||
<select id="searchNotifyMaterialList" resultType="SOIssueNotifyOrderMaterialListData"> |
|||
select a.NotifyNo,a.Site,a.ItemNo,a.BOMItemNo,a.ComponentPartNo,a.QtyToIssue,a.QtyToIssue_Original |
|||
,b.FGPartNo,b.OpsItemNo,b.SOOrderNo orderNo,b.SeqNo, dbo.Get_PartDesc(a.site,a.ComponentPartNo) partDesc |
|||
,b.locationNo,a.issueType,b.needDate,a.remark |
|||
from SOIssueNotifyOrderMaterialList a |
|||
left join SOIssueNotifyOrderList b on a.site=b.site and a.NotifyNo=b.NotifyNo and a.ItemNo=b.ItemNo |
|||
where a.NotifyNo=#{notifyNo} and a.site=#{site} |
|||
order by b.needDate,a.ItemNo |
|||
</select> |
|||
|
|||
<select id="searchSumNotifyMaterialList" resultType="SOIssueNotifyOrderMaterialListData"> |
|||
select a.ComponentPartNo,sum(a.QtyToIssue) QtyToIssue,sum(isnull(a.QtyToIssue_Original,0)) QtyToIssue_Original, |
|||
dbo.Get_PartDesc(a.site,a.ComponentPartNo) partDesc,a.issueType |
|||
from SOIssueNotifyOrderMaterialList a |
|||
where a.NotifyNo=#{notifyNo} and a.site=#{site} |
|||
group by a.site,a.ComponentPartNo,a.issueType |
|||
order by a.issueType |
|||
</select> |
|||
|
|||
<select id="getPartList" resultType="PartData" > |
|||
select top 1000 part_no,part_desc,umid,spec,sku,cinv_source_code |
|||
from part |
|||
<where> |
|||
and site = #{site} and sourceBu = #{sourceBu} and control_mes='G' |
|||
<if test="partNo != null and partNo != ''"> |
|||
AND part_no LIKE '%'+ #{partNo} + '%' |
|||
</if> |
|||
<if test = "partDesc != null and partDesc != ''"> |
|||
AND part_desc LIKE '%'+ #{partDesc}+ '%' |
|||
</if> |
|||
<if test = "spec != null and spec != ''"> |
|||
AND spec LIKE '%'+ #{spec}+ '%' |
|||
</if> |
|||
|
|||
|
|||
</where> |
|||
</select> |
|||
<select id="getNoControlPartList" resultType="PartData" > |
|||
select top 1000 part_no,part_desc,umid,spec,sku,cinv_source_code |
|||
from part |
|||
<where> |
|||
and site = #{site} and sourceBu = #{sourceBu} and control_mes='N' |
|||
<if test="partNo != null and partNo != ''"> |
|||
AND part_no LIKE '%'+ #{partNo} + '%' |
|||
</if> |
|||
<if test = "partDesc != null and partDesc != ''"> |
|||
AND part_desc LIKE '%'+ #{partDesc}+ '%' |
|||
</if> |
|||
<if test = "spec != null and spec != ''"> |
|||
AND spec LIKE '%'+ #{spec}+ '%' |
|||
</if> |
|||
|
|||
|
|||
</where> |
|||
</select> |
|||
|
|||
|
|||
<select id="checkPartStock" resultType="SOIssueNotifyOrderMaterialListData" > |
|||
select g.ComponentPartNo,g.QtyToIssue ,g.partDesc,sum(h.qty_on_hand) qty_on_hand,sum(h.qty_available) qty_available |
|||
from |
|||
( |
|||
select a.ComponentPartNo,sum(a.QtyToIssue) QtyToIssue,sum(isnull(a.QtyToIssue_Original,0)) QtyToIssue_Original, |
|||
dbo.Get_PartDesc(a.site,a.ComponentPartNo) partDesc,a.site |
|||
from SOIssueNotifyOrderMaterialList a |
|||
where a.NotifyNo=#{notifyNo} and a.site=#{site} |
|||
group by a.site,a.ComponentPartNo |
|||
) g left join view_custdev_currentstock h on g.site=h.site and g.ComponentPartNo=h.part_no |
|||
|
|||
group by g.ComponentPartNo,g.QtyToIssue ,g.partDesc |
|||
</select> |
|||
|
|||
<select id="checkDeleteOrderList" resultType="SOIssueNotifyOrderMaterialListData" > |
|||
select NotifyNo,Site,ItemNo,BOMItemNo,ComponentPartNo,QtyToIssue,QtyToIssue_Original |
|||
from SOIssueNotifyOrderMaterialList where Site=#{site} and NotifyNo=#{notifyNo} |
|||
and ItemNo=#{itemNo,jdbcType=DOUBLE} |
|||
</select> |
|||
|
|||
<update id="updateNotifyStatus" > |
|||
update SOIssueNotifyHeader set status=#{status} |
|||
where Site=#{site} and NotifyNo=#{notifyNo} |
|||
</update> |
|||
<select id="checkDeleteMaterial" resultType="SOIssueNotifyOrderMaterialListData"> |
|||
select NotifyNo,Site,ItemNo,BOMItemNo,ComponentPartNo,QtyToIssue,QtyToIssue_Original |
|||
from SOIssueNotifyOrderMaterialList where Site=#{site} and NotifyNo=#{notifyNo} |
|||
and ItemNo=#{itemNo} and BOMItemNo=#{bOMItemNo} |
|||
</select> |
|||
<select id="deleteNotifyMaterial"> |
|||
delete from SOIssueNotifyOrderMaterialList where Site=#{site} and NotifyNo=#{notifyNo} |
|||
and ItemNo=#{itemNo} and BOMItemNo=#{bOMItemNo} |
|||
</select> |
|||
<insert id="saveIssueNotifyChangeLog"> |
|||
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}) |
|||
</insert> |
|||
|
|||
<!--<select id="getSOIssueNotifyOrderListData" resultType="com.xujie.sys.modules.orderIssure.vo.SOIssueNotifyOrderList"> |
|||
select NotifyNo,Site,ItemNo,FGPartNo,SOOrderNo,OpsItemNo,SeqNo,IssureQty,OutWorkOrderFlag,LocationNo,needDate |
|||
from SOIssueNotifyOrderList where Site=#{site} and NotifyNo=#{notifyNo} |
|||
and ItemNo=#{itemNo} |
|||
</select>--> |
|||
|
|||
<select id="checkOtherPart" resultType="SOIssueNotifyOrderMaterialListData"> |
|||
select NotifyNo,Site,ItemNo,BOMItemNo,ComponentPartNo,QtyToIssue,QtyToIssue_Original |
|||
|
|||
from SOIssueNotifyOrderMaterialList where Site=#{site} and NotifyNo=#{notifyNo} |
|||
and ComponentPartNo=#{componentPartNo} |
|||
</select> |
|||
|
|||
<select id="getNextBomItemNo" resultType="String"> |
|||
|
|||
SELECT #{str}+ |
|||
CONVERT(VARCHAR(50),isnull( max(CONVERT(int,SUBSTRING(BOMItemNo, LEN(#{str})+1, LEN(BOMItemNo)))+1),1)) |
|||
|
|||
|
|||
FROM SOIssueNotifyOrderMaterialList where Site=#{site} and NotifyNo=#{notifyNo} |
|||
and BOMItemNo like #{str}+'%' |
|||
|
|||
</select> |
|||
|
|||
<!--<select id="searchIssueNotifyChangeLog" resultType="com.xujie.sys.modules.orderIssure.vo.IssueNotifyChangeLog"> |
|||
select Site,NotifyNo,ItemNo,SOOrderNo,SeqNo,ComponentPartNo,QtyToIssue,updateType,updateBy,updateDate,issueType |
|||
from IssueNotifyChangeLog where Site=#{site} and NotifyNo=#{notifyNo} |
|||
</select>--> |
|||
|
|||
<select id="insertNotifyLogClose" > |
|||
insert into SOIssueNotifyLog (Site,NotifyNo,[Action],username,ActionTime,ActionRemark) |
|||
values (#{site},#{notifyNo},'关闭',#{username},GetDate(),#{closeRemark}) |
|||
</select> |
|||
|
|||
<!--select id="searchNotifyLogClose" resultType="SOIssueNotifyLogData"> |
|||
select id,Site,NotifyNo,[Action],username,ActionTime,ActionRemark ,dbo.plm_get_user_display(Site,username) userDisplay |
|||
from SOIssueNotifyLog where site=#{site} and NotifyNo=#{notifyNo} |
|||
order by id |
|||
</select>--> |
|||
</mapper> |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue