| @@ -11,6 +11,8 @@ import com.iformall.mapper.WxAuthorizerInfoMapper; | |||||
| import com.iformall.mapper.WxWeappCodeStatusMapper; | import com.iformall.mapper.WxWeappCodeStatusMapper; | ||||
| import com.iformall.service.WxWeappCodeStatusService; | import com.iformall.service.WxWeappCodeStatusService; | ||||
| import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
| @@ -20,6 +22,7 @@ import java.util.Map; | |||||
| @Service | @Service | ||||
| public class WxWeappCodeStatusServiceImpl implements WxWeappCodeStatusService { | public class WxWeappCodeStatusServiceImpl implements WxWeappCodeStatusService { | ||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | @Autowired | ||||
| WxWeappCodeStatusMapper wxWeappCodeStatusMapper; | WxWeappCodeStatusMapper wxWeappCodeStatusMapper; | ||||
| @@ -57,15 +60,17 @@ public class WxWeappCodeStatusServiceImpl implements WxWeappCodeStatusService { | |||||
| @Override | @Override | ||||
| public void saveOrUpdate(WxWeappCodeStatus record) { | public void saveOrUpdate(WxWeappCodeStatus record) { | ||||
| Date curDate = new Date(); | |||||
| if (record.getId() == null) { | if (record.getId() == null) { | ||||
| //record.setId(UUID.randomUUID().toString().replaceAll("-", "")); | //record.setId(UUID.randomUUID().toString().replaceAll("-", "")); | ||||
| final IdWorker idWorker = IdWorker.get(); | final IdWorker idWorker = IdWorker.get(); | ||||
| record.setId(idWorker.nextId()); | record.setId(idWorker.nextId()); | ||||
| record.setCreateTime(new Date()); | |||||
| record.setUpdateTime(new Date()); | |||||
| record.setCreateTime(curDate); | |||||
| record.setUpdateTime(curDate); | |||||
| wxWeappCodeStatusMapper.insertSelective(record); | wxWeappCodeStatusMapper.insertSelective(record); | ||||
| } else { | } else { | ||||
| record.setUpdateTime(new Date()); | |||||
| record.setUpdateTime(curDate); | |||||
| logger.info("CODE-COMMIT: " + record.toString()); | |||||
| wxWeappCodeStatusMapper.updateByPrimaryKey(record); | wxWeappCodeStatusMapper.updateByPrimaryKey(record); | ||||
| } | } | ||||
| } | } | ||||
| @@ -74,6 +79,7 @@ public class WxWeappCodeStatusServiceImpl implements WxWeappCodeStatusService { | |||||
| public void updateCodeCommitStatus(WxWeappCodeStatus record) { | public void updateCodeCommitStatus(WxWeappCodeStatus record) { | ||||
| Date curDate = new Date(); | Date curDate = new Date(); | ||||
| record.setUpdateTime(curDate); | record.setUpdateTime(curDate); | ||||
| logger.info("CODE-COMMIT: " + record.toString()); | |||||
| wxWeappCodeStatusMapper.updateByPrimaryKey(record); | wxWeappCodeStatusMapper.updateByPrimaryKey(record); | ||||
| } | } | ||||