| | |
| | | import com.bstek.bdf2.core.orm.hibernate.HibernateDao; |
| | | import com.bstek.dorado.data.entity.EntityUtils; |
| | | import com.bstek.dorado.data.provider.Page; |
| | | import com.ld.igds.check.dto.CheckItemData; |
| | | import com.ld.igds.check.mapper.CheckStandardMapper; |
| | | import com.ld.igds.constant.RedisConst; |
| | | import com.ld.igds.models.MQuality; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @author chen |
| | |
| | | if (null == data.getDeptId()) { |
| | | data.setDeptId(ContextUtil.subDeptId(null)); |
| | | } |
| | | if (null != data.getZblb() || "" != data.getZblb()) { |
| | | String[] str = data.getZblb().split("#"); |
| | | //防止在更新操作时再次存入相同的数据 |
| | | Set<String> metrics = new HashSet<>(); |
| | | for (int i = 0; i < str.length; i++) { |
| | | metrics.add(str[i].substring(0, 1)); |
| | | } |
| | | String value = ""; |
| | | for (String s : metrics) { |
| | | value = value + s + "#"; |
| | | } |
| | | data.setZblb(value.substring(0, value.length() - 1)); |
| | | } |
| | | Session session = this.getSessionFactory().openSession(); |
| | | data.setUpdateTime(new Date()); |
| | | try { |
| | |
| | | try { |
| | | if (null != data.getId()) { |
| | | session.delete(data); |
| | | CheckItemData checkItemData = new CheckItemData(); |
| | | checkItemData.setCompanyId(ContextUtil.getCompanyId()); |
| | | checkItemData.setCheckId(data.getId()); |
| | | checkStandardMapper.delCheckItemByParam(checkItemData); |
| | | redisUtil.del(RedisConst.buildKey(ContextUtil.getCompanyId(), RedisConst.KEY_DEPOT_QUALITY, data.getDepotId())); |
| | | } |
| | | } catch (Exception e) { |