Commit f0f769aa by 肖洋洋
parents 8dab0a00 69db51ad
......@@ -128,6 +128,7 @@ public class PurRequisitionController {
**/
@RequestMapping(path = "/add", method = RequestMethod.POST)
public Result add(@RequestBody PurRequisitionPage purRequisitionPage,
@RequestParam(value = "token")String token,
@RequestParam(value = "headerStatus", required = false) String headerStatus) {
//判断想要下推生成采购申请单的状态是否为已审批
if (!"approval".equals(headerStatus) && !"completed".equals(headerStatus)) {
......@@ -164,10 +165,12 @@ public class PurRequisitionController {
}
requisitionLine.setItemCode(invItem.getItemCode());
}
SysAccessToken sysAccessToken = userServer.checkAccessToken(token);
PurRequisition purRequisition = new PurRequisition();
BeanUtils.copyProperties(purRequisitionPage, purRequisition);
//为采购申请主表添加组织code
purRequisition.setSysOrgCode(sysOrgCode);
purRequisition.setApplicant(sysAccessToken.getUserId());
//添加
purRequisitionService.saveMain(purRequisition, purRequisitionPage.getPurRequisitionLineList());
return new Result(true,StatusCode.OK,"下推采购申请成功!",purRequisitionPage.getOrderNumber());
......
......@@ -74,7 +74,7 @@ public class WshShipmentController {
}
String updateBy = user.getRealname();
LocalDateTime updateTime = LocalDateTime.now();
wshShipmentHeaderPage.setShipperV(user.getPersonId());
wshShipmentHeaderPage.setShipperV(user.getId());
//查找出当前用户所在的组织sysorgcode
Map<String,Object> map = getInfo(user.getPersonId());
//赋值当前用户的组织code
......
package orthopedics.model;
public class JSONArrayModel {
private String inv_id;
private String inv_code;
private String inv_name;
private String subinv_id;
private String subinv_code;
private String subinv_name;
private String locator_id;
private String locator_code;
private String locator_name;
private String item_id;
private String item_code;
private String item_name;
private String unit_code;
private String purchase_price;
private String in_inv_id;
private String in_inv_code;
private String in_inv_name;
private String balance;
private String quantity;
public String getInv_id() {
return inv_id;
}
public void setInv_id(String inv_id) {
this.inv_id = inv_id;
}
public String getInv_code() {
return inv_code;
}
public void setInv_code(String inv_code) {
this.inv_code = inv_code;
}
public String getInv_name() {
return inv_name;
}
public void setInv_name(String inv_name) {
this.inv_name = inv_name;
}
public String getSubinv_id() {
return subinv_id;
}
public void setSubinv_id(String subinv_id) {
this.subinv_id = subinv_id;
}
public String getSubinv_code() {
return subinv_code;
}
public void setSubinv_code(String subinv_code) {
this.subinv_code = subinv_code;
}
public String getSubinv_name() {
return subinv_name;
}
public void setSubinv_name(String subinv_name) {
this.subinv_name = subinv_name;
}
public String getLocator_id() {
return locator_id;
}
public void setLocator_id(String locator_id) {
this.locator_id = locator_id;
}
public String getLocator_code() {
return locator_code;
}
public void setLocator_code(String locator_code) {
this.locator_code = locator_code;
}
public String getLocator_name() {
return locator_name;
}
public void setLocator_name(String locator_name) {
this.locator_name = locator_name;
}
public String getItem_id() {
return item_id;
}
public void setItem_id(String item_id) {
this.item_id = item_id;
}
public String getItem_code() {
return item_code;
}
public void setItem_code(String item_code) {
this.item_code = item_code;
}
public String getItem_name() {
return item_name;
}
public void setItem_name(String item_name) {
this.item_name = item_name;
}
public String getUnit_code() {
return unit_code;
}
public void setUnit_code(String unit_code) {
this.unit_code = unit_code;
}
public String getPurchase_price() {
return purchase_price;
}
public void setPurchase_price(String purchase_price) {
this.purchase_price = purchase_price;
}
public String getIn_inv_id() {
return in_inv_id;
}
public void setIn_inv_id(String in_inv_id) {
this.in_inv_id = in_inv_id;
}
public String getIn_inv_code() {
return in_inv_code;
}
public void setIn_inv_code(String in_inv_code) {
this.in_inv_code = in_inv_code;
}
public String getIn_inv_name() {
return in_inv_name;
}
public void setIn_inv_name(String in_inv_name) {
this.in_inv_name = in_inv_name;
}
public String getBalance() {
return balance;
}
public void setBalance(String balance) {
this.balance = balance;
}
public String getQuantity() {
return quantity;
}
public void setQuantity(String quantity) {
this.quantity = quantity;
}
@Override
public String toString() {
return "JSONArrayModel{" +
"inv_id='" + inv_id + '\'' +
", inv_code='" + inv_code + '\'' +
", inv_name='" + inv_name + '\'' +
", subinv_id='" + subinv_id + '\'' +
", subinv_code='" + subinv_code + '\'' +
", subinv_name='" + subinv_name + '\'' +
", locator_id='" + locator_id + '\'' +
", locator_code='" + locator_code + '\'' +
", locator_name='" + locator_name + '\'' +
", item_id='" + item_id + '\'' +
", item_code='" + item_code + '\'' +
", item_name='" + item_name + '\'' +
", unit_code='" + unit_code + '\'' +
", purchase_price='" + purchase_price + '\'' +
", in_inv_id='" + in_inv_id + '\'' +
", in_inv_code='" + in_inv_code + '\'' +
", in_inv_name='" + in_inv_name + '\'' +
", balance='" + balance + '\'' +
", quantity='" + quantity + '\'' +
'}';
}
}
......@@ -35,7 +35,6 @@ public class PurOrderHeaderService {
entity.setCreateTime(purOrderHeader.getCreateTime());
entity.setUpdateBy(purOrderHeader.getUpdateBy());
entity.setUpdateTime(purOrderHeader.getUpdateTime());
entity.setOrderNumber(purOrderHeader.getOrderNumber());
entity.setSourceHeaderId(purOrderHeader.getSourceHeaderId());
entity.setSourceHeaderNumber(purOrderHeader.getSourceHeaderNumber());
purOrderLineMapper.insert(entity);
......
......@@ -3,6 +3,7 @@ package orthopedics.service;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import orthopedics.dao.InvItemOnhandMapper;
import orthopedics.dao.InvTransactionMapper;
......@@ -80,4 +81,22 @@ public class TransferService {
public int updateInvItemOnHandByOriginTxId(Integer quantity,String id){
return invItemOnhandMapper.updateInvItemOnHandByOriginTxId(quantity, id);
}
@Transactional
public void saveMain(WarTransfer warTransfer,List<WarTransferLine> warTransferLineList){
warTransferMapper.insert(warTransfer);
for (WarTransferLine warTransferLine : warTransferLineList) {
warTransferLine.setCreateBy(warTransfer.getCreateBy());
warTransferLine.setCreateTime(warTransfer.getCreateTime());
warTransferLine.setUpdateBy(warTransfer.getUpdateBy());
warTransferLine.setUpdateTime(warTransfer.getUpdateTime());
warTransferLine.setOrderNumber(warTransfer.getOrderNumber());
warTransferLine.setOrgId(warTransfer.getOrgId());
warTransferLine.setSysOrgCode(warTransfer.getSysOrgCode());
warTransferLine.setLineStatus(warTransfer.getOrderStatus());
warTransferLine.setOrderType(warTransfer.getOrderType());
warTransferLine.setSourceHeaderId(warTransfer.getId());
warTransferLineMapper.insert(warTransferLine);
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment