|
@@ -16,12 +16,15 @@ import com.fuzamei.mapperInterface.PlannerMapper;
|
|
import com.fuzamei.mapperInterface.ReceivingClerkMapper;
|
|
import com.fuzamei.mapperInterface.ReceivingClerkMapper;
|
|
import com.fuzamei.mapperInterface.UserMapper;
|
|
import com.fuzamei.mapperInterface.UserMapper;
|
|
import com.fuzamei.service.PlannerService;
|
|
import com.fuzamei.service.PlannerService;
|
|
|
|
+import com.fuzamei.util.blockchain.BlockChainUtil;
|
|
@Service
|
|
@Service
|
|
public class PlannerServiceImpl implements PlannerService{
|
|
public class PlannerServiceImpl implements PlannerService{
|
|
@Autowired
|
|
@Autowired
|
|
private PlannerMapper plannerMapper;
|
|
private PlannerMapper plannerMapper;
|
|
@Autowired
|
|
@Autowired
|
|
private UserMapper userMapper;
|
|
private UserMapper userMapper;
|
|
|
|
+ @Autowired
|
|
|
|
+ private BlockChainUtil blockChainUtil;
|
|
@Override
|
|
@Override
|
|
public List<User> queryPlanner(Map<String, Object> map) {
|
|
public List<User> queryPlanner(Map<String, Object> map) {
|
|
return plannerMapper.queryPlanner(map);
|
|
return plannerMapper.queryPlanner(map);
|
|
@@ -47,12 +50,11 @@ public class PlannerServiceImpl implements PlannerService{
|
|
@Override
|
|
@Override
|
|
@Transactional(rollbackFor=Exception.class)
|
|
@Transactional(rollbackFor=Exception.class)
|
|
public void insertAgainSupplier(User pp) {//得到前端传来所有得供应商ID 做插入操作
|
|
public void insertAgainSupplier(User pp) {//得到前端传来所有得供应商ID 做插入操作
|
|
|
|
+ deleteBeforeSupplierByUserId(Integer.parseInt(pp.getPlannerId()));//删除计划员下面的所有供应商
|
|
|
|
+
|
|
//下面是【循环添加供应商得id】
|
|
//下面是【循环添加供应商得id】
|
|
- String[] str=pp.getSupplierId().split(",");
|
|
|
|
- for (int i = 0; i < str.length; i++) {
|
|
|
|
- pp.setSupplierId(str[i]);
|
|
|
|
- plannerMapper.insertAgainSupplier(pp);
|
|
|
|
- }
|
|
|
|
|
|
+ pp.setSupplierIds(pp.getSupplierId().split(","));
|
|
|
|
+ plannerMapper.insertAgainSupplier(pp);
|
|
|
|
|
|
|
|
|
|
//下面往【操作记录】表插入数据
|
|
//下面往【操作记录】表插入数据
|
|
@@ -68,10 +70,10 @@ public class PlannerServiceImpl implements PlannerService{
|
|
pp.setHash(hash);//操作hash
|
|
pp.setHash(hash);//操作hash
|
|
userMapper.insertOperationHistory(pp);//插入到操作记录表去
|
|
userMapper.insertOperationHistory(pp);//插入到操作记录表去
|
|
|
|
|
|
- /*boolean flag = blockChainUtil.sendBlockChain(pp.getSign());//发送签名直接转发到区块链
|
|
|
|
|
|
+ boolean flag = blockChainUtil.sendBlockChain(pp.getSign());//发送签名直接转发到区块链
|
|
if(!flag) {
|
|
if(!flag) {
|
|
- throw new RuntimeException("区块链操作失败2");
|
|
|
|
- }*/
|
|
|
|
|
|
+ throw new RuntimeException("区块链操作失败");
|
|
|
|
+ }
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|