no message
parent
186339cce4
commit
50b910bf25
|
|
@ -47,7 +47,7 @@ public class Asn extends BaseEntity implements Serializable {
|
||||||
|
|
||||||
@Column(name = "`code`",unique = true,nullable = false)
|
@Column(name = "`code`",unique = true,nullable = false)
|
||||||
@NotBlank
|
@NotBlank
|
||||||
@ApiModelProperty(value = "单号")
|
@ApiModelProperty(value = "凭证号")
|
||||||
private String code;
|
private String code;
|
||||||
|
|
||||||
@OneToOne
|
@OneToOne
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@
|
||||||
*/
|
*/
|
||||||
package com.youchain.businessdata.repository;
|
package com.youchain.businessdata.repository;
|
||||||
|
|
||||||
import com.youchain.businessdata.domain.AsnDetail;
|
|
||||||
import com.youchain.businessdata.domain.PickDetail;
|
import com.youchain.businessdata.domain.PickDetail;
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||||
|
|
@ -60,4 +59,4 @@ public interface PickDetailRepository extends JpaRepository<PickDetail, Long>, J
|
||||||
@Query(value = "SELECT IFNULL(sum(allocated_qty),0) FROM `data_pick_detail` a WHERE source_id=:id", nativeQuery = true)
|
@Query(value = "SELECT IFNULL(sum(allocated_qty),0) FROM `data_pick_detail` a WHERE source_id=:id", nativeQuery = true)
|
||||||
Double getBcQty(@Param("id") Long id);
|
Double getBcQty(@Param("id") Long id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -148,18 +148,17 @@ public class AsnDetailController {
|
||||||
@Log("新增asn_detail")
|
@Log("新增asn_detail")
|
||||||
@ApiOperation("新增asn_detail")
|
@ApiOperation("新增asn_detail")
|
||||||
@PreAuthorize("@el.check('super:man')")
|
@PreAuthorize("@el.check('super:man')")
|
||||||
@Transient
|
|
||||||
public ResponseEntity<Object> createAsnDetail(@Validated @RequestBody AsnDetail asnDetail) {
|
public ResponseEntity<Object> createAsnDetail(@Validated @RequestBody AsnDetail asnDetail) {
|
||||||
|
if(asnDetail.getAsn()==null){
|
||||||
|
return new ResponseEntity<>(ApiResult.fail(HttpStatus.BAD_REQUEST.value(), "请先提交入库单!", null),HttpStatus.BAD_REQUEST);
|
||||||
|
}
|
||||||
asnDetail.setStatus(BizStatus.OPEN);
|
asnDetail.setStatus(BizStatus.OPEN);
|
||||||
asnDetail.setDept(UserUtils.getDept());
|
asnDetail.setDept(UserUtils.getDept());
|
||||||
if (asnDetail.getRemark() == null && asnDetail.getAsn().getDescription() != null) {
|
if (asnDetail.getRemark() == null && asnDetail.getAsn().getDescription() != null) {
|
||||||
asnDetail.setRemark(asnDetail.getAsn().getDescription());
|
asnDetail.setRemark(asnDetail.getAsn().getDescription());
|
||||||
}
|
}
|
||||||
asnDetailService.create(asnDetail);
|
asnDetailService.create(asnDetail);
|
||||||
// Stock stock=asnDetail.getStock();
|
|
||||||
// stock.setStatus(BaseStatus.USED);
|
|
||||||
// stockService.update(stock);
|
|
||||||
//orderQty
|
|
||||||
//添加订单数量
|
//添加订单数量
|
||||||
if (asnDetail.getOrderQty() != null && asnDetail.getOrderQty() != 0) {
|
if (asnDetail.getOrderQty() != null && asnDetail.getOrderQty() != 0) {
|
||||||
Asn asn = asnDetail.getAsn();
|
Asn asn = asnDetail.getAsn();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue