Commit 3fa8051c authored by 竹天卫's avatar 竹天卫

fasdfsdaff

parent 69ba1013
......@@ -33,6 +33,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
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 javax.annotation.Resource;
......@@ -1227,7 +1228,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
* @param ids
* @return
*/
@Transactional
@Transactional(rollbackFor = Exception.class,propagation = Propagation.NESTED)
@Override
public BaseResponse<String> finishHandle(Integer[] ids) {
LoginUser loginUser = userService.getLoginUser();
......@@ -1264,12 +1265,15 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
//计算产值
if (sampleHandle.getContent() != null) {
String[] handIdS = sampleHandle.getContent().split("、");
String illMessage = "";
for (String handleId : handIdS) {
try {
iPrecipriceService.createPreciprice(sampleHandle.getUserId(),entrust.getId(),Integer.valueOf(handleId),0,sample.getId());
}catch (Exception e){
System.out.println(e.getMessage());
return BaseResponse.errorMsg(e.getMessage());
}
}
}
QueryWrapper<SampleHandle> sampleHandleWrapper = new QueryWrapper<>();
......
......@@ -18,7 +18,6 @@ import cn.wise.sc.cement.business.entity.SysGroup;
import cn.wise.sc.cement.business.entity.SysPost;
import cn.wise.sc.cement.business.entity.SysUser;
import cn.wise.sc.cement.business.entity.TeamGroup;
import cn.wise.sc.cement.business.mapper.EntrustMapper;
import cn.wise.sc.cement.business.mapper.PrecipriceMapper;
import cn.wise.sc.cement.business.model.BaseResponse;
import cn.wise.sc.cement.business.model.LoginUser;
......@@ -43,6 +42,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
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.Assert;
import javax.servlet.http.HttpServletResponse;
......@@ -73,8 +73,9 @@ import java.util.stream.Collectors;
@Service
public class PrecipriceServiceImpl extends ServiceImpl<PrecipriceMapper, Preciprice> implements IPrecipriceService {
final
EntrustMapper iEntrustService;
IEntrustService iEntrustService;
final
ISampleService iSampleService;
final
......@@ -96,7 +97,7 @@ public class PrecipriceServiceImpl extends ServiceImpl<PrecipriceMapper, Precipr
final
ISampleDistributionService iSampleDistributionService;
public PrecipriceServiceImpl(EntrustMapper iEntrustService,
public PrecipriceServiceImpl(IEntrustService iEntrustService,
ISampleService iSampleService,
INormProductionService iNormProductionService,
ISysUserService iSysUserService,
......@@ -121,7 +122,7 @@ public class PrecipriceServiceImpl extends ServiceImpl<PrecipriceMapper, Precipr
}
@Override
@Transactional(rollbackFor = Exception.class)
@Transactional(rollbackFor = Exception.class,propagation = Propagation.NESTED)
public boolean createPreciprice(final Integer userId, final Integer entrustId,
final Integer targetId, final Integer type,
final Integer sampleId) {
......@@ -132,7 +133,7 @@ public class PrecipriceServiceImpl extends ServiceImpl<PrecipriceMapper, Precipr
Assert.notNull(sampleId, "样品id不能为空!");
Assert.notNull(type, "处理项类型不能为空!");
//获取项目编号和名字
Entrust entrust = iEntrustService.selectById(entrustId);
Entrust entrust = iEntrustService.getById(entrustId);
if (BeanUtil.isEmpty(entrust)) {
log.debug("产值记录新增失败,项目没找到!");
throw new IllegalArgumentException("无效的项目id!");
......
......@@ -1980,11 +1980,7 @@
<!-- 这里是开头 -->
<#list list as iteam>
<#--<w:tr wsp:rsidR="007E280A" wsp:rsidRPr="003B3488" wsp:rsidTr="003B3488">-->
<TEXTAREA COLS="125" placeholder="选填部分,可以不填写。如果有需要说明的事项,填写在此处!"
style="overflow-y:hidden;height:100px;"
onpropertychange="this.style.height=this.scrollHeight+'px';"
oninput="this.style.height=this.scrollHeight+'px';">
<w:tr wsp:rsidR="007E280A" wsp:rsidRPr="003B3488" wsp:rsidTr="003B3488">
<w:trPr>
<w:trHeight w:h-rule="exact" w:val="600"/>
<w:jc
......@@ -2130,6 +2126,7 @@
</w:r>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="1754" w:type="dxa"/>
......@@ -2180,8 +2177,7 @@
</w:r>
</w:p>
</w:tc>
</TEXTAREA>
<#--</w:tr>-->
</w:tr>
</#list>
<!-- 这里是结尾 -->
<!-- ################################################################################################## -->
......
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 to comment