| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.aps.common.core.utils.DateUtils; |
| | | import com.aps.common.core.utils.StringUtils; |
| | | import com.aps.common.core.utils.uuid.IdUtils; |
| | | import com.aps.core.domain.ApsPartPlan; |
| | | import com.aps.core.domain.ApsPartPlanTemp; |
| | |
| | | import com.aps.core.mapper.ApsWeldSeamMapper; |
| | | import com.aps.core.domain.ApsWeldSeam; |
| | | import com.aps.core.service.IApsWeldSeamService; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | /** |
| | | * 焊缝Service业务层处理 |
| | |
| | | public int insertApsWeldSeam(ApsWeldSeam apsWeldSeam) |
| | | { |
| | | apsWeldSeam.setId(IdUtils.fastUUID()); |
| | | apsWeldSeam.setCreateTime(DateUtils.getNowDate()); |
| | | return apsWeldSeamMapper.insertApsWeldSeam(apsWeldSeam); |
| | | } |
| | | |
| | |
| | | ids[i]=apsWeldSeamTemps.get(i).getId(); |
| | | ApsWeldSeam apsWeldSeam=new ApsWeldSeam(); |
| | | BeanUtils.copyProperties(apsWeldSeamTemps.get(i), apsWeldSeam); |
| | | apsWeldSeam.setId(IdUtils.fastUUID()); |
| | | //插入正式表,并记录 |
| | | apsWeldSeamMapper.insertApsWeldSeam(apsWeldSeam); |
| | | //通过工单号查询是否存在数据 |
| | | ApsWeldSeam apsWeldSeam1=apsWeldSeamMapper.selectApsWeldSeamByWorkOrderNo(apsWeldSeam.getWorkOrderNo()); |
| | | //当工单号存在则更新数据否则插入数据 |
| | | if(StringUtils.isNotEmpty(apsWeldSeam1.getId())){ |
| | | apsWeldSeam.setId(apsWeldSeam1.getId()); |
| | | apsWeldSeamMapper.updateApsWeldSeam(apsWeldSeam); |
| | | }else { |
| | | //插入正式表,并记录 |
| | | apsWeldSeam.setId(IdUtils.fastUUID()); |
| | | apsWeldSeamMapper.insertApsWeldSeam(apsWeldSeam); |
| | | } |
| | | count++; |
| | | } |
| | | //插入数量与临时表查询一直则删除临时表数据 |