|
|
@@ -30,6 +30,7 @@ import com.usoftchina.saas.purchase.service.ProdInOutService;
|
|
|
import com.usoftchina.saas.utils.BeanMapper;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.transaction.annotation.Propagation;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
@@ -112,7 +113,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- @Transactional
|
|
|
+ @Transactional(propagation = Propagation.REQUIRED)
|
|
|
public DocBaseDTO saveFormData(ProdInOutFormDTO formdata) {
|
|
|
if (null == formdata || null == formdata.getMain()){
|
|
|
throw new BizException(500, "数据为空,请填写后再保存");
|
|
|
@@ -120,8 +121,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
|
|
|
//公司ID
|
|
|
Long companyId = BaseContextHolder.getCompanyId();
|
|
|
//人员Id
|
|
|
- Map<String,Object> emp= employeeApi.getEmployeeByAccount();
|
|
|
- Long userId = Long.valueOf(String.valueOf(emp.get("em_id")));
|
|
|
+ Long userId = BaseContextHolder.getUserId();
|
|
|
|
|
|
//获取主表信息
|
|
|
ProdInOutDTO main = formdata.getMain();
|
|
|
@@ -137,7 +137,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
|
|
|
ProdInOut prodInOut = BeanMapper.map(main,ProdInOut.class);
|
|
|
prodInOut.setCompanyId(companyId);
|
|
|
prodInOut.setPi_recordmanid(userId.intValue());
|
|
|
- prodInOut.setPi_recordman(emp.get("em_name").toString());
|
|
|
+// prodInOut.setPi_recordman(emp.get("em_name").toString());
|
|
|
prodInOut.setCreatorId(userId);
|
|
|
prodInOut.setCreateTime(new Date());
|
|
|
prodInOut.setPi_date(new Date());
|
|
|
@@ -228,6 +228,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
|
|
|
singleDelete(id);
|
|
|
}
|
|
|
|
|
|
+ @Transactional(propagation = Propagation.REQUIRED)
|
|
|
private void singleDelete(Long id) {
|
|
|
|
|
|
ProdInOut prodInOut = checkAndReturnOrder(id);;
|
|
|
@@ -244,13 +245,12 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- @Transactional
|
|
|
public DocBaseDTO audit(ProdInOutFormDTO formData) {
|
|
|
Long id = null;
|
|
|
DocBaseDTO baseDTO = new DocBaseDTO();
|
|
|
if (null != formData) {
|
|
|
id = formData.getMain().getId();
|
|
|
- if (StringUtils.isEmpty(id)) {
|
|
|
+ if (StringUtils.isEmpty(id) ||"0".equals(String.valueOf(id))) {
|
|
|
baseDTO = saveFormData(formData);
|
|
|
id = baseDTO.getId();
|
|
|
}
|
|
|
@@ -260,6 +260,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
|
|
|
return baseDTO;
|
|
|
}
|
|
|
|
|
|
+ @Transactional(propagation = Propagation.REQUIRED)
|
|
|
private void singleAudit(ProdInOutDTO prodInOutDTO) {
|
|
|
String pi_class= prodInOutDTO.getPi_class();
|
|
|
String pi_inoutno = prodInOutDTO.getPi_inoutno();
|