| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import java.util.ArrayList; |
| | | import java.util.Map; |
| | | |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.sy.mapper.ArdTankWallLockMapper; |
| | | import com.ruoyi.sy.domain.ArdTankWallLock; |
| | | import com.ruoyi.sy.service.IArdTankWallLockService; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * 电子围栏电磁锁Service业务层处理 |
| | |
| | | */ |
| | | @Service |
| | | public class ArdTankWallLockServiceImpl implements IArdTankWallLockService { |
| | | @Autowired |
| | | @Resource |
| | | private ArdTankWallLockMapper ardTankWallLockMapper; |
| | | |
| | | /** |
| | |
| | | public int deleteArdTankWallLockByProcessType(String processType) { |
| | | return ardTankWallLockMapper.deleteArdTankWallLockByProcessType(processType); |
| | | } |
| | | |
| | | @Override |
| | | public int insertWallLock(Map<String, Object> para) { |
| | | String id = (String) para.get("id");//锁主键 |
| | | List<Map<String,String>> tankWallLockList = (List<Map<String, String>>) para.get("tankWallLockList"); |
| | | //List<ArdTankWallLock> tankWallLocks = new ArrayList(); |
| | | int result = 0; |
| | | for(Map<String,String> map : tankWallLockList){ |
| | | ArdTankWallLock ardTankWallLock = new ArdTankWallLock(); |
| | | ardTankWallLock.setWallId(map.get("wallId")); |
| | | ardTankWallLock.setLockId(id); |
| | | List<ArdTankWallLock> ardTankWallLockList = ardTankWallLockMapper.selectArdTankWallLockList(ardTankWallLock); |
| | | if(ardTankWallLockList.size() != 0){ |
| | | ardTankWallLock.setProcessType(map.get("processType")); |
| | | result = result + ardTankWallLockMapper.updateArdTankWallLockByWallIdAndLockId(ardTankWallLock); |
| | | }else{ |
| | | ardTankWallLock.setProcessType(map.get("processType")); |
| | | ardTankWallLock.setId(IdUtils.simpleUUID()); |
| | | result = result + ardTankWallLockMapper.insertArdTankWallLock(ardTankWallLock); |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | @Override |
| | | public int deleteArdTankWallLockByLockId(String id) { |
| | | int result = ardTankWallLockMapper.deleteArdTankWallLockByLockId(id); |
| | | return result; |
| | | } |
| | | } |